private static void checkLaneDefinitionRoutingConfiguration(final Config config) { if ((config.qsim().isUseLanes()) && !config.controler().isLinkToLinkRoutingEnabled()){ log.warn("Using lanes without enabling linktolinkrouting might not lead to expected simulation results"); } }
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 (getConfig().controler().isLinkToLinkRoutingEnabled()){
boolean linkToLinkRouting = getConfig().controler().isLinkToLinkRoutingEnabled(); if (linkToLinkRouting) { bind(NetworkTurnInfoBuilderI.class).to(NetworkTurnInfoBuilder.class) ;
/** * Ensure that the enableLinkToLinkRouting value is correctly stored and * returned with the getters and setters. */ @Test public void testLink2LinkRouting(){ ControlerConfigGroup cg = new ControlerConfigGroup(); //initial value Assert.assertFalse(cg.isLinkToLinkRoutingEnabled()); //modify by string cg.addParam("enableLinkToLinkRouting", "true"); Assert.assertTrue(cg.isLinkToLinkRoutingEnabled()); cg.addParam("enableLinkToLinkRouting", "false"); Assert.assertFalse(cg.isLinkToLinkRoutingEnabled()); //modify by boolean cg.setLinkToLinkRoutingEnabled(true); Assert.assertTrue(cg.isLinkToLinkRoutingEnabled()); Assert.assertEquals("true", cg.getValue("enableLinkToLinkRouting")); cg.setLinkToLinkRoutingEnabled(false); Assert.assertFalse(cg.isLinkToLinkRoutingEnabled()); Assert.assertEquals("false", cg.getValue("enableLinkToLinkRouting")); }