From 09f4c795f32477583d6891319dada7f2ecb4b630 Mon Sep 17 00:00:00 2001 From: Marcel Rieser Date: Mon, 23 Oct 2023 20:34:55 +0200 Subject: [PATCH 1/3] update code to work with 16.0-2023w43 multiple refactorings from Code Sprint had to be applied --- pom.xml | 2 +- .../RunWithCommandLineOptionsExample.java | 4 +-- .../RunEventsHandlingExample.java | 2 +- ...RunEventsHandlingWithControlerExample.java | 2 +- .../bicycle/RunBicycleContribExample.java | 20 +++++------ .../RunDiscreteModeChoiceExample.java | 22 ++++++------ .../extensions/dvrp/RunDrtExample.java | 22 ++++++------ .../RunAverageEmissionToolOfflineExample.java | 12 +++---- .../extensions/freight/RunFreightExample.java | 28 +++++++-------- .../RunFreightWithEmissionExample.java | 32 ++++++++--------- .../RunFreightWithIterationsExample.java | 36 +++++++++---------- ...unLocationChoiceFrozenEpsilonsExample.java | 4 +-- .../RunMatsimApplicationExample.java | 2 +- .../extensions/minibus/RunMinibusExample.java | 2 +- .../otfvis/RunTransitWithOtfvisExample.java | 2 +- .../roadpricing/RunRoadpricingExample.java | 6 ++-- .../RunWithFacilitiesExample.java | 12 +++---- .../RunBicycleExpresswayExample.java | 14 ++++---- .../integration/RunMultipleModesExample.java | 16 ++++----- ...unQSimComponentRequestInConfigExample.java | 4 +-- ...SimComponentRequestInControlerExample.java | 4 +-- .../RunMobsimListenerExample.java | 6 ++-- .../TestMobsimListenerScope.java | 4 +-- ...MobsimWithMultipleModeVehiclesExample.java | 24 ++++++------- .../RunAddAgentSourceExample.java | 4 +-- .../RunOwnMobsimAgentUsingRouterExample.java | 2 +- ...unOwnMobsimAgentWithPerceptionExample.java | 4 +-- .../RunPluggableTripRouterExample.java | 2 +- .../RunSimpleAdaptiveSignalExample.java | 6 ++-- .../RunTimeDependentNetworkExample.java | 2 +- .../RunPCreateDrivingAgents.java | 10 +++--- ...ducePopulationToAreaOfInterestExample.java | 2 +- .../RunControlerListenerExample.java | 2 +- .../RunInjectionBeforeControlerExample.java | 2 +- .../RunInjectionWithoutControlerExample.java | 2 +- .../RunLeastCostPathCalculatorExample.java | 6 ++-- .../MultipleJvmBlackBox.java | 6 ++-- ...StrategiesWithDifferentSubpopsExample.java | 8 ++--- .../RunSubpopulationsExample.java | 26 +++++++------- .../RunOwnPrepareForSimExample.java | 10 +++--- .../RunParallelisationExample.java | 10 +++--- .../RunReuseDefaultBindingsExample1.java | 4 +-- .../RunTerminationCriterionExample.java | 4 +-- ...rtationMobsimWithCustomRoutingExample.java | 12 +++---- .../RunRandomizingRouterExample.java | 6 ++-- .../RunTravelDisutilityExample.java | 6 ++-- .../RunIncomeDependentScoringExample.java | 14 ++++---- ...ividualizedScoringParametersPerPerson.java | 2 +- .../RunIndividualizedScoringExample.java | 2 +- .../RunScenarioWithCustomScoring.java | 4 +-- .../RunOwnMoneyScoringExample.java | 4 +-- .../scoring/ownScoring/RunScoringExample.java | 4 +-- .../RunPseudoRandomExperiment.java | 36 +++++++++---------- .../RunScoringBySubpopulationExample.java | 8 ++--- ...yExpBetaPlanChangerForRemovalProvider.java | 2 +- .../RunPlanSelectorForRemovalExample.java | 8 ++--- ...RunPluggablePlanStrategyInCodeExample.java | 10 +++--- .../RunWithinDayReplanningAgentExample.java | 6 ++-- .../MyWithinDayMobsimListener.java | 2 +- ...unWithinDayReplanningFromPlansExample.java | 2 +- .../config/ExamplesByConfigfileTest.java | 1 - .../ExternalMobsimByConfigfileTest.java | 3 +- .../extensions/minibus/RunMinibusTest.java | 6 ++-- .../RunMultipleModesExampleTest.java | 6 ++-- ...imWithMultipleModeVehiclesExampleTest.java | 1 - .../RunReplaceAgentFactoryExampleTest.java | 6 ++-- .../ControlerListenerExampleTest.java | 2 +- .../IntegrationTest.java | 2 +- .../scenario/ScenarioElementAndInjection.java | 4 +-- .../IntegrationTest.java | 2 +- 70 files changed, 276 insertions(+), 279 deletions(-) diff --git a/pom.xml b/pom.xml index dd2392b8..d4ae2c69 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,7 @@ - 16.0-2023w41 + 16.0-2023w43 diff --git a/src/main/java/org/matsim/codeexamples/config/commandline/RunWithCommandLineOptionsExample.java b/src/main/java/org/matsim/codeexamples/config/commandline/RunWithCommandLineOptionsExample.java index b4dd3402..eaff7eb4 100644 --- a/src/main/java/org/matsim/codeexamples/config/commandline/RunWithCommandLineOptionsExample.java +++ b/src/main/java/org/matsim/codeexamples/config/commandline/RunWithCommandLineOptionsExample.java @@ -12,7 +12,7 @@ class RunWithCommandLineOptionsExample{ public static void main( String[] args ){ Config config = ConfigUtils.createConfig() ; - log.warn( config.controler().getOutputDirectory() ) ; + log.warn( config.controller().getOutputDirectory() ) ; try{ CommandLine.Builder bld = new CommandLine.Builder( args ) ; @@ -22,7 +22,7 @@ public static void main( String[] args ){ throw new RuntimeException( e ) ; } - log.warn( config.controler().getOutputDirectory() ) ; + log.warn( config.controller().getOutputDirectory() ) ; } diff --git a/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingExample.java b/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingExample.java index dddf0ba0..d377635c 100644 --- a/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingExample.java +++ b/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingExample.java @@ -45,7 +45,7 @@ public static void main(String[] args) { //path to events file. For this you first need to run a simulation. Config config = ConfigUtils.loadConfig("scenarios/equil/config.xml"); - config.controler().setLastIteration(5); + config.controller().setLastIteration(5); Scenario scenario = ScenarioUtils.loadScenario(config); Controler controler = new Controler(scenario); controler.run(); diff --git a/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingWithControlerExample.java b/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingWithControlerExample.java index 7ea0bd2f..7b149b5f 100644 --- a/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingWithControlerExample.java +++ b/src/main/java/org/matsim/codeexamples/events/eventsHandling/RunEventsHandlingWithControlerExample.java @@ -49,7 +49,7 @@ public static void main(String[] args) { config = ConfigUtils.loadConfig( args[0] ) ; } - config.controler().setOutputDirectory(outputDirectory); + config.controller().setOutputDirectory(outputDirectory); final Scenario scenario = ScenarioUtils.loadScenario(config) ; diff --git a/src/main/java/org/matsim/codeexamples/extensions/bicycle/RunBicycleContribExample.java b/src/main/java/org/matsim/codeexamples/extensions/bicycle/RunBicycleContribExample.java index ea801eee..5edcb77a 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/bicycle/RunBicycleContribExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/bicycle/RunBicycleContribExample.java @@ -9,9 +9,9 @@ import org.matsim.contrib.bicycle.BicycleModule; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.scenario.ScenarioUtils; @@ -39,18 +39,18 @@ public static void main(String[] args) { config.network().setInputFile("network_lane.xml"); // Modify this config.plans().setInputFile("population_1200.xml"); - config.strategy().addStrategySettings( new StrategyConfigGroup.StrategySettings().setStrategyName("ChangeExpBeta" ).setWeight(0.8 ) ); - config.strategy().addStrategySettings( new StrategyConfigGroup.StrategySettings().setStrategyName("ReRoute" ).setWeight(0.2 ) ); + config.replanning().addStrategySettings( new ReplanningConfigGroup.StrategySettings().setStrategyName("ChangeExpBeta" ).setWeight(0.8 ) ); + config.replanning().addStrategySettings( new ReplanningConfigGroup.StrategySettings().setStrategyName("ReRoute" ).setWeight(0.2 ) ); - config.planCalcScore().addActivityParams( new PlanCalcScoreConfigGroup.ActivityParams("home").setTypicalDuration(12*60*60 ) ); - config.planCalcScore().addActivityParams( new PlanCalcScoreConfigGroup.ActivityParams("work").setTypicalDuration(8*60*60 ) ); + config.scoring().addActivityParams( new ScoringConfigGroup.ActivityParams("home").setTypicalDuration(12*60*60 ) ); + config.scoring().addActivityParams( new ScoringConfigGroup.ActivityParams("work").setTypicalDuration(8*60*60 ) ); - config.planCalcScore().addModeParams( new PlanCalcScoreConfigGroup.ModeParams("bicycle").setConstant(0. ).setMarginalUtilityOfDistance(-0.0004 ).setMarginalUtilityOfTraveling(-6.0 ).setMonetaryDistanceRate(0. ) ); + config.scoring().addModeParams( new ScoringConfigGroup.ModeParams("bicycle").setConstant(0. ).setMarginalUtilityOfDistance(-0.0004 ).setMarginalUtilityOfTraveling(-6.0 ).setMonetaryDistanceRate(0. ) ); config.global().setNumberOfThreads(1 ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(100); // Modify if motorized interaction is used + config.controller().setLastIteration(100); // Modify if motorized interaction is used } BicycleConfigGroup bicycleConfigGroup = ConfigUtils.addOrGetModule( config, BicycleConfigGroup.class ); @@ -64,7 +64,7 @@ public static void main(String[] args) { config.qsim().setMainModes(mainModeList ); - config.plansCalcRoute().setNetworkModes(mainModeList ); + config.routing().setNetworkModes(mainModeList ); // === diff --git a/src/main/java/org/matsim/codeexamples/extensions/discrete_mode_choice/RunDiscreteModeChoiceExample.java b/src/main/java/org/matsim/codeexamples/extensions/discrete_mode_choice/RunDiscreteModeChoiceExample.java index 8db6da2b..efe16f83 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/discrete_mode_choice/RunDiscreteModeChoiceExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/discrete_mode_choice/RunDiscreteModeChoiceExample.java @@ -8,8 +8,8 @@ import org.matsim.contribs.discrete_mode_choice.modules.config.DiscreteModeChoiceConfigGroup; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.RoutingConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -17,7 +17,7 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.collections.CollectionUtils; -import static org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import static org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; public final class RunDiscreteModeChoiceExample{ // The code below works with v14 since approx jun'21. kai @@ -29,23 +29,23 @@ public static void main ( String [] args ) { Config config = ConfigUtils.loadConfig( args ); - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); + config.controller().setLastIteration( 2 ); String modeB = "modeB"; String modeC = "modeC"; final String[] modes = {TransportMode.car, modeB, modeC}; - config.plansCalcRoute().addTeleportedModeParams( new PlansCalcRouteConfigGroup.TeleportedModeParams(modeB).setTeleportedModeSpeed(10. ) ); - config.plansCalcRoute().addTeleportedModeParams( new PlansCalcRouteConfigGroup.TeleportedModeParams(modeC).setTeleportedModeSpeed(10. ) ); - config.plansCalcRoute().addTeleportedModeParams( new PlansCalcRouteConfigGroup.TeleportedModeParams(TransportMode.walk).setTeleportedModeSpeed(4./3.6 ) ); + config.routing().addTeleportedModeParams( new RoutingConfigGroup.TeleportedModeParams(modeB).setTeleportedModeSpeed(10. ) ); + config.routing().addTeleportedModeParams( new RoutingConfigGroup.TeleportedModeParams(modeC).setTeleportedModeSpeed(10. ) ); + config.routing().addTeleportedModeParams( new RoutingConfigGroup.TeleportedModeParams(TransportMode.walk).setTeleportedModeSpeed(4./3.6 ) ); - config.planCalcScore().addModeParams( new PlanCalcScoreConfigGroup.ModeParams( modeB ).setConstant( 13. ) ); - config.planCalcScore().addModeParams( new PlanCalcScoreConfigGroup.ModeParams( modeC ).setConstant( 12. ) ); + config.scoring().addModeParams( new ScoringConfigGroup.ModeParams( modeB ).setConstant( 13. ) ); + config.scoring().addModeParams( new ScoringConfigGroup.ModeParams( modeC ).setConstant( 12. ) ); // the following is first inlined and then adapted from DiscreteModeChoiceConfigurator.configureAsSubtourModeChoiceReplacement( config ); - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DiscreteModeChoiceModule.STRATEGY_NAME ).setWeight( 1. ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DiscreteModeChoiceModule.STRATEGY_NAME ).setWeight( 1. ) ); { DiscreteModeChoiceConfigGroup dmcConfig = ConfigUtils.addOrGetModule( config, DiscreteModeChoiceConfigGroup.class ); diff --git a/src/main/java/org/matsim/codeexamples/extensions/dvrp/RunDrtExample.java b/src/main/java/org/matsim/codeexamples/extensions/dvrp/RunDrtExample.java index 88b4ce9f..683dec1b 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/dvrp/RunDrtExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/dvrp/RunDrtExample.java @@ -17,10 +17,10 @@ import org.matsim.contrib.otfvis.OTFVisLiveModule; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ModeParams; +import org.matsim.core.config.groups.ScoringConfigGroup.ModeParams; import org.matsim.core.config.groups.QSimConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup.SnapshotStyle; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule.DefaultSelector; @@ -53,10 +53,10 @@ public static void run(boolean otfvis, String... args ){ config = ConfigUtils.loadConfig( args ); } else { config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "dvrp-grid" ), "multi_mode_one_shared_taxi_config.xml" ) ); - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); } - config.controler().setLastIteration( 1 ); + config.controller().setLastIteration( 1 ); config.qsim().setSimStarttimeInterpretation( QSimConfigGroup.StarttimeInterpretation.onlyUseStarttime ); config.qsim().setInsertingWaitingVehiclesBeforeDrivingVehicles(true); @@ -108,24 +108,24 @@ public static void run(boolean otfvis, String... args ){ } for (DrtConfigGroup drtCfg : multiModeDrtCfg.getModalElements()) { - DrtConfigs.adjustDrtConfig(drtCfg, config.planCalcScore(), config.plansCalcRoute()); + DrtConfigs.adjustDrtConfig(drtCfg, config.scoring(), config.routing()); } { // clear strategy settings from config file: - config.strategy().clearStrategySettings(); + config.replanning().clearStrategySettings(); // configure mode innovation so that travellers start using drt: - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DefaultStrategy.ChangeSingleTripMode ).setWeight( 0.1 ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DefaultStrategy.ChangeSingleTripMode ).setWeight( 0.1 ) ); config.changeMode().setModes( new String[]{TransportMode.car, DRT_A, DRT_B, DRT_C} ); // have a "normal" plans choice strategy: - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setWeight( 1. ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setWeight( 1. ) ); } { // add params so that scoring works: - config.planCalcScore().addModeParams( new ModeParams( DRT_A ) ); - config.planCalcScore().addModeParams( new ModeParams( DRT_B ) ); - config.planCalcScore().addModeParams( new ModeParams( DRT_C ) ); + config.scoring().addModeParams( new ModeParams( DRT_A ) ); + config.scoring().addModeParams( new ModeParams( DRT_B ) ); + config.scoring().addModeParams( new ModeParams( DRT_C ) ); } Scenario scenario = ScenarioUtils.createScenario( config ) ; scenario.getPopulation().getFactory().getRouteFactories().setRouteFactory( DrtRoute.class, new DrtRouteFactory() ); diff --git a/src/main/java/org/matsim/codeexamples/extensions/emissions/RunAverageEmissionToolOfflineExample.java b/src/main/java/org/matsim/codeexamples/extensions/emissions/RunAverageEmissionToolOfflineExample.java index a2aac1ce..2a1c1dfa 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/emissions/RunAverageEmissionToolOfflineExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/emissions/RunAverageEmissionToolOfflineExample.java @@ -67,7 +67,7 @@ public static void main (String[] args){ } else { config = ConfigUtils.loadConfig( args ); } - config.plansCalcRoute().clearTeleportedModeParams(); + config.routing().clearTeleportedModeParams(); EmissionsConfigGroup emissionsConfig = ConfigUtils.addOrGetModule( config, EmissionsConfigGroup.class ); { @@ -129,7 +129,7 @@ public void install(){ // --- // add events writer into emissions event handler - final EventWriterXML eventWriterXML = new EventWriterXML( config.controler().getOutputDirectory() + '/' + emissionEventOutputFileName ); + final EventWriterXML eventWriterXML = new EventWriterXML( config.controller().getOutputDirectory() + '/' + emissionEventOutputFileName ); eventsManager.addHandler( eventWriterXML ); // read events file into the events reader. EmissionsModule and events writer have been added as handlers, and will act accordingly. @@ -139,10 +139,10 @@ public void install(){ eventWriterXML.closeFile(); // also write vehicles and network and config as a service so we have all out files in one directory: - new MatsimVehicleWriter( scenario.getVehicles() ).writeFile( config.controler().getOutputDirectory() + "/output_vehicles.xml.gz" ); - NetworkUtils.writeNetwork( scenario.getNetwork(), config.controler().getOutputDirectory() + "/output_network.xml.gz" ); - ConfigUtils.writeConfig( config, config.controler().getOutputDirectory() + "/output_config.xml" ); - ConfigUtils.writeMinimalConfig( config, config.controler().getOutputDirectory() + "/output_config_reduced.xml" ); + new MatsimVehicleWriter( scenario.getVehicles() ).writeFile( config.controller().getOutputDirectory() + "/output_vehicles.xml.gz" ); + NetworkUtils.writeNetwork( scenario.getNetwork(), config.controller().getOutputDirectory() + "/output_network.xml.gz" ); + ConfigUtils.writeConfig( config, config.controller().getOutputDirectory() + "/output_config.xml" ); + ConfigUtils.writeMinimalConfig( config, config.controller().getOutputDirectory() + "/output_config_reduced.xml" ); } diff --git a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightExample.java b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightExample.java index 4c08fd4a..d1836e23 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightExample.java @@ -19,10 +19,10 @@ package org.matsim.codeexamples.extensions.freight; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.CarrierPlanWriter; -import org.matsim.contrib.freight.controler.CarrierModule; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightCarriersConfigGroup; +import org.matsim.freight.carriers.CarrierPlanWriter; +import org.matsim.freight.carriers.controler.CarrierModule; +import org.matsim.freight.carriers.CarriersUtils; import org.matsim.contrib.otfvis.OTFVisLiveModule; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; @@ -35,7 +35,7 @@ /** - * @see org.matsim.contrib.freight + * @see org.matsim.freight.carriers */ public class RunFreightExample { @@ -49,34 +49,34 @@ public static void run( String[] args, boolean runWithOTFVis ) throws ExecutionE if ( args==null || args.length==0 || args[0]==null ){ config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "freight-chessboard-9x9" ), "config.xml" ) ); config.plans().setInputFile( null ); // remove passenger input - config.controler().setOutputDirectory( "./output/freight" ); - config.controler().setLastIteration( 0 ); // no iterations; for iterations see RunFreightWithIterationsExample. kai, jan'23 + config.controller().setOutputDirectory( "./output/freight" ); + config.controller().setLastIteration( 0 ); // no iterations; for iterations see RunFreightWithIterationsExample. kai, jan'23 - FreightConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightConfigGroup.class ); + FreightCarriersConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightCarriersConfigGroup.class ); freightConfigGroup.setCarriersFile( "singleCarrierFiveActivitiesWithoutRoutes.xml" ); freightConfigGroup.setCarriersVehicleTypesFile( "vehicleTypes.xml" ); } else { - config = ConfigUtils.loadConfig( args, new FreightConfigGroup() ); + config = ConfigUtils.loadConfig( args, new FreightCarriersConfigGroup() ); } // load scenario (this is not loading the freight material): Scenario scenario = ScenarioUtils.loadScenario( config ); //load carriers according to freight config - FreightUtils.loadCarriersAccordingToFreightConfig( scenario ); + CarriersUtils.loadCarriersAccordingToFreightConfig( scenario ); // how to set the capacity of the "light" vehicle type to "1": -// FreightUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); +// CarriersUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); // output before jsprit run (not necessary) - new CarrierPlanWriter(FreightUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; + new CarrierPlanWriter(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) // Solving the VRP (generate carrier's tour plans) - FreightUtils.runJsprit( scenario ); + CarriersUtils.runJsprit( scenario ); // Output after jsprit run (not necessary) - new CarrierPlanWriter(FreightUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; + new CarrierPlanWriter(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) // ## MATSim configuration: ## diff --git a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithEmissionExample.java b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithEmissionExample.java index 27cdcd3b..4aa6717d 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithEmissionExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithEmissionExample.java @@ -24,10 +24,10 @@ import org.matsim.contrib.emissions.EmissionModule; import org.matsim.contrib.emissions.HbefaVehicleCategory; import org.matsim.contrib.emissions.utils.EmissionsConfigGroup; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlWriterV2; -import org.matsim.contrib.freight.controler.CarrierModule; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightCarriersConfigGroup; +import org.matsim.freight.carriers.CarrierPlanXmlWriterV2; +import org.matsim.freight.carriers.controler.CarrierModule; +import org.matsim.freight.carriers.CarriersUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; @@ -43,7 +43,7 @@ /** - * @see org.matsim.contrib.freight + * @see org.matsim.freight.carriers */ public class RunFreightWithEmissionExample { @@ -56,13 +56,13 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc config.plans().setInputFile( null ); // remove passenger input //more general settings - config.controler().setOutputDirectory("./output/freightWEmissions" ); - config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOutputDirectory("./output/freightWEmissions" ); + config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(0 ); // yyyyyy iterations currently do not work; needs to be fixed. + config.controller().setLastIteration(0 ); // yyyyyy iterations currently do not work; needs to be fixed. //freight settings - FreightConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightConfigGroup.class ) ; + FreightCarriersConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightCarriersConfigGroup.class ) ; freightConfigGroup.setCarriersFile( "singleCarrierWithoutRoutes.xml"); freightConfigGroup.setCarriersVehicleTypesFile( "vehicleTypes.xml"); @@ -82,10 +82,10 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc Scenario scenario = ScenarioUtils.loadScenario( config ); //load carriers according to freight config - FreightUtils.loadCarriersAccordingToFreightConfig( scenario ); + CarriersUtils.loadCarriersAccordingToFreightConfig( scenario ); // how to set the capacity of the "light" vehicle type to "1": -// FreightUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); +// CarriersUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); //prepare network for emission calculation for (Link link : scenario.getNetwork().getLinks().values()) { @@ -99,14 +99,14 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc //prepare vehicles for emission calculation { - VehicleType lightVehType = FreightUtils.getCarrierVehicleTypes(scenario).getVehicleTypes().get(Id.create("light", VehicleType.class)); + VehicleType lightVehType = CarriersUtils.getCarrierVehicleTypes(scenario).getVehicleTypes().get(Id.create("light", VehicleType.class)); VehicleUtils.setHbefaVehicleCategory(lightVehType.getEngineInformation(), HbefaVehicleCategory.HEAVY_GOODS_VEHICLE.toString()); VehicleUtils.setHbefaTechnology(lightVehType.getEngineInformation(), "diesel"); VehicleUtils.setHbefaSizeClass(lightVehType.getEngineInformation(), "RT ≤7,5t"); VehicleUtils.setHbefaEmissionsConcept(lightVehType.getEngineInformation(), "HGV D Euro-VI"); } { - VehicleType heavyVehType = FreightUtils.getCarrierVehicleTypes(scenario).getVehicleTypes().get(Id.create("heavy", VehicleType.class)); + VehicleType heavyVehType = CarriersUtils.getCarrierVehicleTypes(scenario).getVehicleTypes().get(Id.create("heavy", VehicleType.class)); VehicleUtils.setHbefaVehicleCategory(heavyVehType.getEngineInformation(), HbefaVehicleCategory.HEAVY_GOODS_VEHICLE.toString()); VehicleUtils.setHbefaTechnology(heavyVehType.getEngineInformation(), "diesel"); VehicleUtils.setHbefaSizeClass(heavyVehType.getEngineInformation(), "RT >32t"); @@ -114,14 +114,14 @@ public static void main(String[] args) throws ExecutionException, InterruptedExc } // output before jsprit run (not necessary) - new CarrierPlanXmlWriterV2(FreightUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; + new CarrierPlanXmlWriterV2(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) //Solving the VRP (generate carrier's tour plans) - FreightUtils.runJsprit( scenario ); + CarriersUtils.runJsprit( scenario ); // output after jsprit run (not necessary) - new CarrierPlanXmlWriterV2(FreightUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; + new CarrierPlanXmlWriterV2(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) //MATSim configuration: diff --git a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExample.java b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExample.java index 6693a621..2cda248a 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExample.java @@ -22,15 +22,13 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Network; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.*; -import org.matsim.contrib.freight.controler.*; -import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl; -import org.matsim.contrib.freight.usecases.chessboard.CarrierTravelDisutilities; -import org.matsim.contrib.freight.controler.FreightUtils; +import org.matsim.freight.carriers.FreightCarriersConfigGroup; +import org.matsim.freight.carriers.*; +import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.usecases.chessboard.CarrierScoringFunctionFactoryImpl; +import org.matsim.freight.carriers.usecases.chessboard.CarrierTravelDisutilities; import org.matsim.contrib.otfvis.OTFVisLiveModule; import org.matsim.core.config.Config; -import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; @@ -54,7 +52,7 @@ /** - * @see org.matsim.contrib.freight + * @see org.matsim.freight.carriers */ public class RunFreightWithIterationsExample{ @@ -69,34 +67,34 @@ public static void run( String[] args, boolean runWithOTFVis ) throws ExecutionE if ( args==null || args.length==0 || args[0]==null ){ config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "freight-chessboard-9x9" ), "config.xml" ) ); config.plans().setInputFile( null ); // remove passenger input - config.controler().setOutputDirectory( "./output/freight" ); - config.controler().setLastIteration( 1 ); + config.controller().setOutputDirectory( "./output/freight" ); + config.controller().setLastIteration( 1 ); - FreightConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightConfigGroup.class ); + FreightCarriersConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule( config, FreightCarriersConfigGroup.class ); freightConfigGroup.setCarriersFile( "singleCarrierFiveActivitiesWithoutRoutes.xml" ); freightConfigGroup.setCarriersVehicleTypesFile( "vehicleTypes.xml" ); } else { - config = ConfigUtils.loadConfig( args, new FreightConfigGroup() ); + config = ConfigUtils.loadConfig( args, new FreightCarriersConfigGroup() ); } // load scenario (this is not loading the freight material): Scenario scenario = ScenarioUtils.loadScenario( config ); //load carriers according to freight config - FreightUtils.loadCarriersAccordingToFreightConfig( scenario ); + CarriersUtils.loadCarriersAccordingToFreightConfig( scenario ); // how to set the capacity of the "light" vehicle type to "1": -// FreightUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); +// CarriersUtils.getCarrierVehicleTypes( scenario ).getVehicleTypes().get( Id.create("light", VehicleType.class ) ).getCapacity().setOther( 1 ); // output before jsprit run (not necessary) - new CarrierPlanWriter(FreightUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; + new CarrierPlanWriter(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_unplannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) // Solving the VRP (generate carrier's tour plans) - FreightUtils.runJsprit( scenario ); + CarriersUtils.runJsprit( scenario ); // Output after jsprit run (not necessary) - new CarrierPlanWriter(FreightUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; + new CarrierPlanWriter(CarriersUtils.getCarriers( scenario )).write( "output/jsprit_plannedCarriers.xml" ) ; // (this will go into the standard "output" directory. note that this may be removed if this is also used as the configured output dir.) // ## MATSim configuration: ## @@ -139,14 +137,14 @@ private static class MyCarrierPlanStrategyManagerProvider implements Provider strategy = new GenericPlanStrategyImpl<>( new ExpBetaPlanChanger.Factory().build() ); strategyManager.addStrategy(strategy, null, 1.0); } { - final TravelDisutility travelDisutility = CarrierTravelDisutilities.createBaseDisutility( FreightUtils.getCarrierVehicleTypes( scenario ), modeTravelTimes.get( TransportMode.car ) ); + final TravelDisutility travelDisutility = CarrierTravelDisutilities.createBaseDisutility( CarriersUtils.getCarrierVehicleTypes( scenario ), modeTravelTimes.get( TransportMode.car ) ); final LeastCostPathCalculator router = leastCostPathCalculatorFactory.createPathCalculator(network, travelDisutility, modeTravelTimes.get(TransportMode.car ) ); GenericPlanStrategyImpl strategy = new GenericPlanStrategyImpl<>( new KeepSelected<>()); diff --git a/src/main/java/org/matsim/codeexamples/extensions/locationChoice/RunLocationChoiceFrozenEpsilonsExample.java b/src/main/java/org/matsim/codeexamples/extensions/locationChoice/RunLocationChoiceFrozenEpsilonsExample.java index f5a51911..a0fe53e7 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/locationChoice/RunLocationChoiceFrozenEpsilonsExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/locationChoice/RunLocationChoiceFrozenEpsilonsExample.java @@ -27,7 +27,7 @@ import org.matsim.contrib.locationchoice.frozenepsilons.FrozenTastesConfigGroup; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.StrategyConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup; import org.matsim.core.controler.Controler; import org.matsim.core.scenario.ScenarioUtils; @@ -36,7 +36,7 @@ class RunLocationChoiceFrozenEpsilonsExample{ public static void main(String[] args) { Config config = ConfigUtils.loadConfig( args ); - config.strategy().addStrategySettings( new StrategyConfigGroup.StrategySettings().setStrategyName( FrozenTastes.LOCATION_CHOICE_PLAN_STRATEGY ) + config.replanning().addStrategySettings( new ReplanningConfigGroup.StrategySettings().setStrategyName( FrozenTastes.LOCATION_CHOICE_PLAN_STRATEGY ) .setWeight( 0.1 ) ); final FrozenTastesConfigGroup dccg = ConfigUtils.addOrGetModule(config, FrozenTastesConfigGroup.class ) ; diff --git a/src/main/java/org/matsim/codeexamples/extensions/matsimApplication/RunMatsimApplicationExample.java b/src/main/java/org/matsim/codeexamples/extensions/matsimApplication/RunMatsimApplicationExample.java index 7fca7924..27a02c9c 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/matsimApplication/RunMatsimApplicationExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/matsimApplication/RunMatsimApplicationExample.java @@ -65,7 +65,7 @@ public RunMatsimApplicationExample( ) { @Override protected Config prepareConfig( Config config) { - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); return config; } diff --git a/src/main/java/org/matsim/codeexamples/extensions/minibus/RunMinibusExample.java b/src/main/java/org/matsim/codeexamples/extensions/minibus/RunMinibusExample.java index e73233c1..d1118f5f 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/minibus/RunMinibusExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/minibus/RunMinibusExample.java @@ -54,7 +54,7 @@ public static void main(final String[] args) { Controler controler = new Controler(scenario); - controler.getConfig().controler().setCreateGraphs(false); + controler.getConfig().controller().setCreateGraphs(false); controler.addOverridingModule(new PModule()) ; diff --git a/src/main/java/org/matsim/codeexamples/extensions/otfvis/RunTransitWithOtfvisExample.java b/src/main/java/org/matsim/codeexamples/extensions/otfvis/RunTransitWithOtfvisExample.java index 2dd472b0..ae5b1b81 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/otfvis/RunTransitWithOtfvisExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/otfvis/RunTransitWithOtfvisExample.java @@ -51,7 +51,7 @@ public static void main(final String[] args) { } } - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ) ; + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ) ; config.qsim().setSnapshotStyle( SnapshotStyle.queue ) ; config.qsim().setVehicleBehavior( QSimConfigGroup.VehicleBehavior.teleport ) ; diff --git a/src/main/java/org/matsim/codeexamples/extensions/roadpricing/RunRoadpricingExample.java b/src/main/java/org/matsim/codeexamples/extensions/roadpricing/RunRoadpricingExample.java index f8554040..f95c19d4 100644 --- a/src/main/java/org/matsim/codeexamples/extensions/roadpricing/RunRoadpricingExample.java +++ b/src/main/java/org/matsim/codeexamples/extensions/roadpricing/RunRoadpricingExample.java @@ -37,9 +37,9 @@ public static void main( String [] args ) { Config config ; if ( args==null || args.length==0 || args[0]==null ) { config = ConfigUtils.loadConfig( "scenarios/equil-extended/config-with-roadpricing.xml" ); - config.controler().setOutputDirectory( "output" ); - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 1 ); + config.controller().setOutputDirectory( "output" ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 1 ); } else { config = ConfigUtils.loadConfig( args ); } diff --git a/src/main/java/org/matsim/codeexamples/facilities/facilitiesAndOpenTimes/RunWithFacilitiesExample.java b/src/main/java/org/matsim/codeexamples/facilities/facilitiesAndOpenTimes/RunWithFacilitiesExample.java index 54d2a94b..af502a08 100644 --- a/src/main/java/org/matsim/codeexamples/facilities/facilitiesAndOpenTimes/RunWithFacilitiesExample.java +++ b/src/main/java/org/matsim/codeexamples/facilities/facilitiesAndOpenTimes/RunWithFacilitiesExample.java @@ -32,8 +32,8 @@ import org.matsim.api.core.v01.population.PopulationFactory; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.TypicalDurationScoreComputation; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup.TypicalDurationScoreComputation; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -60,21 +60,21 @@ public final class RunWithFacilitiesExample { void run() { final Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(0); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration(0); { ActivityParams params = new ActivityParams("home") ; params.setTypicalDuration(12.*3600); params.setTypicalDurationScoreComputation( TypicalDurationScoreComputation.relative ); // note no opening/closing times for the activity type (given by facility) - config.planCalcScore().addActivityParams(params); + config.scoring().addActivityParams(params); } { ActivityParams params = new ActivityParams("shop") ; params.setTypicalDuration(1.*3600); params.setTypicalDurationScoreComputation( TypicalDurationScoreComputation.relative ); // note no opening/closing times for the activity type (given by facility) - config.planCalcScore().addActivityParams(params); + config.scoring().addActivityParams(params); } scenario = ScenarioUtils.createScenario( config ) ; diff --git a/src/main/java/org/matsim/codeexamples/integration/RunBicycleExpresswayExample.java b/src/main/java/org/matsim/codeexamples/integration/RunBicycleExpresswayExample.java index b3d8fe79..de7a6061 100644 --- a/src/main/java/org/matsim/codeexamples/integration/RunBicycleExpresswayExample.java +++ b/src/main/java/org/matsim/codeexamples/integration/RunBicycleExpresswayExample.java @@ -15,8 +15,8 @@ import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup.AccessEgressType; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.RoutingConfigGroup.AccessEgressType; import org.matsim.core.config.groups.QSimConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; @@ -61,23 +61,23 @@ public static void main ( String [] args ) { config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ) ) ; } - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); // set traffic dynamics and visualization to kinematic waves (should be matsim default, but currently (jan'23) is not): config.qsim().setTrafficDynamics( QSimConfigGroup.TrafficDynamics.kinematicWaves ); config.qsim().setSnapshotStyle( QSimConfigGroup.SnapshotStyle.kinematicWaves ); // run only the zeroth iteration so that we do not have to worry about replanning strategies: - config.controler().setLastIteration( 0 ); + config.controller().setLastIteration( 0 ); // add bike routing as network routing: - config.plansCalcRoute().setNetworkModes( Arrays.asList( TransportMode.car, BICYCLE ) ); + config.routing().setNetworkModes( Arrays.asList( TransportMode.car, BICYCLE ) ); - config.plansCalcRoute().setAccessEgressType( AccessEgressType.accessEgressModeToLink ); + config.routing().setAccessEgressType( AccessEgressType.accessEgressModeToLink ); // (NetworkRoutingModule w/o access/egress does not pass the vehicle to the router --> cannot take vehicle max speed into account. See comment in code in NetworkRoutingModule#calcRoute(...). kai, jan'23) // add (arbitrary) mode params for bike so that the scoring works: - config.planCalcScore().addModeParams( new PlanCalcScoreConfigGroup.ModeParams( BICYCLE ) ); + config.scoring().addModeParams( new ScoringConfigGroup.ModeParams( BICYCLE ) ); // add bike as network mode to qsim: config.qsim().setMainModes( Arrays.asList( TransportMode.car, BICYCLE ) ); diff --git a/src/main/java/org/matsim/codeexamples/integration/RunMultipleModesExample.java b/src/main/java/org/matsim/codeexamples/integration/RunMultipleModesExample.java index 5bd908e9..363cbf7c 100644 --- a/src/main/java/org/matsim/codeexamples/integration/RunMultipleModesExample.java +++ b/src/main/java/org/matsim/codeexamples/integration/RunMultipleModesExample.java @@ -8,7 +8,7 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule; @@ -24,7 +24,7 @@ import java.util.LinkedHashSet; import java.util.Set; -import static org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ModeParams; +import static org.matsim.core.config.groups.ScoringConfigGroup.ModeParams; final class RunMultipleModesExample{ @@ -72,7 +72,7 @@ static Config prepareConfig(){ StrategySettings stratSets = new StrategySettings( ) ; stratSets.setStrategyName( DefaultPlanStrategiesModule.DefaultStrategy.SubtourModeChoice ); stratSets.setWeight( 1. ); - config.strategy().addStrategySettings( stratSets ); + config.replanning().addStrategySettings( stratSets ); // config.changeMode().setModes( new String [] { TransportMode.car, TransportMode.bike} ); config.subtourModeChoice().setModes( new String [] { TransportMode.car, TransportMode.bike} ); @@ -81,18 +81,18 @@ static Config prepareConfig(){ { // configure the bike mode: // add it to the list of network routing modes: - config.plansCalcRoute().setNetworkModes( Arrays.asList( TransportMode.car, TransportMode.bike ) ); + config.routing().setNetworkModes( Arrays.asList( TransportMode.car, TransportMode.bike ) ); // one also needs to remove the default teleportation bike router: - config.plansCalcRoute().removeTeleportedModeParams( TransportMode.bike ); + config.routing().removeTeleportedModeParams( TransportMode.bike ); - // say that the the travel times need to be analyzed also for the bike mode: + // say that the travel times need to be analyzed also for the bike mode: // config.travelTimeCalculator().setAnalyzedModes( new LinkedHashSet<>( Arrays.asList( TransportMode.bike, TransportMode.car ) ) ) ; // no longer needed; by default all network modes are analyzed // set up bike scoring: ModeParams params = new ModeParams( TransportMode.bike ) ; - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); // set up the bike qsim config.qsim().setMainModes( new HashSet<>( Arrays.asList( TransportMode.car, TransportMode.bike ) ) ) ; @@ -101,7 +101,7 @@ static Config prepareConfig(){ // config.travelTimeCalculator().setSeparateModes( true ); // otherwise, router will use speeds averaged over modes. For 11.x, this is the default. // config.travelTimeCalculator().setSeparateModes( false ); // this used to be the default -// config.plansCalcRoute().setInsertingAccessEgressWalk( true ); +// config.routing().setInsertingAccessEgressWalk( true ); return config ; } diff --git a/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInConfigExample.java b/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInConfigExample.java index b8aac9d9..8c6b698e 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInConfigExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInConfigExample.java @@ -22,8 +22,8 @@ class RunQSimComponentRequestInConfigExample{ public static void main( String[] args ){ Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); QSimComponentsConfigGroup qsimComponentsConfig = ConfigUtils.addOrGetModule( config, QSimComponentsConfigGroup.class ); diff --git a/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInControlerExample.java b/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInControlerExample.java index 5691dee4..6f60a45a 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInControlerExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/addRemoveReplaceQSimCompoments/RunQSimComponentRequestInControlerExample.java @@ -32,8 +32,8 @@ class RunQSimComponentRequestInControlerExample{ public static void main( String[] args ){ Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); config.qsim().setNumberOfThreads( 1 ); Scenario scenario = ScenarioUtils.loadScenario( config ) ; diff --git a/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/RunMobsimListenerExample.java b/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/RunMobsimListenerExample.java index e4273a37..bb92b71a 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/RunMobsimListenerExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/RunMobsimListenerExample.java @@ -21,9 +21,9 @@ public class RunMobsimListenerExample { public static void main(String[] args) { Config config = ConfigUtils.loadConfig("scenarios/equil/config.xml"); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(1); - config.controler().setOutputDirectory(outputDirectory); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(1); + config.controller().setOutputDirectory(outputDirectory); Controler controler = new Controler(config); controler.addOverridingModule(new AbstractModule() { @Override diff --git a/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/TestMobsimListenerScope.java b/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/TestMobsimListenerScope.java index 6db2ade8..919e3408 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/TestMobsimListenerScope.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/mobsimListener/TestMobsimListenerScope.java @@ -27,8 +27,8 @@ private static class MyMobsimListener implements MobsimInitializedListener { public static void main( String[] args ){ Config config = ConfigUtils.createConfig(); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); Scenario scenario = ScenarioUtils.createScenario( config ); diff --git a/src/main/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExample.java b/src/main/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExample.java index 2cb29a9c..a38eb941 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExample.java @@ -12,10 +12,10 @@ import java.util.HashSet; -import static org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ModeParams; +import static org.matsim.core.config.groups.ScoringConfigGroup.ModeParams; import static org.matsim.core.config.groups.QSimConfigGroup.LinkDynamics; import static org.matsim.core.config.groups.QSimConfigGroup.VehiclesSource; -import static org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import static org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import static org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import static org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule.DefaultStrategy; @@ -36,8 +36,8 @@ public static void main( String[] args ) { config = ConfigUtils.loadConfig( args ) ; } else { config = ConfigUtils.loadConfig( "scenarios/equil/config.xml" ) ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); } config.qsim().setLinkDynamics( LinkDynamics.PassingQ ); @@ -52,7 +52,7 @@ public static void main( String[] args ) { networkModesAsSet.add(mode) ; // scoring: ModeParams params = new ModeParams( mode ) ; - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); } { String mode = "bicycle" ; @@ -60,37 +60,37 @@ public static void main( String[] args ) { networkModesAsSet.add(mode) ; // scoring: ModeParams params = new ModeParams( mode ) ; - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); } { String mode = "bike" ; // routing, qsim: - config.plansCalcRoute().removeTeleportedModeParams( mode ); + config.routing().removeTeleportedModeParams( mode ); networkModesAsSet.add(mode) ; // scoring: ModeParams params = new ModeParams( mode ) ; - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); } { String mode = "walk" ; // routing, qsim: - config.plansCalcRoute().removeTeleportedModeParams( mode ); + config.routing().removeTeleportedModeParams( mode ); networkModesAsSet.add(mode) ; // scoring: ModeParams params = new ModeParams( mode ) ; - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); } { StrategySettings stratSets = new StrategySettings( ) ; stratSets.setWeight( 1.0 ); stratSets.setStrategyName( DefaultStrategy.ChangeSingleTripMode ); - config.strategy().addStrategySettings( stratSets ); + config.replanning().addStrategySettings( stratSets ); config.changeMode().setModes( networkModesAsSet.toArray( new String[0] ) ); } - config.plansCalcRoute().setNetworkModes( networkModesAsSet ) ; + config.routing().setNetworkModes( networkModesAsSet ) ; config.qsim().setMainModes( networkModesAsSet ); diff --git a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgent/RunAddAgentSourceExample.java b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgent/RunAddAgentSourceExample.java index da06915d..f3fe04be 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgent/RunAddAgentSourceExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgent/RunAddAgentSourceExample.java @@ -46,8 +46,8 @@ public class RunAddAgentSourceExample{ public static void main(String[] args){ Config config = ConfigUtils.loadConfig( "scenarios/equil/example5-config.xml" ); config.qsim().setEndTime( 25 * 60 * 60 ); - config.controler().setLastIteration( 0 ); - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 0 ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); Scenario scenario = ScenarioUtils.loadScenario( config ); diff --git a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentUsingRouter/RunOwnMobsimAgentUsingRouterExample.java b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentUsingRouter/RunOwnMobsimAgentUsingRouterExample.java index 7a4d55dc..36187c22 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentUsingRouter/RunOwnMobsimAgentUsingRouterExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentUsingRouter/RunOwnMobsimAgentUsingRouterExample.java @@ -61,7 +61,7 @@ public void install() { @Override public Mobsim get() { scenario.getConfig().qsim().setEndTime(25 * 60 * 60); - scenario.getConfig().controler().setLastIteration(0); + scenario.getConfig().controller().setLastIteration(0); scenario.getPopulation().getPersons().clear(); final QSim qsim = new QSimBuilder(getConfig()).useDefaults().build(scenario, eventsManager); qsim.addAgentSource(new AgentSource() { diff --git a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentWithPerception/RunOwnMobsimAgentWithPerceptionExample.java b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentWithPerception/RunOwnMobsimAgentWithPerceptionExample.java index e9a8107b..0d8c2da4 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentWithPerception/RunOwnMobsimAgentWithPerceptionExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/ownMobsimAgentWithPerception/RunOwnMobsimAgentWithPerceptionExample.java @@ -66,8 +66,8 @@ public static void main(String[] args) { } else { URL url = IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("equil"), "config.xml");; config = ConfigUtils.loadConfig(url) ; - config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(0); + config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(0); } Scenario scenario = ScenarioUtils.loadScenario(config) ; diff --git a/src/main/java/org/matsim/codeexamples/mobsim/pluggableTripRouter/RunPluggableTripRouterExample.java b/src/main/java/org/matsim/codeexamples/mobsim/pluggableTripRouter/RunPluggableTripRouterExample.java index 9b9b774d..7f978cbb 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/pluggableTripRouter/RunPluggableTripRouterExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/pluggableTripRouter/RunPluggableTripRouterExample.java @@ -35,7 +35,7 @@ public static void main(final String[] args) { } else { config = ConfigUtils.loadConfig(args[0]); } - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); final Controler controler = new Controler(config); final MySimulationObserver observer = new MySimulationObserver(); diff --git a/src/main/java/org/matsim/codeexamples/mobsim/simpleAdaptiveSignalEngine/RunSimpleAdaptiveSignalExample.java b/src/main/java/org/matsim/codeexamples/mobsim/simpleAdaptiveSignalEngine/RunSimpleAdaptiveSignalExample.java index 045f8e99..8327bcd3 100644 --- a/src/main/java/org/matsim/codeexamples/mobsim/simpleAdaptiveSignalEngine/RunSimpleAdaptiveSignalExample.java +++ b/src/main/java/org/matsim/codeexamples/mobsim/simpleAdaptiveSignalEngine/RunSimpleAdaptiveSignalExample.java @@ -51,15 +51,15 @@ public static void main(String[] args) { } // load the daganzo example final Config config = ConfigUtils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("daganzo"), "config.xml")); - config.controler().setOutputDirectory(outputDir); - config.controler().setWriteEventsInterval(config.controler().getLastIteration()); + config.controller().setOutputDirectory(outputDir); + config.controller().setWriteEventsInterval(config.controller().getLastIteration()); config.qsim().setUsingFastCapacityUpdate(false); config.vspExperimental().setWritingOutputEvents(true); // remove unmaterialized module from the config config.removeModule("otfvis"); final Controler controler = new Controler(config); - controler.getConfig().controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ) ; + controler.getConfig().controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ) ; controler.addOverridingModule(new AbstractModule() { @Override public void install() { diff --git a/src/main/java/org/matsim/codeexamples/network/timeDependentNetwork/RunTimeDependentNetworkExample.java b/src/main/java/org/matsim/codeexamples/network/timeDependentNetwork/RunTimeDependentNetworkExample.java index 5e8a760e..a3e01832 100644 --- a/src/main/java/org/matsim/codeexamples/network/timeDependentNetwork/RunTimeDependentNetworkExample.java +++ b/src/main/java/org/matsim/codeexamples/network/timeDependentNetwork/RunTimeDependentNetworkExample.java @@ -52,7 +52,7 @@ public static void main(String[] args) { // configure the time variant network here: config.network().setTimeVariantNetwork(true); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); // --- diff --git a/src/main/java/org/matsim/codeexamples/population/demandGeneration/RunPCreateDrivingAgents.java b/src/main/java/org/matsim/codeexamples/population/demandGeneration/RunPCreateDrivingAgents.java index 068637a2..e4f3e53d 100644 --- a/src/main/java/org/matsim/codeexamples/population/demandGeneration/RunPCreateDrivingAgents.java +++ b/src/main/java/org/matsim/codeexamples/population/demandGeneration/RunPCreateDrivingAgents.java @@ -10,7 +10,7 @@ import org.matsim.api.core.v01.population.Population; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.network.io.MatsimNetworkReader; @@ -21,14 +21,14 @@ public class RunPCreateDrivingAgents { public static void main(String[] args) { Config config = ConfigUtils.createConfig(); - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); ActivityParams home = new ActivityParams("home"); home.setTypicalDuration(16 * 60 * 60); - config.planCalcScore().addActivityParams(home); + config.scoring().addActivityParams(home); ActivityParams work = new ActivityParams("work"); work.setTypicalDuration(8 * 60 * 60); - config.planCalcScore().addActivityParams(work); + config.scoring().addActivityParams(work); Scenario scenario = ScenarioUtils.createScenario(config); @@ -37,7 +37,7 @@ public static void main(String[] args) { fillScenario(scenario); Controler controler = new Controler(scenario); - controler.getConfig().controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles); + controler.getConfig().controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.overwriteExistingFiles); controler.run(); diff --git a/src/main/java/org/matsim/codeexamples/population/reducePopulationToAreaOfInterest/RunReducePopulationToAreaOfInterestExample.java b/src/main/java/org/matsim/codeexamples/population/reducePopulationToAreaOfInterest/RunReducePopulationToAreaOfInterestExample.java index 6711249a..2d6e9e2f 100644 --- a/src/main/java/org/matsim/codeexamples/population/reducePopulationToAreaOfInterest/RunReducePopulationToAreaOfInterestExample.java +++ b/src/main/java/org/matsim/codeexamples/population/reducePopulationToAreaOfInterest/RunReducePopulationToAreaOfInterestExample.java @@ -37,7 +37,7 @@ class RunReducePopulationToAreaOfInterestExample{ public static void main( String[] args ){ Config config = ConfigUtils.loadConfig( "scenarios/equil/config.xml" ) ; - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); Scenario scenario = ScenarioUtils.loadScenario( config ) ; diff --git a/src/main/java/org/matsim/codeexamples/programming/controlerListener/RunControlerListenerExample.java b/src/main/java/org/matsim/codeexamples/programming/controlerListener/RunControlerListenerExample.java index 155a5103..9cffd37f 100644 --- a/src/main/java/org/matsim/codeexamples/programming/controlerListener/RunControlerListenerExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/controlerListener/RunControlerListenerExample.java @@ -23,7 +23,7 @@ public static void main(String[] args) { OutputDirectoryLogging.catchLogEntries(); Config config = ConfigUtils.loadConfig(filename) ; - config.controler().setLastIteration(1); + config.controller().setLastIteration(1); Scenario scenario = ScenarioUtils.loadScenario(config) ; diff --git a/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionBeforeControlerExample.java b/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionBeforeControlerExample.java index 48f0317c..e16449cb 100644 --- a/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionBeforeControlerExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionBeforeControlerExample.java @@ -27,7 +27,7 @@ public class RunInjectionBeforeControlerExample { public static void main(String[] args) { Config config = ConfigUtils.createConfig() ; - config.controler().setLastIteration(1); + config.controller().setLastIteration(1); final Scenario scenario = ScenarioUtils.createScenario(config); com.google.inject.Injector injector = createMinimalMatsimInjector( config, scenario ); diff --git a/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionWithoutControlerExample.java b/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionWithoutControlerExample.java index 22acaef0..b31fb6df 100644 --- a/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionWithoutControlerExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/injectionBeforeControler/RunInjectionWithoutControlerExample.java @@ -32,7 +32,7 @@ public static void main(String[] args) { // create a config: Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( deleteDirectoryIfExists ); // create a scenario: final Scenario scenario = ScenarioUtils.createScenario(config); diff --git a/src/main/java/org/matsim/codeexamples/programming/leastCostPath/RunLeastCostPathCalculatorExample.java b/src/main/java/org/matsim/codeexamples/programming/leastCostPath/RunLeastCostPathCalculatorExample.java index e85a825c..80696f36 100644 --- a/src/main/java/org/matsim/codeexamples/programming/leastCostPath/RunLeastCostPathCalculatorExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/leastCostPath/RunLeastCostPathCalculatorExample.java @@ -39,9 +39,9 @@ public class RunLeastCostPathCalculatorExample { public static void main(String[] args) { Config config = ConfigUtils.loadConfig(IOUtils.extendUrl(ExamplesUtils.getTestScenarioURL("equil"), "config.xml")); - config.controler().setOutputDirectory(outputDirectory); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); - config.controler().setLastIteration(1); + config.controller().setOutputDirectory(outputDirectory); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); + config.controller().setLastIteration(1); Scenario scenario = ScenarioUtils.loadScenario(config); Controler controler = new Controler(scenario); controler.addOverridingModule(new AbstractModule() { diff --git a/src/main/java/org/matsim/codeexamples/programming/multipleJvmMatsimRuns/MultipleJvmBlackBox.java b/src/main/java/org/matsim/codeexamples/programming/multipleJvmMatsimRuns/MultipleJvmBlackBox.java index 02953f8a..7263584d 100644 --- a/src/main/java/org/matsim/codeexamples/programming/multipleJvmMatsimRuns/MultipleJvmBlackBox.java +++ b/src/main/java/org/matsim/codeexamples/programming/multipleJvmMatsimRuns/MultipleJvmBlackBox.java @@ -54,10 +54,10 @@ public static void run(String[] args) { final URL url = ExamplesUtils.getTestScenarioURL( "equil" ); final URL configUrl = IOUtils.extendUrl( url, "config.xml" );; Config config = ConfigUtils.loadConfig( configUrl ) ; - config.controler().setOutputDirectory( "./output/" ); + config.controller().setOutputDirectory( "./output/" ); - config.controler().setLastIteration( 2 ); - config.controler().setOverwriteFileSetting( deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( deleteDirectoryIfExists ); Scenario scenario = ScenarioUtils.loadScenario( config ) ; diff --git a/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunDifferentStrategiesWithDifferentSubpopsExample.java b/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunDifferentStrategiesWithDifferentSubpopsExample.java index aa2b86dc..2fb12eab 100644 --- a/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunDifferentStrategiesWithDifferentSubpopsExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunDifferentStrategiesWithDifferentSubpopsExample.java @@ -6,7 +6,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.GlobalConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.config.groups.SubtourModeChoiceConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; @@ -30,7 +30,7 @@ public final class RunDifferentStrategiesWithDifferentSubpopsExample{ public static void main( String[] args ){ Config config = ConfigUtils.createConfig() ; - config.controler().setLastIteration(2); + config.controller().setLastIteration(2); // use the default subtour mode choice for subpop1: { @@ -38,7 +38,7 @@ public static void main( String[] args ){ settings.setStrategyName( DefaultPlanStrategiesModule.DefaultStrategy.SubtourModeChoice ) ; settings.setSubpopulation( "subpop1" ); settings.setWeight( 0.2 ); - config.strategy().addStrategySettings( settings ); + config.replanning().addStrategySettings( settings ); config.subtourModeChoice().setModes( new String[]{ TransportMode.car, TransportMode.pt, TransportMode.bike} ); } @@ -49,7 +49,7 @@ public static void main( String[] args ){ settings.setStrategyName( "subtourModeChoice2" ); settings.setSubpopulation( "subpop2" ); settings.setWeight( 0.2 ); - config.strategy().addStrategySettings( settings ); + config.replanning().addStrategySettings( settings ); } Scenario scenario = ScenarioUtils.loadScenario( config ) ; diff --git a/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunSubpopulationsExample.java b/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunSubpopulationsExample.java index 11f87a08..8ab940e3 100644 --- a/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunSubpopulationsExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/multipleSubpopulations/RunSubpopulationsExample.java @@ -27,8 +27,8 @@ import org.matsim.contrib.otfvis.OTFVisLiveModule; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.population.PopulationUtils; @@ -83,8 +83,8 @@ public static void main(String[] args) { config = ConfigUtils.loadConfig( args ); } else { config = ConfigUtils.loadConfig( "scenarios/equil-extended/config-with-subpopulation.xml" ); - config.controler().setOutputDirectory( "./output/example" ); - config.controler().setLastIteration( 1 ); + config.controller().setOutputDirectory( "./output/example" ); + config.controller().setLastIteration( 1 ); } // Config config = ConfigUtils.createConfig(); @@ -100,27 +100,27 @@ public static void main(String[] args) { { /* Set up the 'time' subpopulation to only consider time allocation * as a strategy, 20% of the time, and the balance using ChangeExpBeta. */ - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DefaultStrategy.TimeAllocationMutator ).setSubpopulation(SUBPOP1_NAME ).setWeight(0.2 ) ); - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setSubpopulation(SUBPOP1_NAME ).setWeight(0.8 ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DefaultStrategy.TimeAllocationMutator ).setSubpopulation(SUBPOP1_NAME ).setWeight(0.2 ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setSubpopulation(SUBPOP1_NAME ).setWeight(0.8 ) ); } { /* Set up the `reroute' subpopulation to consider rerouting as a * strategy, 20% of the time, and the balance using ChangeExpBeta. */ - config.strategy().addStrategySettings( new StrategySettings( ).setStrategyName( DefaultStrategy.ReRoute ).setSubpopulation(SUBPOP2_NAME ).setWeight(0.2 ) ); - config.strategy().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setSubpopulation(SUBPOP2_NAME ).setWeight(0.8 ) ); + config.replanning().addStrategySettings( new StrategySettings( ).setStrategyName( DefaultStrategy.ReRoute ).setSubpopulation(SUBPOP2_NAME ).setWeight(0.2 ) ); + config.replanning().addStrategySettings( new StrategySettings().setStrategyName( DefaultSelector.ChangeExpBeta ).setSubpopulation(SUBPOP2_NAME ).setWeight(0.8 ) ); } { - PlanCalcScoreConfigGroup.ScoringParameterSet scoringParams = config.planCalcScore().getOrCreateScoringParameters( SUBPOP1_NAME ); + ScoringConfigGroup.ScoringParameterSet scoringParams = config.scoring().getOrCreateScoringParameters( SUBPOP1_NAME ); scoringParams.setPerforming_utils_hr( 6. ); - scoringParams.addModeParams( new PlanCalcScoreConfigGroup.ModeParams( "car" ).setMarginalUtilityOfTraveling( 0. ) ); + scoringParams.addModeParams( new ScoringConfigGroup.ModeParams( "car" ).setMarginalUtilityOfTraveling( 0. ) ); } { - PlanCalcScoreConfigGroup.ScoringParameterSet scoringParams = config.planCalcScore().getOrCreateScoringParameters( SUBPOP2_NAME ); + ScoringConfigGroup.ScoringParameterSet scoringParams = config.scoring().getOrCreateScoringParameters( SUBPOP2_NAME ); scoringParams.setPerforming_utils_hr( 12. ); - scoringParams.addModeParams( new PlanCalcScoreConfigGroup.ModeParams( "car" ).setMarginalUtilityOfTraveling( -3. ) ); + scoringParams.addModeParams( new ScoringConfigGroup.ModeParams( "car" ).setMarginalUtilityOfTraveling( -3. ) ); } - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); /* Run the model. */ Controler controler = new Controler(config); diff --git a/src/main/java/org/matsim/codeexamples/programming/ownPrepareForSimExample/RunOwnPrepareForSimExample.java b/src/main/java/org/matsim/codeexamples/programming/ownPrepareForSimExample/RunOwnPrepareForSimExample.java index 47895130..751e8d5b 100644 --- a/src/main/java/org/matsim/codeexamples/programming/ownPrepareForSimExample/RunOwnPrepareForSimExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/ownPrepareForSimExample/RunOwnPrepareForSimExample.java @@ -37,7 +37,7 @@ import org.matsim.api.core.v01.population.PopulationFactory; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -58,14 +58,14 @@ public static void main(String[] args) { Config config = ConfigUtils.createConfig(); - config.controler().setOutputDirectory("output/ownPrepareForSimExample/"); - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOutputDirectory("output/ownPrepareForSimExample/"); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); ActivityParams dummyAct = new ActivityParams("dummy"); dummyAct.setTypicalDuration(12 * 3600); - config.planCalcScore().addActivityParams(dummyAct); + config.scoring().addActivityParams(dummyAct); Scenario scenario = ScenarioUtils.createScenario(config); diff --git a/src/main/java/org/matsim/codeexamples/programming/parallelisation/RunParallelisationExample.java b/src/main/java/org/matsim/codeexamples/programming/parallelisation/RunParallelisationExample.java index 402d9c4f..6c4da49e 100644 --- a/src/main/java/org/matsim/codeexamples/programming/parallelisation/RunParallelisationExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/parallelisation/RunParallelisationExample.java @@ -77,12 +77,12 @@ public static void main(String[] args) { Config config = ConfigUtils.createConfig(); String configFilename = "examples/siouxfalls-2014/config_default.xml"; ConfigUtils.loadConfig(config, configFilename); - config.controler().setLastIteration(10); + config.controller().setLastIteration(10); /*====================================================================*/ /* Setting parallelisation: */ config.qsim().setNumberOfThreads(1); /* Mobility simulation */ config.global().setNumberOfThreads(1); /* Replanning */ - config.parallelEventHandling().setNumberOfThreads(1); /* Events handling. */ + config.eventsManager().setNumberOfThreads(1); /* Events handling. */ /*====================================================================*/ Scenario sc = ScenarioUtils.loadScenario(config); Controler controler = new Controler(sc); @@ -91,16 +91,16 @@ public static void main(String[] args) { Gbl.printElapsedTime(); /* Running multi-threaded. First delete the output directory. */ - IOUtils.deleteDirectoryRecursively(new File(config.controler().getOutputDirectory()).toPath()); + IOUtils.deleteDirectoryRecursively(new File(config.controller().getOutputDirectory()).toPath()); Gbl.startMeasurement(); config = ConfigUtils.createConfig(); ConfigUtils.loadConfig(config, configFilename); - config.controler().setLastIteration(10); + config.controller().setLastIteration(10); /*====================================================================*/ /* Setting parallelisation: */ config.qsim().setNumberOfThreads(2); /* Mobility simulation */ config.global().setNumberOfThreads(2); /* Replanning */ - config.parallelEventHandling().setNumberOfThreads(2); /* Events handling. */ + config.eventsManager().setNumberOfThreads(2); /* Events handling. */ /*====================================================================*/ sc = ScenarioUtils.loadScenario(config); controler = new Controler(sc); diff --git a/src/main/java/org/matsim/codeexamples/programming/reuseDefaultBindings/RunReuseDefaultBindingsExample1.java b/src/main/java/org/matsim/codeexamples/programming/reuseDefaultBindings/RunReuseDefaultBindingsExample1.java index 65558dd0..d561c119 100644 --- a/src/main/java/org/matsim/codeexamples/programming/reuseDefaultBindings/RunReuseDefaultBindingsExample1.java +++ b/src/main/java/org/matsim/codeexamples/programming/reuseDefaultBindings/RunReuseDefaultBindingsExample1.java @@ -18,8 +18,8 @@ class RunReuseDefaultBindingsExample1{ public static void main( String[] args ){ Config config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ) ) ; - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 0 ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 0 ); Scenario scenario = ScenarioUtils.loadScenario( config ); diff --git a/src/main/java/org/matsim/codeexamples/programming/terminationCriterion/RunTerminationCriterionExample.java b/src/main/java/org/matsim/codeexamples/programming/terminationCriterion/RunTerminationCriterionExample.java index c4663e0c..62832b9e 100644 --- a/src/main/java/org/matsim/codeexamples/programming/terminationCriterion/RunTerminationCriterionExample.java +++ b/src/main/java/org/matsim/codeexamples/programming/terminationCriterion/RunTerminationCriterionExample.java @@ -14,8 +14,8 @@ class RunTerminationCriterionExample{ public static void main( String[] args ){ Config config = ConfigUtils.createConfig(); - config.controler().setLastIteration( 100 ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 100 ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); Scenario scenario = ScenarioUtils.loadScenario( config ); diff --git a/src/main/java/org/matsim/codeexamples/router/example13MultiStageTripRouting/RunTeleportationMobsimWithCustomRoutingExample.java b/src/main/java/org/matsim/codeexamples/router/example13MultiStageTripRouting/RunTeleportationMobsimWithCustomRoutingExample.java index 8d4591dd..66844885 100644 --- a/src/main/java/org/matsim/codeexamples/router/example13MultiStageTripRouting/RunTeleportationMobsimWithCustomRoutingExample.java +++ b/src/main/java/org/matsim/codeexamples/router/example13MultiStageTripRouting/RunTeleportationMobsimWithCustomRoutingExample.java @@ -31,8 +31,8 @@ import org.matsim.api.core.v01.network.Link; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; @@ -63,7 +63,7 @@ public static void main(final String[] args) { // ... and add local changes: tuneConfig( config ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); // load the scenario: final Scenario scenario = ScenarioUtils.loadScenario( config ); @@ -110,12 +110,12 @@ private static void tuneConfig(final Config config) { scoreTelepInteract.setTypicalDuration( 2 * 60 ); scoreTelepInteract.setOpeningTime( 0 ); scoreTelepInteract.setClosingTime( 0 ); - config.planCalcScore().addActivityParams( scoreTelepInteract ); + config.scoring().addActivityParams( scoreTelepInteract ); - final PlanCalcScoreConfigGroup.ModeParams modeParams = new PlanCalcScoreConfigGroup.ModeParams( + final ScoringConfigGroup.ModeParams modeParams = new ScoringConfigGroup.ModeParams( MyRoutingModule.TELEPORTATION_LEG_MODE); - config.planCalcScore().addModeParams(modeParams); + config.scoring().addModeParams(modeParams); } private static ActivityFacility createFacility( diff --git a/src/main/java/org/matsim/codeexamples/router/randomizingRouter/RunRandomizingRouterExample.java b/src/main/java/org/matsim/codeexamples/router/randomizingRouter/RunRandomizingRouterExample.java index ddbf4f2c..6e807b24 100644 --- a/src/main/java/org/matsim/codeexamples/router/randomizingRouter/RunRandomizingRouterExample.java +++ b/src/main/java/org/matsim/codeexamples/router/randomizingRouter/RunRandomizingRouterExample.java @@ -46,10 +46,10 @@ public static void main(String[] args) { // this is an example script that was never tested!! Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(1); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration(1); - config.plansCalcRoute().setRoutingRandomness( 3. ); + config.routing().setRoutingRandomness( 3. ); // (This is currently the default anyways. kai, mar'20) Scenario scenario = ScenarioUtils.createScenario(config) ; diff --git a/src/main/java/org/matsim/codeexamples/router/travelDisutility/RunTravelDisutilityExample.java b/src/main/java/org/matsim/codeexamples/router/travelDisutility/RunTravelDisutilityExample.java index 6d449043..19872693 100644 --- a/src/main/java/org/matsim/codeexamples/router/travelDisutility/RunTravelDisutilityExample.java +++ b/src/main/java/org/matsim/codeexamples/router/travelDisutility/RunTravelDisutilityExample.java @@ -46,10 +46,10 @@ public static void main(String[] args) { // this is an example script that was never tested!! Config config = ConfigUtils.createConfig() ; - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(1); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration(1); - config.plansCalcRoute().setRoutingRandomness( 3. ); + config.routing().setRoutingRandomness( 3. ); // (This is currently the default anyways. kai, mar'20) Scenario scenario = ScenarioUtils.createScenario(config) ; diff --git a/src/main/java/org/matsim/codeexamples/scoring/aaIncomeDependentScoring/RunIncomeDependentScoringExample.java b/src/main/java/org/matsim/codeexamples/scoring/aaIncomeDependentScoring/RunIncomeDependentScoringExample.java index 17359edb..f2f35487 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/aaIncomeDependentScoring/RunIncomeDependentScoringExample.java +++ b/src/main/java/org/matsim/codeexamples/scoring/aaIncomeDependentScoring/RunIncomeDependentScoringExample.java @@ -8,7 +8,7 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.config.groups.ScenarioConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; @@ -55,15 +55,15 @@ public static void main(String [] args) { final Config config; if ( args==null || args.length==0 || args[0]==null ){ config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ) ); - config.controler().setOutputDirectory( "output/ownMoneyScoring/" ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOutputDirectory( "output/ownMoneyScoring/" ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); } else { config = ConfigUtils.loadConfig( args ); } - PlanCalcScoreConfigGroup.ModeParams params = new PlanCalcScoreConfigGroup.ModeParams( "car" ); + ScoringConfigGroup.ModeParams params = new ScoringConfigGroup.ModeParams( "car" ); params.setDailyMonetaryConstant( 10. ); - config.planCalcScore().addModeParams( params ); + config.scoring().addModeParams( params ); // --- @@ -121,9 +121,9 @@ public void install() { // // yyyy TODO move to matsim core. kai, jun'22 // // final Map> actParamsBySubpop = new LinkedHashMap<>(); -// for( Map.Entry entry : scoringConfig.getScoringParametersPerSubpopulation().entrySet() ){ +// for( Map.Entry entry : scoringConfig.getScoringParametersPerSubpopulation().entrySet() ){ // Map newParams = new TreeMap<>(); -// for ( PlanCalcScoreConfigGroup.ActivityParams params : entry.getValue().getActivityParams()) { +// for ( ScoringConfigGroup.ActivityParams params : entry.getValue().getActivityParams()) { // ActivityUtilityParameters.Builder factory = new ActivityUtilityParameters.Builder(params) ; // newParams.put(params.getActivityType(), factory.build() ) ; // } diff --git a/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/ExampleIndividualizedScoringParametersPerPerson.java b/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/ExampleIndividualizedScoringParametersPerPerson.java index bcee9ecf..47d5a1c3 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/ExampleIndividualizedScoringParametersPerPerson.java +++ b/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/ExampleIndividualizedScoringParametersPerPerson.java @@ -4,7 +4,7 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.population.Person; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.scoring.functions.ActivityUtilityParameters; import org.matsim.core.scoring.functions.ModeUtilityParameters; import org.matsim.core.scoring.functions.ScoringParameters; diff --git a/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/RunIndividualizedScoringExample.java b/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/RunIndividualizedScoringExample.java index 85bf2f36..b01d3a4a 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/RunIndividualizedScoringExample.java +++ b/src/main/java/org/matsim/codeexamples/scoring/individualizedScoringParameters/RunIndividualizedScoringExample.java @@ -17,7 +17,7 @@ public static void main(String... args) { final Config config; if ( args==null || args.length==0 || args[0]==null ){ config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ) ); - config.controler().setOutputDirectory( "output/exampleIndividualScores/" ); + config.controller().setOutputDirectory( "output/exampleIndividualScores/" ); } else { config = ConfigUtils.loadConfig( args ); } diff --git a/src/main/java/org/matsim/codeexamples/scoring/kindergartenActivityScoring/RunScenarioWithCustomScoring.java b/src/main/java/org/matsim/codeexamples/scoring/kindergartenActivityScoring/RunScenarioWithCustomScoring.java index c74df7ca..29424a04 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/kindergartenActivityScoring/RunScenarioWithCustomScoring.java +++ b/src/main/java/org/matsim/codeexamples/scoring/kindergartenActivityScoring/RunScenarioWithCustomScoring.java @@ -48,8 +48,8 @@ public static void main(String[] args) { Config config = ConfigUtils.loadConfig("input/ha2/ha2policyCaseConfig.xml"); //Relative path locations must be relative to the project folder (both in the config and here) - config.controler().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration(10); + config.controller().setOverwriteFileSetting( OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration(10); // This loads the scenario final Scenario scenario = ScenarioUtils.loadScenario(config) ; final KindergartenArrivalHandler kindergartenArrivalHandler = new KindergartenArrivalHandler(); diff --git a/src/main/java/org/matsim/codeexamples/scoring/ownMoneyScoring/RunOwnMoneyScoringExample.java b/src/main/java/org/matsim/codeexamples/scoring/ownMoneyScoring/RunOwnMoneyScoringExample.java index 77f77410..cba23cfe 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/ownMoneyScoring/RunOwnMoneyScoringExample.java +++ b/src/main/java/org/matsim/codeexamples/scoring/ownMoneyScoring/RunOwnMoneyScoringExample.java @@ -32,8 +32,8 @@ public static void main(String [] args) { final Config config; if ( args==null || args.length==0 || args[0]==null ){ config = ConfigUtils.loadConfig( IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "equil" ), "config.xml" ) ); - config.controler().setOutputDirectory( "output/ownMoneyScoring/" ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOutputDirectory( "output/ownMoneyScoring/" ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); } else { config = ConfigUtils.loadConfig( args ); } diff --git a/src/main/java/org/matsim/codeexamples/scoring/ownScoring/RunScoringExample.java b/src/main/java/org/matsim/codeexamples/scoring/ownScoring/RunScoringExample.java index 036c2d79..48652768 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/ownScoring/RunScoringExample.java +++ b/src/main/java/org/matsim/codeexamples/scoring/ownScoring/RunScoringExample.java @@ -35,9 +35,9 @@ public static void main( String [] args ) { final URL url = ExamplesUtils.getTestScenarioURL("pt-simple"); Config config = ConfigUtils.loadConfig( IOUtils.extendUrl( url, "config.xml" ) ); - config.controler().setOverwriteFileSetting( deleteDirectoryIfExists ); + config.controller().setOverwriteFileSetting( deleteDirectoryIfExists ); - config.planCalcScore().setWriteExperiencedPlans( true ); + config.scoring().setWriteExperiencedPlans( true ); // --- diff --git a/src/main/java/org/matsim/codeexamples/scoring/pseudoRandomErrors/RunPseudoRandomExperiment.java b/src/main/java/org/matsim/codeexamples/scoring/pseudoRandomErrors/RunPseudoRandomExperiment.java index b4fad3cb..ee7c7736 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/pseudoRandomErrors/RunPseudoRandomExperiment.java +++ b/src/main/java/org/matsim/codeexamples/scoring/pseudoRandomErrors/RunPseudoRandomExperiment.java @@ -26,12 +26,12 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.GlobalConfigGroup; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ModeParams; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ScoringParameterSet; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup.ModeRoutingParams; -import org.matsim.core.config.groups.StrategyConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup.ModeParams; +import org.matsim.core.config.groups.ScoringConfigGroup.ScoringParameterSet; +import org.matsim.core.config.groups.RoutingConfigGroup.ModeRoutingParams; +import org.matsim.core.config.groups.ReplanningConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -57,12 +57,12 @@ static public void main(String[] args) throws ConfigurationException { Config config = ConfigUtils.createConfig(); // Some initial setup - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(300); - config.controler().setOutputDirectory("simulation_output"); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(300); + config.controller().setOutputDirectory("simulation_output"); // Setting up the activity scoring parameters ... - ScoringParameterSet scoringParameters = config.planCalcScore().getOrCreateScoringParameters(null); + ScoringParameterSet scoringParameters = config.scoring().getOrCreateScoringParameters(null); // ... for generic activity ActivityParams homeParams = scoringParameters.getOrCreateActivityParams("generic"); @@ -82,9 +82,9 @@ static public void main(String[] args) throws ConfigurationException { ptParams.setMonetaryDistanceRate(0.0); // Setting up replanning ... - StrategyConfigGroup strategyConfig = config.strategy(); - strategyConfig.clearStrategySettings(); - strategyConfig.setMaxAgentPlanMemorySize(3); + ReplanningConfigGroup replanningConfig = config.replanning(); + replanningConfig.clearStrategySettings(); + replanningConfig.setMaxAgentPlanMemorySize(3); double innovationRate = cmd.getOption("innovation-rate").map(Double::parseDouble).orElse(0.1); @@ -92,28 +92,28 @@ static public void main(String[] args) throws ConfigurationException { StrategySettings selectionStrategy = new StrategySettings(); selectionStrategy.setStrategyName(cmd.getOption("selection-strategy").orElse("ChangeExpBeta")); selectionStrategy.setWeight(1.0 - innovationRate); - strategyConfig.addStrategySettings(selectionStrategy); + replanningConfig.addStrategySettings(selectionStrategy); // ... for innovation StrategySettings innovationStrategy = new StrategySettings(); innovationStrategy.setStrategyName(cmd.getOption("innovation-strategy").orElse("RandomMode")); innovationStrategy.setWeight(innovationRate); - strategyConfig.addStrategySettings(innovationStrategy); + replanningConfig.addStrategySettings(innovationStrategy); config.changeMode().setModes(new String[] { "car", "pt" }); // Setting up routing ... - config.plansCalcRoute().setNetworkModes(Collections.emptySet()); + config.routing().setNetworkModes(Collections.emptySet()); config.qsim().setMainModes(Collections.emptySet()); config.travelTimeCalculator().setAnalyzedModes(Collections.emptySet()); config.linkStats().setWriteLinkStatsInterval(0); // ... for car ... - var carRoutingParams = config.plansCalcRoute().getOrCreateModeRoutingParams("car"); + var carRoutingParams = config.routing().getOrCreateModeRoutingParams("car"); carRoutingParams.setTeleportedModeFreespeedFactor(1.0); // ... and for public transport - var ptRoutingParams = config.plansCalcRoute().getOrCreateModeRoutingParams("pt"); + var ptRoutingParams = config.routing().getOrCreateModeRoutingParams("pt"); ptRoutingParams.setTeleportedModeFreespeedFactor(1.0); // Set configuration options diff --git a/src/main/java/org/matsim/codeexamples/scoring/subpopulations/RunScoringBySubpopulationExample.java b/src/main/java/org/matsim/codeexamples/scoring/subpopulations/RunScoringBySubpopulationExample.java index 4b36fbe4..6b0aa01f 100644 --- a/src/main/java/org/matsim/codeexamples/scoring/subpopulations/RunScoringBySubpopulationExample.java +++ b/src/main/java/org/matsim/codeexamples/scoring/subpopulations/RunScoringBySubpopulationExample.java @@ -3,7 +3,7 @@ import org.matsim.api.core.v01.TransportMode; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; class RunScoringBySubpopulationExample{ @@ -13,15 +13,15 @@ public static void main( String[] args ){ Config config = ConfigUtils.createConfig() ; { - PlanCalcScoreConfigGroup.ScoringParameterSet params = config.planCalcScore().getOrCreateScoringParameters( "employed" ); + ScoringConfigGroup.ScoringParameterSet params = config.scoring().getOrCreateScoringParameters( "employed" ); { - PlanCalcScoreConfigGroup.ActivityParams actParams = new PlanCalcScoreConfigGroup.ActivityParams(); + ScoringConfigGroup.ActivityParams actParams = new ScoringConfigGroup.ActivityParams(); actParams.setActivityType( "home" ); // ... params.addActivityParams( actParams ); } { - PlanCalcScoreConfigGroup.ModeParams modeParams = new PlanCalcScoreConfigGroup.ModeParams( TransportMode.car ) ; + ScoringConfigGroup.ModeParams modeParams = new ScoringConfigGroup.ModeParams( TransportMode.car ) ; modeParams.setMarginalUtilityOfTraveling( -6. ) ; // ... params.addModeParams( modeParams ); diff --git a/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/MyExpBetaPlanChangerForRemovalProvider.java b/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/MyExpBetaPlanChangerForRemovalProvider.java index 08df1d24..3ceb9dee 100644 --- a/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/MyExpBetaPlanChangerForRemovalProvider.java +++ b/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/MyExpBetaPlanChangerForRemovalProvider.java @@ -41,7 +41,7 @@ public class MyExpBetaPlanChangerForRemovalProvider implements Provider get() { - return new ExpBetaPlanChanger<>( - config.planCalcScore().getBrainExpBeta()); + return new ExpBetaPlanChanger<>( - config.scoring().getBrainExpBeta()); } } diff --git a/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/RunPlanSelectorForRemovalExample.java b/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/RunPlanSelectorForRemovalExample.java index 03bc548a..d660fa53 100644 --- a/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/RunPlanSelectorForRemovalExample.java +++ b/src/main/java/org/matsim/codeexamples/strategies/planStrategyForRemoval/RunPlanSelectorForRemovalExample.java @@ -35,10 +35,10 @@ public class RunPlanSelectorForRemovalExample { public static void main(String[] args) { Config config = ConfigUtils.createConfig(); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(1); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(1); - config.strategy().setPlanSelectorForRemoval( SELECTOR_NAME ); + config.replanning().setPlanSelectorForRemoval( SELECTOR_NAME ); Controler controler = new Controler(config); @@ -46,7 +46,7 @@ public static void main(String[] args) { @Override public void install() { - if (getConfig().strategy().getPlanSelectorForRemoval().equals(SELECTOR_NAME)) { + if (getConfig().replanning().getPlanSelectorForRemoval().equals(SELECTOR_NAME)) { bindPlanSelectorForRemoval().toProvider(MyExpBetaPlanChangerForRemovalProvider.class); } } diff --git a/src/main/java/org/matsim/codeexamples/strategies/pluggablePlanStrategyInCode/RunPluggablePlanStrategyInCodeExample.java b/src/main/java/org/matsim/codeexamples/strategies/pluggablePlanStrategyInCode/RunPluggablePlanStrategyInCodeExample.java index 54997df7..a8e121fa 100644 --- a/src/main/java/org/matsim/codeexamples/strategies/pluggablePlanStrategyInCode/RunPluggablePlanStrategyInCodeExample.java +++ b/src/main/java/org/matsim/codeexamples/strategies/pluggablePlanStrategyInCode/RunPluggablePlanStrategyInCodeExample.java @@ -21,7 +21,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.StrategyConfigGroup.StrategySettings; +import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -48,14 +48,14 @@ public static void main(final String[] args) { StrategySettings stratSets = new StrategySettings(); stratSets.setStrategyName(STRATEGY_NAME); stratSets.setWeight(0.1); - config.strategy().addStrategySettings(stratSets); + config.replanning().addStrategySettings(stratSets); //let the output directory be overwritten - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); //only run one iteration - config.controler().setFirstIteration(0); - config.controler().setLastIteration(1); + config.controller().setFirstIteration(0); + config.controller().setLastIteration(1); final Controler controler = new Controler(config); diff --git a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningAgents/RunWithinDayReplanningAgentExample.java b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningAgents/RunWithinDayReplanningAgentExample.java index b40aace4..7d3c050e 100644 --- a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningAgents/RunWithinDayReplanningAgentExample.java +++ b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningAgents/RunWithinDayReplanningAgentExample.java @@ -69,11 +69,11 @@ public static void main(String[] args) { URL networkUrl = IOUtils.extendUrl(context, "network-wo-dummy-node.xml"); // config.network().setInputFile("scenarios/siouxfalls/network-wo-dummy-node.xml") ; config.network().setInputFile(networkUrl.toString()); - config.controler().setLastIteration(0) ; - config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(0) ; + config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); config.qsim().setEndTime(26.*3600) ; config.qsim().setSnapshotStyle( QSimConfigGroup.SnapshotStyle.queue ) ; - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); // base the controler on that: Controler ctrl = new Controler( config ) ; ctrl.addOverridingModule(new AbstractModule() { diff --git a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/MyWithinDayMobsimListener.java b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/MyWithinDayMobsimListener.java index b1ffde36..c9e37347 100644 --- a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/MyWithinDayMobsimListener.java +++ b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/MyWithinDayMobsimListener.java @@ -40,7 +40,7 @@ import org.matsim.api.core.v01.population.PlanElement; import org.matsim.api.core.v01.population.PopulationFactory; import org.matsim.api.core.v01.population.Population; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.mobsim.framework.HasPerson; import org.matsim.core.mobsim.framework.MobsimAgent; import org.matsim.core.mobsim.framework.MobsimDriverAgent; diff --git a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/RunWithinDayReplanningFromPlansExample.java b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/RunWithinDayReplanningFromPlansExample.java index e3543aae..487c139c 100644 --- a/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/RunWithinDayReplanningFromPlansExample.java +++ b/src/main/java/org/matsim/codeexamples/withinday/withinDayReplanningFromPlans/RunWithinDayReplanningFromPlansExample.java @@ -40,7 +40,7 @@ public static void main(String[] args){ final Scenario scenario = ScenarioUtils.createScenario( config ); final Controler controler = new Controler( scenario ); - controler.getConfig().controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.failIfDirectoryExists ); + controler.getConfig().controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.failIfDirectoryExists ); // (need to make sure that test fails if it does not get the output directory right! kai, nov'15) // define the travel time collector (/predictor) that you want to use for routing: diff --git a/src/test/java/org/matsim/codeexamples/config/ExamplesByConfigfileTest.java b/src/test/java/org/matsim/codeexamples/config/ExamplesByConfigfileTest.java index fe6288da..3588b193 100644 --- a/src/test/java/org/matsim/codeexamples/config/ExamplesByConfigfileTest.java +++ b/src/test/java/org/matsim/codeexamples/config/ExamplesByConfigfileTest.java @@ -33,7 +33,6 @@ import org.matsim.core.config.Config; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.testcases.MatsimTestUtils; /** diff --git a/src/test/java/org/matsim/codeexamples/config/external/ExternalMobsimByConfigfileTest.java b/src/test/java/org/matsim/codeexamples/config/external/ExternalMobsimByConfigfileTest.java index 7d501a50..d203f44f 100644 --- a/src/test/java/org/matsim/codeexamples/config/external/ExternalMobsimByConfigfileTest.java +++ b/src/test/java/org/matsim/codeexamples/config/external/ExternalMobsimByConfigfileTest.java @@ -19,9 +19,10 @@ package org.matsim.codeexamples.config.external; import java.io.File; +import java.io.UncheckedIOException; + import org.junit.Test; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; /** * @author vsp-gleich diff --git a/src/test/java/org/matsim/codeexamples/extensions/minibus/RunMinibusTest.java b/src/test/java/org/matsim/codeexamples/extensions/minibus/RunMinibusTest.java index ed35e9a2..320ef75a 100644 --- a/src/test/java/org/matsim/codeexamples/extensions/minibus/RunMinibusTest.java +++ b/src/test/java/org/matsim/codeexamples/extensions/minibus/RunMinibusTest.java @@ -40,10 +40,10 @@ public final void testMain() { Config config = runner.getConfig(); - config.controler().setOutputDirectory( utils.getOutputDirectory() ); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOutputDirectory( utils.getOutputDirectory() ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 1 ); + config.controller().setLastIteration( 1 ); runner.run(); } diff --git a/src/test/java/org/matsim/codeexamples/integration/RunMultipleModesExampleTest.java b/src/test/java/org/matsim/codeexamples/integration/RunMultipleModesExampleTest.java index b7208037..11d9b27d 100644 --- a/src/test/java/org/matsim/codeexamples/integration/RunMultipleModesExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/integration/RunMultipleModesExampleTest.java @@ -18,9 +18,9 @@ public void testRun() { try{ Config config = RunMultipleModesExample.prepareConfig() ; - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setOutputDirectory( utils.getOutputDirectory() ); - config.controler().setLastIteration( 2 ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setOutputDirectory( utils.getOutputDirectory() ); + config.controller().setLastIteration( 2 ); Scenario scenario = RunMultipleModesExample.prepareScenario( config ); diff --git a/src/test/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExampleTest.java b/src/test/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExampleTest.java index 49e27fdb..9155022c 100644 --- a/src/test/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/mobsim/mobsimPassingVehicleQ/RunMobsimWithMultipleModeVehiclesExampleTest.java @@ -9,7 +9,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.testcases.MatsimTestUtils; public class RunMobsimWithMultipleModeVehiclesExampleTest { diff --git a/src/test/java/org/matsim/codeexamples/mobsim/replaceAgentFactory/RunReplaceAgentFactoryExampleTest.java b/src/test/java/org/matsim/codeexamples/mobsim/replaceAgentFactory/RunReplaceAgentFactoryExampleTest.java index 5164fb91..cc91a8d8 100644 --- a/src/test/java/org/matsim/codeexamples/mobsim/replaceAgentFactory/RunReplaceAgentFactoryExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/mobsim/replaceAgentFactory/RunReplaceAgentFactoryExampleTest.java @@ -23,9 +23,9 @@ public class RunReplaceAgentFactoryExampleTest { try { final RunReplaceAgentFactoryExample main = new RunReplaceAgentFactoryExample();; final Config config = main.prepareConfig(); - config.controler().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); - config.controler().setLastIteration( 2 ); - config.controler().setOutputDirectory( utils.getOutputDirectory() ); + config.controller().setOverwriteFileSetting( OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists ); + config.controller().setLastIteration( 2 ); + config.controller().setOutputDirectory( utils.getOutputDirectory() ); Controler controler = main.prepareControler() ; diff --git a/src/test/java/org/matsim/codeexamples/programming/controlerListener/ControlerListenerExampleTest.java b/src/test/java/org/matsim/codeexamples/programming/controlerListener/ControlerListenerExampleTest.java index 07ec4781..1f93eea9 100644 --- a/src/test/java/org/matsim/codeexamples/programming/controlerListener/ControlerListenerExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/programming/controlerListener/ControlerListenerExampleTest.java @@ -21,11 +21,11 @@ import static org.junit.Assert.fail; import java.io.File; +import java.io.UncheckedIOException; import org.junit.Test; import org.matsim.codeexamples.programming.controlerListener.RunControlerListenerExample; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; public class ControlerListenerExampleTest { diff --git a/src/test/java/org/matsim/codeexamples/programming/individualizedScoringParameters/IntegrationTest.java b/src/test/java/org/matsim/codeexamples/programming/individualizedScoringParameters/IntegrationTest.java index 02f2472c..bd08ff74 100644 --- a/src/test/java/org/matsim/codeexamples/programming/individualizedScoringParameters/IntegrationTest.java +++ b/src/test/java/org/matsim/codeexamples/programming/individualizedScoringParameters/IntegrationTest.java @@ -2,11 +2,11 @@ import org.junit.Test; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.codeexamples.scoring.individualizedScoringParameters.RunIndividualizedScoringExample; import java.io.File; +import java.io.UncheckedIOException; /** * @author thibautd diff --git a/src/test/java/org/matsim/codeexamples/programming/scenario/ScenarioElementAndInjection.java b/src/test/java/org/matsim/codeexamples/programming/scenario/ScenarioElementAndInjection.java index fdaf2910..240e39d5 100644 --- a/src/test/java/org/matsim/codeexamples/programming/scenario/ScenarioElementAndInjection.java +++ b/src/test/java/org/matsim/codeexamples/programming/scenario/ScenarioElementAndInjection.java @@ -32,8 +32,8 @@ public void test1() { // not really a test in its current form! Config config = ConfigUtils.createConfig() ; - config.controler().setOutputDirectory( utils.getOutputDirectory() ); - config.controler().setLastIteration( 2 ); + config.controller().setOutputDirectory( utils.getOutputDirectory() ); + config.controller().setLastIteration( 2 ); Scenario scenario = ScenarioUtils.loadScenario( config ); diff --git a/src/test/java/org/matsim/codeexamples/programming/withinDayReplanningFromPlans/IntegrationTest.java b/src/test/java/org/matsim/codeexamples/programming/withinDayReplanningFromPlans/IntegrationTest.java index daa491e9..f4b90831 100644 --- a/src/test/java/org/matsim/codeexamples/programming/withinDayReplanningFromPlans/IntegrationTest.java +++ b/src/test/java/org/matsim/codeexamples/programming/withinDayReplanningFromPlans/IntegrationTest.java @@ -19,11 +19,11 @@ package org.matsim.codeexamples.programming.withinDayReplanningFromPlans; import java.io.File; +import java.io.UncheckedIOException; import org.junit.Rule; import org.junit.Test; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; import org.matsim.testcases.MatsimTestUtils; import org.matsim.codeexamples.withinday.withinDayReplanningFromPlans.RunWithinDayReplanningFromPlansExample; From 44e5adb7372dcdb08021078882d58477bcc450a8 Mon Sep 17 00:00:00 2001 From: Marcel Rieser Date: Mon, 23 Oct 2023 21:19:34 +0200 Subject: [PATCH 2/3] adapt tests the failing tests used a checkerboard- or equil-scenario, which provides lots of identical routes. Due to the change to SpeedyALT as default router, slightly different routes must be expected in these cases. --- .../config-with-subpopulation.xml | 10 +++++----- .../freight/RunFreightExampleTest.java | 8 ++++---- .../RunFreightWithIterationsExampleTest.java | 8 ++++---- .../SubpopulationsExampleTest.java | 4 ++-- .../testMain/output_events.xml.gz | Bin 1884 -> 1889 bytes .../testMain/output_events.xml.gz | Bin 1887 -> 1891 bytes 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/scenarios/equil-extended/config-with-subpopulation.xml b/scenarios/equil-extended/config-with-subpopulation.xml index eb663255..f7f9fdcd 100644 --- a/scenarios/equil-extended/config-with-subpopulation.xml +++ b/scenarios/equil-extended/config-with-subpopulation.xml @@ -4,13 +4,13 @@ - + - + @@ -37,8 +37,8 @@ - - + + @@ -192,7 +192,7 @@ - + diff --git a/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest.java b/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest.java index 1f7e3400..98bf5157 100644 --- a/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest.java @@ -22,11 +22,11 @@ public class RunFreightExampleTest{ public void testMain(){ try{ String[] args = { IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "freight-chessboard-9x9" ), "config.xml" ).toString() , - "--config:controler.outputDirectory", utils.getOutputDirectory(), - "--config:controler.lastIteration", "0", + "--config:controller.outputDirectory", utils.getOutputDirectory(), + "--config:controller.lastIteration", "0", "--config:plans.inputPlansFile", "null", - "--config:freight.carriersFile", "singleCarrierFiveActivitiesWithoutRoutes.xml", - "--config:freight.carriersVehicleTypeFile", "vehicleTypes.xml" + "--config:freightCarriers.carriersFile", "singleCarrierFiveActivitiesWithoutRoutes.xml", + "--config:freightCarriers.carriersVehicleTypeFile", "vehicleTypes.xml" }; RunFreightExample.run(args, false); { diff --git a/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest.java b/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest.java index af959710..788849da 100644 --- a/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest.java @@ -24,11 +24,11 @@ public class RunFreightWithIterationsExampleTest{ public void testMain(){ try{ String[] args = { IOUtils.extendUrl( ExamplesUtils.getTestScenarioURL( "freight-chessboard-9x9" ), "config.xml" ).toString() , - "--config:controler.outputDirectory", utils.getOutputDirectory(), - "--config:controler.lastIteration", "1", + "--config:controller.outputDirectory", utils.getOutputDirectory(), + "--config:controller.lastIteration", "1", "--config:plans.inputPlansFile", "null", - "--config:freight.carriersFile", "singleCarrierFiveActivitiesWithoutRoutes.xml", - "--config:freight.carriersVehicleTypeFile", "vehicleTypes.xml" + "--config:freightCarriers.carriersFile", "singleCarrierFiveActivitiesWithoutRoutes.xml", + "--config:freightCarriers.carriersVehicleTypeFile", "vehicleTypes.xml" }; RunFreightWithIterationsExample.run(args, false); { diff --git a/src/test/java/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest.java b/src/test/java/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest.java index 1d8d668b..60b82536 100644 --- a/src/test/java/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest.java +++ b/src/test/java/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest.java @@ -56,8 +56,8 @@ public final void testMain() { // , "--config:controler.lastIteration=1" // } ); RunSubpopulationsExample.main( new String[]{"scenarios/equil-extended/config-with-subpopulation.xml" - , "--config:controler.outputDirectory=" + utils.getOutputDirectory() - , "--config:controler.lastIteration=1" + , "--config:controller.outputDirectory=" + utils.getOutputDirectory() + , "--config:controller.lastIteration=1" } ); // { // String expected = utils.getInputDirectory() + "/output_events.xml.gz" ; diff --git a/test/input/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest/testMain/output_events.xml.gz b/test/input/org/matsim/codeexamples/extensions/freight/RunFreightExampleTest/testMain/output_events.xml.gz index a85028b402bd7f58b43dbd1be3fc1aa833c087a0..54c683d0d96a1aae571340e43b03a9e7700044c1 100644 GIT binary patch literal 1889 zcmV-n2cGyJiwFP!00000|IMA>Z`(Ey$Dh}~!thfHbgL**qy#kWOE+M^1{A}v*T8U; zRITF#isG&R{bV_5bGCSt&F@8eYV*VXeD6pe?~au7?!$jKtJ$Wk@2lJO`CR>y%xC3# zd3#x{ug~WX&DGEO{KNZK@5)WNZtm$XzJK-8?)$T*x+%}+sj^A3eS_xPUHj!?*_7+c z`RuNJ&Gsc%by;11ZZ4LKx~|GvU2MwFPhVW9;$pS^=|AP?YPl*e()nyvt-qenznmp+ z)a$?Iv-a)&?%wylS=7yZHhUZ3UzT_6FFw>IOv0+X{`2;-ee3om0|b2PsK2h8_TR@h zJzdIX_uu1R7?c?`PHOydI+QTlIH^;|Nez(s_|EO}+zOpF_2TNPTEZsx$rEf{Hvit% zU!QrrE?0}D+LWJe@2loVTnSqE+m1YIZXfDdH+}ALG9Q2R`(-Dxd&#^bZND>Qoye(E z0d?Nlp?;`al~+xt2IsLLvzv+KCBar_>P_+*Om#YA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LEmeEuI*plOH_asU9wxushG diff --git a/test/input/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest/testMain/output_events.xml.gz b/test/input/org/matsim/codeexamples/extensions/freight/RunFreightWithIterationsExampleTest/testMain/output_events.xml.gz index ae05f9d73905ca08a7e5d1ded443120c138e885f..935425d7c02f1befe1d2066231a14af697389484 100644 GIT binary patch delta 1858 zcmV-I2fg^;4&x4gABzY8000000RPRM-EZSI48Wgve?^d|9?`Jt3SGaq=Nuo8|tr%s{VKP zq34UT-v0N0^aq1tMvar`f1Hj*=xv%zHrsQ%kul)Y%Seu^85l#7#?TSizYG!g&QEp_r zqKclH8?M!Pyd9kFcA{2iZWvdm$L9ei{pxI|$|OQt#hiz@p8EJZ|GJMX+V_SgqDN0V& z3GR%47;FoW?Q3*HC5}0z&M|MqW86I8jf#tuo|>xcI4GLC$=VU7EU_aL6BI!Ww|Vy; zjediwk3caukFFZ4i{ z7*TrL?jwCU202wLeH;~$6e6f>?)ab);l_HjUuD^ncdJ7r){ zgiw_tazX`D3msdeP^rLTah9bFknMk-($HrB%4j@7WoP+OwmM~z009WQ zt-AUNz#nY06%>;+)gQ>F1{B20Fg?1;cFFO;iXoN*NM8i0$f?#c1y+*I$;C~=eGLbD z0tCe*I{`8s`%@3_WG6u8utgW$Huhx*#a6L%D(Eppba0hfywJ(8oB`73L^OXfRVN7^ zTX7?Oil*dLn-N7;XRZ+_0pSTyS4RN_80-lU6cZ0U`t&40(MiL?fo#dOhS;$POHu@x z^hd@Xs!&)FoyA81q|Y-NYN{0Yu?T~00kU0DOJ32|(&9yQ4%^yb5k0@O)KsPMmRttg z0;F$^(z^!GWk{L>39=E2^0$9L!NC@np_qilW!t4_bU-I8F59kkGblp1xEwX1f>BFs z`lEG*H^8wh<*Y*o96i>EPzxM0)7Sn$kF|**N`cN?BtQVt;&L}X0r-P0E<-Uxwb#Bp zNlc>&Xx1d(IYMBrU;4CaN*c2y+<7PJ}i zK{1IEzE{f!Be?@SQO5V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le!9VXIaP2k*=o#{Ja zqsQ7z^2d;|f=4-jQJ~>qgGeYQSrDl@mRI-iWKpC#qQ(qm2!)Zcb1JywrLl3OP2L`w zQ^k?TSQJV?7)W-VR#1S!Mv_oWu1K;^F9*qIFdGajr+@t2peGa344JXo2vv^G%RFzfS=&p-_ao8>|= siL%`8r{Q~evO8v7Ps1Uf>onXKg75wLw2RM;Y^$sP0d?SdxDs*z02bDrBme*a From 46be74a067904e0ef0ba4f21cc9cca41ff1dfc93 Mon Sep 17 00:00:00 2001 From: Marcel Rieser Date: Mon, 23 Oct 2023 21:26:14 +0200 Subject: [PATCH 3/3] adapt test comparison file interestingly, the original plans file seems to have never applied timeAllocationMutator to the plans, despite the agents having `subpopulation=time` set. So it actually rather seems as if the old reference file (and code) was bad and now it's fixed. Or I don't understand the intent of the test... --- .../testMain/output_plans.xml.gz | Bin 7259 -> 7357 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/test/input/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest/testMain/output_plans.xml.gz b/test/input/org/matsim/codeexamples/programming/multipleSubpopulations/SubpopulationsExampleTest/testMain/output_plans.xml.gz index 86626ba425b73b97e44ae443dc6f29fd9227406a..290695a2a7f8b9660ceb6f8347e42dfc9a1f41b3 100644 GIT binary patch literal 7357 zcmZWucQo92wBHSakXEJ?Fji{Cnqn@9*CGDfb-A!DN42{avmn8QUARMtm$Dsq>kx$=Wzs$@9)M zElCWnA^Tg8lwz(!gRP~nh?kzqu2pZ%3-2T@VinwYZ{SW(?$rC+GD5eRBjEx2nct8I zd#TfPd@agjyKyKW%zmoQSSU*!^{0(=j5a@QOe5;wZGj=cexh~7MQ9z zJ6JiM&p+Ih;>8biuI67>o^%cc%o~0`S;2*kJjFkI_TBw-XSQ`Q?s9)8APzZI>v`B6 zRUE5|M*+E0isQh=cu&uRy^S)ylv6rpJ`$EBUKpQs1jCmS;|Io3Z&9?rz%$-PM=R-V+N5 zTpXP3sB(7}@8h;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