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

54 lines
1.6 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 * 1000; // 1000 hours
2018-08-15 14:43:47 +02:00
public boolean useSchedule;
// 10 seconds based
public int scheduleTimeOfDay = 60 * 6 * 12; // 12:00 - 60*6*12
// day since 2000
public int scheduleDayNumber;
2018-08-05 22:35:28 +02:00
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);
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-04 13:03:06 +02:00
}