OsmAnd/OsmAnd-java/src/main/java/net/osmand/router/TransportRoutingConfiguration.java

63 lines
2 KiB
Java
Raw Normal View History

2018-08-04 13:03:06 +02:00
package net.osmand.router;
public class TransportRoutingConfiguration {
2018-08-07 10:05:28 +02:00
public static final String KEY = "public_transport";
2018-08-04 13:03:06 +02:00
public int ZOOM_TO_LOAD_TILES = 14;
2018-08-05 10:55:08 +02:00
public int walkRadius = 1500; // ? 3000
2018-08-04 13:03:06 +02:00
public int walkChangeRadius = 300;
public double walkSpeed = 3.6 / 3.6; // m/s
public double travelSpeed = 36 / 3.6; // m/s
public int stopTime = 30;
public int changeTime = 300;
2018-08-05 10:55:08 +02:00
public int maxNumberOfChanges = 5;
2018-08-04 13:03:06 +02:00
public int finishTimeSeconds = 1200;
public int maxRouteTime = 60 * 60 * 10; // 10 hours
2018-08-15 14:43:47 +02:00
public boolean useSchedule;
// 10 seconds based
2018-08-20 21:00:22 +02:00
public int scheduleTimeOfDay = 12 * 60 * 6; // 12:00 - 60*6*12
public int scheduleMaxTime = 50 * 6; // TODO not appropriate variable, should be dynamic
public int scheduleMinChangeTime = 180; // 3 min
2018-08-15 14:43:47 +02:00
// day since 2000
public int scheduleDayNumber;
2018-08-05 22:35:28 +02:00
2018-08-20 21:00:22 +02:00
public int getChangeTime() {
return useSchedule ? scheduleMinChangeTime : changeTime;
}
2018-08-07 10:05:28 +02:00
public TransportRoutingConfiguration(RoutingConfiguration.Builder builder) {
GeneralRouter router = builder == null ? null : builder.getRouter("public_transport");
if(router != null) {
walkRadius = router.getIntAttribute("walkRadius", walkRadius);
walkChangeRadius = router.getIntAttribute("walkChangeRadius", walkRadius);
ZOOM_TO_LOAD_TILES = router.getIntAttribute("zoomToLoadTiles", ZOOM_TO_LOAD_TILES);
maxNumberOfChanges = router.getIntAttribute("maxNumberOfChanges", maxNumberOfChanges);
2019-03-06 01:46:23 +01:00
maxRouteTime = router.getIntAttribute("maxRouteTime", maxRouteTime);
2018-08-07 10:05:28 +02:00
finishTimeSeconds = router.getIntAttribute("delayForAlternativesRoutes", finishTimeSeconds);
travelSpeed = router.getFloatAttribute("defaultTravelSpeed", (float) travelSpeed);
walkSpeed = router.getFloatAttribute("defaultWalkSpeed", (float) walkSpeed);
stopTime = router.getIntAttribute("defaultStopTime", stopTime);
changeTime = router.getIntAttribute("defaultChangeTime", changeTime);
2018-08-20 21:00:22 +02:00
scheduleMinChangeTime = router.getIntAttribute("defaultScheduleChangeTime", changeTime);
2018-08-07 10:05:28 +02:00
}
}
2018-08-04 13:03:06 +02:00
}