public SimpleCircleScheduleProvider(String pIdentifier, TransitSchedule scheduleWithStopsOnly, Network network, RandomStopProvider randomStopProvider, double vehicleMaximumVelocity, double driverRestTime, final String transportMode) { this.pIdentifier = pIdentifier; this.net = network; this.scheduleWithStopsOnly = scheduleWithStopsOnly; this.randomStopProvider = randomStopProvider; this.transportMode = transportMode; FreespeedTravelTimeAndDisutility tC = new FreespeedTravelTimeAndDisutility(-6.0, 0.0, 0.0); this.routingAlgo = new DijkstraFactory().createPathCalculator(this.net, tC, tC); @SuppressWarnings("serial") Set<String> modes = new HashSet<String>(){{ // this is the networkmode and explicitly not the transportmode add(TransportMode.car); }}; ((Dijkstra)this.routingAlgo).setModeRestriction(modes); this.vehicleMaximumVelocity = vehicleMaximumVelocity; this.driverRestTime = driverRestTime; }
public ComplexCircleScheduleProvider(TransitSchedule scheduleWithStopsOnly, Network network, RandomStopProvider randomStopProvider, double vehicleMaximumVelocity, double planningSpeedFactor, double driverRestTime, final String transportMode) { this.net = network; this.scheduleWithStopsOnly = scheduleWithStopsOnly; FreespeedTravelTimeAndDisutility tC = new FreespeedTravelTimeAndDisutility(-6.0, 0.0, 0.0); // Here, it may make sense to use the variable cost parameters given in the config. Ihab/Daniel may'14 this.routingAlgo = new DijkstraFactory().createPathCalculator(this.net, tC, tC); @SuppressWarnings("serial") Set<String> modes = new HashSet<String>(){{ // this is the networkmode and explicitly not the transportmode add(TransportMode.car); }}; ((Dijkstra)this.routingAlgo).setModeRestriction(modes); // register all stops by their corresponding link id this.linkId2StopFacilityMap = new LinkedHashMap<>(); for (TransitStopFacility stop : this.scheduleWithStopsOnly.getFacilities().values()) { if (stop.getLinkId() == null) { log.warn("There is a potential paratransit stop without a corresponding link id. Shouldn't be possible. Check stop " + stop.getId()); } else { this.linkId2StopFacilityMap.put(stop.getLinkId(), stop); } } this.randomStopProvider = randomStopProvider; this.vehicleMaximumVelocity = vehicleMaximumVelocity; this.planningSpeedFactor = planningSpeedFactor; this.driverRestTime = driverRestTime; this.transportMode = transportMode; }
((Dijkstra)this.routingAlgo).setModeRestriction(modes);
((Dijkstra) routingAlgo).setModeRestriction(modes);