@Override public void checkConsistency(Config config) { new DynQSimConfigConsistencyChecker().checkConsistency(config); if (!config.qsim().isInsertingWaitingVehiclesBeforeDrivingVehicles()) { // Typically, vrp paths are calculated from startLink to endLink // (not from startNode to endNode). That requires making some assumptions // on how much time travelling on the first and last links takes. // The current implementation assumes: // (a) free-flow travelling on the last link, which is actually the case in QSim, and // (b) a 1-second stay on the first link (spent on moving over the first node). // The latter expectation is assumes that departing vehicles must be inserted before driving ones // (though that still does not guarantee 1-second stay since the vehicle may need to wait if the next // link is fully congested) log.warn(" 'QSim.insertingWaitingVehiclesBeforeDrivingVehicles' should be true in order to get" + " more precise travel time estimates. See comments in DvrpConfigConsistencyChecker"); } if (config.qsim().isRemoveStuckVehicles()) { throw new RuntimeException("Stuck DynAgents cannot be removed from simulation"); } } }
if ( config.qsim()!=null && config.qsim().isRemoveStuckVehicles() ) { problem = true ; System.out.flush() ;
private static void checkTravelTimeCalculationRoutingConfiguration(final Config config){ if (config.controler().isLinkToLinkRoutingEnabled() && !config.travelTimeCalculator().isCalculateLinkToLinkTravelTimes()){ throw new IllegalStateException("LinkToLinkRouting is activated in config and" + " link to link traveltime calculation is not enabled but required!"); } if (config.travelTimeCalculator().isCalculateLinkTravelTimes() && config.travelTimeCalculator().isCalculateLinkToLinkTravelTimes() && !config.controler().isLinkToLinkRoutingEnabled()) { log.warn("Config enables link travel time calculation and link to link " + "travel time calculation. This requires at least twice as much memory as " + "if only one method is used, however it might be necessary to enable " + "a certain module configuration."); } if (!config.travelTimeCalculator().isCalculateLinkTravelTimes()){ log.warn("Link travel time calculation is switched off, be aware that this optimization" + "might not work with all modules. "); } if (config.travelTimeCalculator().isCalculateLinkToLinkTravelTimes() && config.qsim().isRemoveStuckVehicles()){ throw new IllegalStateException("Link to link travel time calculation is not" + "available if using the remove stuck vehicles option!"); } if ( config.controler().isLinkToLinkRoutingEnabled() && config.controler().getRoutingAlgorithmType() != RoutingAlgorithmType.Dijkstra ) { log.warn("We don't know if non-Dijkstra routing works together with LinkToLink routing."); } }
if (this.context.qsimConfig.isRemoveStuckVehicles()) { moveVehicleFromInlinkToAbort(veh, fromLane, now, currentLink.getId()); return false ;