diff --git a/pom.xml b/pom.xml index aa2be0cd..5741d5a6 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ matsim-all - 16.0-PR2738 + 16.0-PR2976 diff --git a/src/main/java/org/matsim/analysis/TravelTimeComparison.java b/src/main/java/org/matsim/analysis/TravelTimeComparison.java index aa575e33..4256945b 100644 --- a/src/main/java/org/matsim/analysis/TravelTimeComparison.java +++ b/src/main/java/org/matsim/analysis/TravelTimeComparison.java @@ -10,7 +10,7 @@ import org.matsim.application.options.OutputOptions; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.EventsUtils; -import org.matsim.core.router.FastDijkstraFactory; +import org.matsim.core.router.DijkstraFactory; import org.matsim.core.router.costcalculators.OnlyTimeDependentTravelDisutility; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.TravelTime; @@ -73,8 +73,8 @@ public Integer call() throws Exception { OnlyTimeDependentTravelDisutility util = new OnlyTimeDependentTravelDisutility(tt); - LeastCostPathCalculator congestedRouter = new FastDijkstraFactory(false).createPathCalculator(network, util, tt); - LeastCostPathCalculator freeflowRouter = new FastDijkstraFactory(false).createPathCalculator(network, new OnlyTimeDependentTravelDisutility(fs), fs); + LeastCostPathCalculator congestedRouter = new DijkstraFactory(false).createPathCalculator(network, util, tt); + LeastCostPathCalculator freeflowRouter = new DijkstraFactory(false).createPathCalculator(network, new OnlyTimeDependentTravelDisutility(fs), fs); data.addColumns( DoubleColumn.create("simulated", data.rowCount()), diff --git a/src/main/java/org/matsim/legacy/analysis/RunBerlinAccidents.java b/src/main/java/org/matsim/legacy/analysis/RunBerlinAccidents.java index 6b55645a..fb720303 100644 --- a/src/main/java/org/matsim/legacy/analysis/RunBerlinAccidents.java +++ b/src/main/java/org/matsim/legacy/analysis/RunBerlinAccidents.java @@ -37,16 +37,16 @@ public static void main(String[] args) throws IOException { String plans = "https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/berlin-v5.5-10pct/input/berlin-v5.5-10pct.plans.xml.gz"; Config config = RunBerlinScenario.prepareConfig(args); - config.controler().setOutputDirectory(outputFile); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(500); + config.controller().setOutputDirectory(outputFile); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(500); config.plans().setInputFile(plans); AccidentsConfigGroup accidentsSettings = ConfigUtils.addOrGetModule(config, AccidentsConfigGroup.class); accidentsSettings.setEnableAccidentsModule(true); accidentsSettings.setScaleFactor(10); config.network().setInputFile(BVWPNetwork); - config.planCalcScore().getModes().get("car").setMonetaryDistanceRate(-0.0004); + config.scoring().getModes().get("car").setMonetaryDistanceRate(-0.0004); Scenario scenario = RunBerlinScenario.prepareScenario(config); diff --git a/src/main/java/org/matsim/legacy/analysis/RunDirectWalkAnalysis.java b/src/main/java/org/matsim/legacy/analysis/RunDirectWalkAnalysis.java index 8405531b..cad6f49c 100644 --- a/src/main/java/org/matsim/legacy/analysis/RunDirectWalkAnalysis.java +++ b/src/main/java/org/matsim/legacy/analysis/RunDirectWalkAnalysis.java @@ -66,10 +66,10 @@ private static Scenario loadScenario(String runDirectory, String runId) { Config config = ConfigUtils.loadConfig(configFile); - if (!runId.equals(config.controler().getRunId())) + if (!runId.equals(config.controller().getRunId())) throw new RuntimeException("Given run ID " + runId + " doesn't match the run ID given in the config file. Aborting..."); - config.controler().setOutputDirectory(runDirectory); + config.controller().setOutputDirectory(runDirectory); config.plans().setInputFile(populationFile); config.network().setInputFile(networkFile); config.vehicles().setVehiclesFile(null); diff --git a/src/main/java/org/matsim/legacy/analysis/RunOfflineNoiseAnalysis.java b/src/main/java/org/matsim/legacy/analysis/RunOfflineNoiseAnalysis.java index ef95e675..69ad474a 100644 --- a/src/main/java/org/matsim/legacy/analysis/RunOfflineNoiseAnalysis.java +++ b/src/main/java/org/matsim/legacy/analysis/RunOfflineNoiseAnalysis.java @@ -73,8 +73,8 @@ void run() { config.global().setCoordinateSystem("GK4"); config.network().setInputFile(runDirectory + runId + ".output_network.xml.gz"); config.plans().setInputFile(runDirectory + runId + ".output_plans.xml.gz"); - config.controler().setOutputDirectory(runDirectory); - config.controler().setRunId(runId); + config.controller().setOutputDirectory(runDirectory); + config.controller().setRunId(runId); // adjust the default noise parameters diff --git a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformation.java b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformation.java index c0b65014..9fcba8b3 100644 --- a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformation.java +++ b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformation.java @@ -116,8 +116,8 @@ void run() throws IOException { config.transit().setVehiclesFile(runDirectory + runId + ".output_transitVehicles.xml.gz"); config.global().setCoordinateSystem("GK4"); config.plans().setInputFile(null); - config.parallelEventHandling().setNumberOfThreads(null); - config.parallelEventHandling().setEstimatedNumberOfEvents(null); + config.eventsManager().setNumberOfThreads(null); + config.eventsManager().setEstimatedNumberOfEvents(null); config.global().setNumberOfThreads(1); EmissionsConfigGroup eConfig = ConfigUtils.addOrGetModule(config, EmissionsConfigGroup.class); diff --git a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformationWithDrt.java b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformationWithDrt.java index 97a9a6af..c8bcd83c 100644 --- a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformationWithDrt.java +++ b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByEngineInformationWithDrt.java @@ -127,8 +127,8 @@ void run() throws IOException { config.transit().setVehiclesFile(runDirectory + runId + ".output_transitVehicles.xml.gz"); config.global().setCoordinateSystem("EPSG:31468"); config.plans().setInputFile(null); - config.parallelEventHandling().setNumberOfThreads(null); - config.parallelEventHandling().setEstimatedNumberOfEvents(null); + config.eventsManager().setNumberOfThreads(null); + config.eventsManager().setEstimatedNumberOfEvents(null); config.global().setNumberOfThreads(1); EmissionsConfigGroup eConfig = ConfigUtils.addOrGetModule(config, EmissionsConfigGroup.class); diff --git a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByVehicleCategory.java b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByVehicleCategory.java index 5ecd2e67..fb79a41f 100644 --- a/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByVehicleCategory.java +++ b/src/main/java/org/matsim/legacy/analysis/emissions/RunOfflineAirPollutionAnalysisByVehicleCategory.java @@ -96,8 +96,8 @@ void run() { config.transit().setVehiclesFile(runDirectory + runId + ".output_transitVehicles.xml.gz"); config.global().setCoordinateSystem("GK4"); config.plans().setInputFile(null); - config.parallelEventHandling().setNumberOfThreads(null); - config.parallelEventHandling().setEstimatedNumberOfEvents(null); + config.eventsManager().setNumberOfThreads(null); + config.eventsManager().setEstimatedNumberOfEvents(null); config.global().setNumberOfThreads(1); EmissionsConfigGroup eConfig = ConfigUtils.addOrGetModule(config, EmissionsConfigGroup.class); diff --git a/src/main/java/org/matsim/legacy/analysis/wasteCollection/RunAnalyse.java b/src/main/java/org/matsim/legacy/analysis/wasteCollection/RunAnalyse.java index 99121ba0..4f7c268b 100644 --- a/src/main/java/org/matsim/legacy/analysis/wasteCollection/RunAnalyse.java +++ b/src/main/java/org/matsim/legacy/analysis/wasteCollection/RunAnalyse.java @@ -23,10 +23,10 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Network; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.carrier.*; import org.matsim.core.network.NetworkUtils; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; +import org.matsim.freight.carriers.*; import java.io.BufferedWriter; import java.io.File; diff --git a/src/main/java/org/matsim/legacy/prepare/population/SplitActivityTypesBasedOnDuration.java b/src/main/java/org/matsim/legacy/prepare/population/SplitActivityTypesBasedOnDuration.java index be246a20..2f5b94e7 100644 --- a/src/main/java/org/matsim/legacy/prepare/population/SplitActivityTypesBasedOnDuration.java +++ b/src/main/java/org/matsim/legacy/prepare/population/SplitActivityTypesBasedOnDuration.java @@ -28,8 +28,9 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.ConfigWriter; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.TypicalDurationScoreComputation; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup.TypicalDurationScoreComputation; import org.matsim.core.population.io.PopulationWriter; import org.matsim.core.scenario.ScenarioUtils; @@ -104,11 +105,11 @@ public void run(String outputPopulationFile, String outputConfigFile, double tim } for (ActivityParams actParams : newActivityParams) { - scenario.getConfig().planCalcScore().addActivityParams(actParams); + scenario.getConfig().scoring().addActivityParams(actParams); } log.info("New activity parameters: "); - for (ActivityParams actParams : scenario.getConfig().planCalcScore().getActivityParams()) { + for (ActivityParams actParams : scenario.getConfig().scoring().getActivityParams()) { initialActivityParams.add(actParams); log.info(" -> " + actParams.getActivityType()); } diff --git a/src/main/java/org/matsim/legacy/prepare/transit/schedule/RunGTFS2MATSimOpenBerlin.java b/src/main/java/org/matsim/legacy/prepare/transit/schedule/RunGTFS2MATSimOpenBerlin.java index 847635fa..31f1c46a 100644 --- a/src/main/java/org/matsim/legacy/prepare/transit/schedule/RunGTFS2MATSimOpenBerlin.java +++ b/src/main/java/org/matsim/legacy/prepare/transit/schedule/RunGTFS2MATSimOpenBerlin.java @@ -397,9 +397,9 @@ private static void increaseLinkFreespeedIfLower(Link link, double newFreespeed) private static void runOneIteration(Scenario scenario, String outputDirectory) { new File(outputDirectory).mkdirs(); - scenario.getConfig().controler().setOutputDirectory(outputDirectory); - scenario.getConfig().controler().setLastIteration(0); - scenario.getConfig().controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + scenario.getConfig().controller().setOutputDirectory(outputDirectory); + scenario.getConfig().controller().setLastIteration(0); + scenario.getConfig().controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); scenario.getConfig().transit().setUseTransit(true); diff --git a/src/main/java/org/matsim/legacy/run/RunBerlinScenario.java b/src/main/java/org/matsim/legacy/run/RunBerlinScenario.java index 0d02ebae..18f63d9c 100644 --- a/src/main/java/org/matsim/legacy/run/RunBerlinScenario.java +++ b/src/main/java/org/matsim/legacy/run/RunBerlinScenario.java @@ -41,8 +41,8 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; +import org.matsim.core.config.groups.RoutingConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup.TrafficDynamics; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; @@ -67,7 +67,7 @@ import java.io.IOException; import java.util.*; -import static org.matsim.core.config.groups.ControlerConfigGroup.RoutingAlgorithmType.FastAStarLandmarks; +import static org.matsim.core.config.groups.ControllerConfigGroup.RoutingAlgorithmType.AStarLandmarks; /** * @author ikaddoura @@ -230,33 +230,33 @@ public static Config prepareConfig( RunDrtOpenBerlinScenario.AdditionalInformati final Config config = ConfigUtils.loadConfig( args[ 0 ], customModulesAll ); - config.controler().setRoutingAlgorithmType( FastAStarLandmarks ); + config.controller().setRoutingAlgorithmType( AStarLandmarks ); config.subtourModeChoice().setProbaForRandomSingleTripMode( 0.5 ); - config.plansCalcRoute().setRoutingRandomness( 3. ); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.ride); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.pt); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.bike); - config.plansCalcRoute().removeModeRoutingParams("undefined"); + config.routing().setRoutingRandomness( 3. ); + config.routing().removeModeRoutingParams(TransportMode.ride); + config.routing().removeModeRoutingParams(TransportMode.pt); + config.routing().removeModeRoutingParams(TransportMode.bike); + config.routing().removeModeRoutingParams("undefined"); config.qsim().setInsertingWaitingVehiclesBeforeDrivingVehicles( true ); // vsp defaults config.vspExperimental().setVspDefaultsCheckingLevel( VspExperimentalConfigGroup.VspDefaultsCheckingLevel.info ); - config.plansCalcRoute().setAccessEgressType(PlansCalcRouteConfigGroup.AccessEgressType.accessEgressModeToLink); + config.routing().setAccessEgressType(RoutingConfigGroup.AccessEgressType.accessEgressModeToLink); config.qsim().setUsingTravelTimeCheckInTeleportation( true ); config.qsim().setTrafficDynamics( TrafficDynamics.kinematicWaves ); // activities: for ( long ii = 600 ; ii <= 97200; ii+=600 ) { - config.planCalcScore().addActivityParams( new ActivityParams( "home_" + ii + ".0" ).setTypicalDuration( ii ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "work_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(6. * 3600. ).setClosingTime(20. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "leisure_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(9. * 3600. ).setClosingTime(27. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "shopping_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(8. * 3600. ).setClosingTime(20. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "other_" + ii + ".0" ).setTypicalDuration( ii ) ); + config.scoring().addActivityParams( new ActivityParams( "home_" + ii + ".0" ).setTypicalDuration( ii ) ); + config.scoring().addActivityParams( new ActivityParams( "work_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(6. * 3600. ).setClosingTime(20. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "leisure_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(9. * 3600. ).setClosingTime(27. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "shopping_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(8. * 3600. ).setClosingTime(20. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "other_" + ii + ".0" ).setTypicalDuration( ii ) ); } - config.planCalcScore().addActivityParams( new ActivityParams( "freight" ).setTypicalDuration( 12.*3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "freight" ).setTypicalDuration( 12.*3600. ) ); ConfigUtils.applyCommandline( config, typedArgs ) ; @@ -267,7 +267,7 @@ public static void runAnalysis(Controler controler) { Config config = controler.getConfig(); String modesString = ""; - for (String mode: config.planCalcScore().getAllModes()) { + for (String mode: config.scoring().getAllModes()) { modesString = modesString + mode + ","; } // remove last "," @@ -279,8 +279,8 @@ public static void runAnalysis(Controler controler) { } String[] args = new String[] { - config.controler().getOutputDirectory(), - config.controler().getRunId(), + config.controller().getOutputDirectory(), + config.controller().getRunId(), "null", // TODO: reference run, hard to automate "null", // TODO: reference run, hard to automate config.global().getCoordinateSystem(), diff --git a/src/main/java/org/matsim/legacy/run/accessibility/RunBerlinScenarioWithAccessibilities.java b/src/main/java/org/matsim/legacy/run/accessibility/RunBerlinScenarioWithAccessibilities.java index 47d9f037..82ae62b6 100644 --- a/src/main/java/org/matsim/legacy/run/accessibility/RunBerlinScenarioWithAccessibilities.java +++ b/src/main/java/org/matsim/legacy/run/accessibility/RunBerlinScenarioWithAccessibilities.java @@ -85,7 +85,7 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules Config config = RunBerlinScenario.prepareConfig(args, customModulesAll); - config.controler().setOutputDirectory("../../shared-svn/projects/accessibility-berlin/output/v4/5000_8h05_school/"); + config.controller().setOutputDirectory("../../shared-svn/projects/accessibility-berlin/output/v4/5000_8h05_school/"); File opportunitiesFile = new File("../../shared-svn/projects/accessibility-berlin/osm/berlin/amenities/2018-05-30/facilities_classified.xml"); config.facilities().setInputFile(opportunitiesFile.getAbsolutePath()); @@ -103,7 +103,7 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules acg.setComputingAccessibilityForMode(Modes4Accessibility.pt, true); acg.setOutputCrs(config.global().getCoordinateSystem()); - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); return config ; } @@ -145,7 +145,7 @@ private static void createQGisOutput(Config config) { final int populationThreshold = 0; String osName = System.getProperty("os.name"); - String workingDirectory = config.controler().getOutputDirectory(); + String workingDirectory = config.controller().getOutputDirectory(); for (String actType : activityTypes) { String actSpecificWorkingDirectory = workingDirectory + actType + "/"; for (Modes4Accessibility mode : ((AccessibilityConfigGroup) config.getModules().get(AccessibilityConfigGroup.GROUP_NAME)).getIsComputingMode()) { diff --git a/src/main/java/org/matsim/legacy/run/bicycle/RunBerlinScenarioWithBicycles.java b/src/main/java/org/matsim/legacy/run/bicycle/RunBerlinScenarioWithBicycles.java index 74681efc..36e87c65 100644 --- a/src/main/java/org/matsim/legacy/run/bicycle/RunBerlinScenarioWithBicycles.java +++ b/src/main/java/org/matsim/legacy/run/bicycle/RunBerlinScenarioWithBicycles.java @@ -23,7 +23,7 @@ import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; import org.matsim.contrib.bicycle.BicycleConfigGroup; -import org.matsim.contrib.bicycle.Bicycles; +import org.matsim.contrib.bicycle.BicycleModule; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigGroup; import org.matsim.core.controler.Controler; @@ -53,7 +53,9 @@ public static void main(String[] args) { public static Controler prepareControler( Scenario scenario ) { Controler controler = RunBerlinScenario.prepareControler( scenario ) ; - Bicycles.addAsOverridingModule(controler); + + // Add bicycle module + controler.addOverridingModule(new BicycleModule()); return controler; } @@ -76,10 +78,10 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules } Config config = RunBerlinScenario.prepareConfig( args, customModulesAll ) ; - config.plansCalcRoute().removeModeRoutingParams("bicycle"); + config.routing().removeModeRoutingParams("bicycle"); // - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); // return config ; diff --git a/src/main/java/org/matsim/legacy/run/drt/BerlinShpUtils.java b/src/main/java/org/matsim/legacy/run/drt/BerlinShpUtils.java index ef9aae48..eee1c92a 100644 --- a/src/main/java/org/matsim/legacy/run/drt/BerlinShpUtils.java +++ b/src/main/java/org/matsim/legacy/run/drt/BerlinShpUtils.java @@ -20,6 +20,7 @@ package org.matsim.legacy.run.drt; import java.io.IOException; +import java.io.UncheckedIOException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; @@ -38,7 +39,6 @@ import org.matsim.api.core.v01.Coord; import org.matsim.core.utils.geometry.geotools.MGC; import org.matsim.core.utils.gis.ShapeFileReader; -import org.matsim.core.utils.io.UncheckedIOException; import org.opengis.feature.simple.SimpleFeature; /** diff --git a/src/main/java/org/matsim/legacy/run/drt/KNVisOutputDrtOpenBerlinScenario.java b/src/main/java/org/matsim/legacy/run/drt/KNVisOutputDrtOpenBerlinScenario.java index f3cce098..4057dd27 100644 --- a/src/main/java/org/matsim/legacy/run/drt/KNVisOutputDrtOpenBerlinScenario.java +++ b/src/main/java/org/matsim/legacy/run/drt/KNVisOutputDrtOpenBerlinScenario.java @@ -31,7 +31,7 @@ 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.ScoringConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup.SnapshotStyle; import org.matsim.core.controler.Controler; @@ -67,18 +67,18 @@ public static void main(String[] args) { Config config = RunDrtOpenBerlinScenario.prepareConfig( RunDrtOpenBerlinScenario.AdditionalInformation.acceptUnknownParamsBerlinConfig, new String[] {base + runID + "/" + runID + ".output_config_reduced.xml"} ) ; - config.network().setInputFile( config.controler().getRunId() + ".output_network.xml.gz" ); + config.network().setInputFile( config.controller().getRunId() + ".output_network.xml.gz" ); - config.plans().setInputFile( config.controler().getRunId() + ".output_plans.xml.gz" ); + config.plans().setInputFile( config.controller().getRunId() + ".output_plans.xml.gz" ); // config.plans().setInputFile( "/Users/kainagel/git/berlin-matsim/popSel.xml.gz" ); - config.transit().setTransitScheduleFile( config.controler().getRunId() + ".output_transitSchedule.xml.gz" ); + config.transit().setTransitScheduleFile( config.controller().getRunId() + ".output_transitSchedule.xml.gz" ); config.global().setNumberOfThreads(6); - config.controler() + config.controller() .setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); final OTFVisConfigGroup otfVisConfigGroup = ConfigUtils.addOrGetModule(config, OTFVisConfigGroup.class); otfVisConfigGroup.setDrawTransitFacilityIds(false); @@ -91,7 +91,7 @@ public static void main(String[] args) { // drtCfg.addParameterSet(new DrtSpeedUpParams()); // } // } - for (final PlanCalcScoreConfigGroup.ActivityParams params : config.planCalcScore().getActivityParams()) { + for (final ScoringConfigGroup.ActivityParams params : config.scoring().getActivityParams()) { if (params.getActivityType().endsWith("interaction")) { params.setScoringThisActivityAtAll(false); } diff --git a/src/main/java/org/matsim/legacy/run/drt/RunDrtOpenBerlinScenario.java b/src/main/java/org/matsim/legacy/run/drt/RunDrtOpenBerlinScenario.java index e2aff3d7..d67be07a 100644 --- a/src/main/java/org/matsim/legacy/run/drt/RunDrtOpenBerlinScenario.java +++ b/src/main/java/org/matsim/legacy/run/drt/RunDrtOpenBerlinScenario.java @@ -169,7 +169,7 @@ public static Config prepareConfig( AdditionalInformation additionalInformation, Config config = RunBerlinScenario.prepareConfig( additionalInformation, args, customModulesAll ) ; - DrtConfigs.adjustMultiModeDrtConfig(MultiModeDrtConfigGroup.get(config), config.planCalcScore(), config.plansCalcRoute()); + DrtConfigs.adjustMultiModeDrtConfig(MultiModeDrtConfigGroup.get(config), config.scoring(), config.routing()); return config ; } diff --git a/src/main/java/org/matsim/legacy/run/dynamicShutdown/DynamicShutdownControlerListenerImpl.java b/src/main/java/org/matsim/legacy/run/dynamicShutdown/DynamicShutdownControlerListenerImpl.java index e2e3c405..85966f3e 100644 --- a/src/main/java/org/matsim/legacy/run/dynamicShutdown/DynamicShutdownControlerListenerImpl.java +++ b/src/main/java/org/matsim/legacy/run/dynamicShutdown/DynamicShutdownControlerListenerImpl.java @@ -8,9 +8,9 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; -import org.matsim.core.config.groups.ControlerConfigGroup; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup; +import org.matsim.core.config.groups.ControllerConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.controler.events.IterationStartsEvent; import org.matsim.core.controler.events.ShutdownEvent; @@ -23,11 +23,11 @@ import org.matsim.core.replanning.ReplanningUtils; import org.matsim.core.replanning.StrategyManager; import org.matsim.core.utils.io.IOUtils; -import org.matsim.core.utils.io.UncheckedIOException; import javax.inject.Inject; import java.io.BufferedWriter; import java.io.IOException; +import java.io.UncheckedIOException; import java.util.*; /** @@ -46,10 +46,10 @@ public class DynamicShutdownControlerListenerImpl implements IterationStartsList private static final Logger log = LogManager.getLogger(StrategyManager.class); - private final ControlerConfigGroup controlerConfigGroup; + private final ControllerConfigGroup controlerConfigGroup; private final ScoreStats scoreStats; - private final PlanCalcScoreConfigGroup scoreConfig; - private final StrategyConfigGroup strategyConfigGroup; + private final ScoringConfigGroup scoreConfig; + private final ReplanningConfigGroup strategyConfigGroup; private final ModeStatsControlerListener modeStatsControlerListener; private final ModeChoiceCoverageControlerListener modeChoiceCoverageControlerListener; private final Scenario scenario; @@ -77,10 +77,10 @@ public class DynamicShutdownControlerListenerImpl implements IterationStartsList private List activeMetricsModeCC = new ArrayList<>(); @Inject - DynamicShutdownControlerListenerImpl(ControlerConfigGroup controlerConfigGroup, ScoreStats scoreStats, + DynamicShutdownControlerListenerImpl(ControllerConfigGroup controlerConfigGroup, ScoreStats scoreStats, ModeStatsControlerListener modeStatsControlerListener, StrategyManager strategyManager, - StrategyConfigGroup strategyConfigGroup, Scenario scenario, OutputDirectoryHierarchy controlerIO, - PlanCalcScoreConfigGroup scoreConfig, + ReplanningConfigGroup strategyConfigGroup, Scenario scenario, OutputDirectoryHierarchy controlerIO, + ScoringConfigGroup scoreConfig, ModeChoiceCoverageControlerListener modeChoiceCoverageControlerListener) { this.scenario = scenario; @@ -411,7 +411,7 @@ private void shutdownInnovation(int iteration) { Set subpopulations = new HashSet<>(); - for (StrategyConfigGroup.StrategySettings setting : this.scenario.getConfig().strategy().getStrategySettings()) { + for (ReplanningConfigGroup.StrategySettings setting : this.scenario.getConfig().replanning().getStrategySettings()) { subpopulations.add(setting.getSubpopulation()); if (subpopulations.size() == 0) subpopulations.add(null); } @@ -436,7 +436,7 @@ private void shutdownInnovation(int iteration) { } } - private void generateMetricLists(PlanCalcScoreConfigGroup scoreConfig) { + private void generateMetricLists(ScoringConfigGroup scoreConfig) { switch (cfg.getScorePolicyChosen()) { case ON_FULL: activeMetricsScore = new ArrayList<>(Arrays.asList( diff --git a/src/main/java/org/matsim/legacy/run/dynamicShutdown/ModeChoiceCoverageControlerListener.java b/src/main/java/org/matsim/legacy/run/dynamicShutdown/ModeChoiceCoverageControlerListener.java index 14a1b5e5..aa884d43 100644 --- a/src/main/java/org/matsim/legacy/run/dynamicShutdown/ModeChoiceCoverageControlerListener.java +++ b/src/main/java/org/matsim/legacy/run/dynamicShutdown/ModeChoiceCoverageControlerListener.java @@ -6,8 +6,8 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.api.core.v01.population.Plan; import org.matsim.api.core.v01.population.Population; -import org.matsim.core.config.groups.ControlerConfigGroup; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ControllerConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.controler.events.IterationEndsEvent; import org.matsim.core.controler.events.ShutdownEvent; @@ -47,7 +47,7 @@ public class ModeChoiceCoverageControlerListener implements StartupListener, Ite private final Population population; private final String modeFileName; private final boolean createPNG; - private final ControlerConfigGroup controlerConfigGroup; + private final ControllerConfigGroup controlerConfigGroup; private final MainModeIdentifier mainModeIdentifier; private int minIteration = 0; @@ -66,8 +66,8 @@ public class ModeChoiceCoverageControlerListener implements StartupListener, Ite @Inject - ModeChoiceCoverageControlerListener(ControlerConfigGroup controlerConfigGroup, Population population1, OutputDirectoryHierarchy controlerIO, - PlanCalcScoreConfigGroup scoreConfig, AnalysisMainModeIdentifier mainModeIdentifier) { + ModeChoiceCoverageControlerListener(ControllerConfigGroup controlerConfigGroup, Population population1, OutputDirectoryHierarchy controlerIO, + ScoringConfigGroup scoreConfig, AnalysisMainModeIdentifier mainModeIdentifier) { this.controlerConfigGroup = controlerConfigGroup; this.population = population1; diff --git a/src/main/java/org/matsim/legacy/run/dynamicShutdown/TerminateDynamically.java b/src/main/java/org/matsim/legacy/run/dynamicShutdown/TerminateDynamically.java index 9c6bd4b9..9f414cbf 100644 --- a/src/main/java/org/matsim/legacy/run/dynamicShutdown/TerminateDynamically.java +++ b/src/main/java/org/matsim/legacy/run/dynamicShutdown/TerminateDynamically.java @@ -21,7 +21,7 @@ package org.matsim.legacy.run.dynamicShutdown; -import org.matsim.core.config.groups.ControlerConfigGroup; +import org.matsim.core.config.groups.ControllerConfigGroup; import org.matsim.core.controler.TerminationCriterion; import javax.inject.Inject; @@ -39,7 +39,7 @@ public class TerminateDynamically implements TerminationCriterion { private final DynamicShutdownControlerListenerImpl convergenceDynamicShutdown; @Inject - TerminateDynamically(ControlerConfigGroup controlerConfigGroup, DynamicShutdownControlerListenerImpl convergenceDynamicShutdown) { + TerminateDynamically(ControllerConfigGroup controlerConfigGroup, DynamicShutdownControlerListenerImpl convergenceDynamicShutdown) { this.lastIteration = controlerConfigGroup.getLastIteration(); this.convergenceDynamicShutdown = convergenceDynamicShutdown; } diff --git a/src/main/java/org/matsim/legacy/run/ptdisturbances/RunPtDisturbancesBerlin.java b/src/main/java/org/matsim/legacy/run/ptdisturbances/RunPtDisturbancesBerlin.java index c9d6ccee..c9b628c3 100644 --- a/src/main/java/org/matsim/legacy/run/ptdisturbances/RunPtDisturbancesBerlin.java +++ b/src/main/java/org/matsim/legacy/run/ptdisturbances/RunPtDisturbancesBerlin.java @@ -19,7 +19,7 @@ package org.matsim.legacy.run.ptdisturbances; -import static org.matsim.core.config.groups.ControlerConfigGroup.RoutingAlgorithmType.FastAStarLandmarks; +import static org.matsim.core.config.groups.ControllerConfigGroup.RoutingAlgorithmType.AStarLandmarks; import java.util.ArrayList; import java.util.Arrays; @@ -43,8 +43,9 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup.ActivityParams; -import org.matsim.core.config.groups.PlansCalcRouteConfigGroup; +import org.matsim.core.config.groups.RoutingConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup.ActivityParams; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.config.groups.QSimConfigGroup.TrafficDynamics; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; @@ -304,47 +305,47 @@ public static Config prepareConfig( String [] args, ConfigGroup... customModules final Config config = ConfigUtils.loadConfig( args[ 0 ], customModules ); // I need this to set the context - config.controler().setRoutingAlgorithmType( FastAStarLandmarks ); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - config.controler().setLastIteration(0); + config.controller().setRoutingAlgorithmType( AStarLandmarks ); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setLastIteration(0); config.transit().setBoardingAcceptance( TransitConfigGroup.BoardingAcceptance.checkStopOnly ); config.subtourModeChoice().setProbaForRandomSingleTripMode( 0.5 ); - config.plansCalcRoute().setRoutingRandomness( 3. ); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.ride); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.pt); - config.plansCalcRoute().removeModeRoutingParams(TransportMode.bike); - config.plansCalcRoute().removeModeRoutingParams("undefined"); + config.routing().setRoutingRandomness( 3. ); + config.routing().removeModeRoutingParams(TransportMode.ride); + config.routing().removeModeRoutingParams(TransportMode.pt); + config.routing().removeModeRoutingParams(TransportMode.bike); + config.routing().removeModeRoutingParams("undefined"); config.network().setTimeVariantNetwork(true); // TransportMode.non_network_walk has no longer a default, // in the long run: copy from walk; for now: use the parameter set given in the config (for backward compatibility) -// ModeRoutingParams walkRoutingParams = config.plansCalcRoute().getOrCreateModeRoutingParams(TransportMode.walk); +// ModeRoutingParams walkRoutingParams = config.routing().getOrCreateModeRoutingParams(TransportMode.walk); // ModeRoutingParams non_network_walk_routingParams = new ModeRoutingParams(TransportMode.non_network_walk); // non_network_walk_routingParams.setBeelineDistanceFactor(walkRoutingParams.getBeelineDistanceFactor()); // non_network_walk_routingParams.setTeleportedModeSpeed(walkRoutingParams.getTeleportedModeSpeed()); -// config.plansCalcRoute().addModeRoutingParams(non_network_walk_routingParams); +// config.routing().addModeRoutingParams(non_network_walk_routingParams); config.qsim().setInsertingWaitingVehiclesBeforeDrivingVehicles( true ); // vsp defaults config.vspExperimental().setVspDefaultsCheckingLevel( VspExperimentalConfigGroup.VspDefaultsCheckingLevel.info ); - config.plansCalcRoute().setAccessEgressType(PlansCalcRouteConfigGroup.AccessEgressType.accessEgressModeToLink); + config.routing().setAccessEgressType(RoutingConfigGroup.AccessEgressType.accessEgressModeToLink); config.qsim().setUsingTravelTimeCheckInTeleportation( true ); config.qsim().setTrafficDynamics( TrafficDynamics.kinematicWaves ); // activities: for ( long ii = 600 ; ii <= 97200; ii+=600 ) { - config.planCalcScore().addActivityParams( new ActivityParams( "home_" + ii + ".0" ).setTypicalDuration( ii ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "work_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(6. * 3600. ).setClosingTime(20. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "leisure_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(9. * 3600. ).setClosingTime(27. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "shopping_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(8. * 3600. ).setClosingTime(20. * 3600. ) ); - config.planCalcScore().addActivityParams( new ActivityParams( "other_" + ii + ".0" ).setTypicalDuration( ii ) ); + config.scoring().addActivityParams( new ActivityParams( "home_" + ii + ".0" ).setTypicalDuration( ii ) ); + config.scoring().addActivityParams( new ActivityParams( "work_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(6. * 3600. ).setClosingTime(20. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "leisure_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(9. * 3600. ).setClosingTime(27. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "shopping_" + ii + ".0" ).setTypicalDuration( ii ).setOpeningTime(8. * 3600. ).setClosingTime(20. * 3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "other_" + ii + ".0" ).setTypicalDuration( ii ) ); } - config.planCalcScore().addActivityParams( new ActivityParams( "freight" ).setTypicalDuration( 12.*3600. ) ); + config.scoring().addActivityParams( new ActivityParams( "freight" ).setTypicalDuration( 12.*3600. ) ); ConfigUtils.applyCommandline( config, typedArgs ) ; diff --git a/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallChessboardUtils.java b/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallChessboardUtils.java index 4d0c6eb9..c17636a1 100644 --- a/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallChessboardUtils.java +++ b/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallChessboardUtils.java @@ -3,18 +3,12 @@ import java.util.HashMap; import java.util.Map; +import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierCapabilities; -import org.matsim.contrib.freight.carrier.CarrierVehicle; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypeLoader; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; +import org.matsim.freight.carriers.*; import org.matsim.vehicles.Vehicle; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.carrier.CarrierImpl; public class AbfallChessboardUtils { @@ -42,10 +36,11 @@ static void createShipmentsForChessboardI(HashMap carrierMap, i } } Id linkDumpId = Id.createLinkId(linkChessboardDump); - AbfallUtils.createShipmentsForCarrierII(garbageToCollect, volumeBigDustbin, serviceTimePerBigTrashcan, - distanceWithShipments, garbageLinks, scenario, carrierChessboard, linkDumpId, carriers); - AbfallUtils.districtsWithShipments.add("Chessboard"); - carriers.addCarrier(carrierChessboard); + throw new UnsupportedOperationException("These lines below have not been updated to the new API."); +// AbfallUtils.createShipmentsForCarrierII(garbageToCollect, volumeBigDustbin, serviceTimePerBigTrashcan, +// distanceWithShipments, garbageLinks, scenario, carrierChessboard, linkDumpId ); +// AbfallUtils.districtsWithShipments.add("Chessboard"); +// carriers.addCarrier(carrierChessboard); } @@ -70,10 +65,11 @@ static void createShipmentsForChessboardII(HashMap carrierMap, } } Id linkDumpId = Id.createLinkId(linkChessboardDump); - AbfallUtils.createShipmentsForCarrierI(garbagePerMeterToCollect, volumeBigDustbin, serviceTimePerBigTrashcan, - garbageLinks, scenario, carrierChessboard, linkDumpId, carriers); - AbfallUtils.districtsWithShipments.add("Chessboard"); - carriers.addCarrier(carrierChessboard); + throw new UnsupportedOperationException("These lines below have not been updated to the new API."); +// AbfallUtils.createShipmentsForCarrierI(garbagePerMeterToCollect, volumeBigDustbin, serviceTimePerBigTrashcan, +// garbageLinks, scenario, carrierChessboard, linkDumpId, carriers); +// AbfallUtils.districtsWithShipments.add("Chessboard"); +// carriers.addCarrier(carrierChessboard); } @@ -83,7 +79,7 @@ static void createShipmentsForChessboardII(HashMap carrierMap, * * @param */ - static void createCarriersForChessboard(Carriers carriers, FleetSize fleetSize, CarrierVehicleTypes carrierVehicleTypes) { + static void createCarriersForChessboard(Carriers carriers, CarrierCapabilities.FleetSize fleetSize, CarrierVehicleTypes carrierVehicleTypes) { String vehicleName = "TruckChessboard"; double earliestStartingTime = 6 * 3600; double latestFinishingTime = 14 * 3600; @@ -98,7 +94,8 @@ static void createCarriersForChessboard(Carriers carriers, FleetSize fleetSize, // define Carriers - defineCarriersChessboard(carriers, newCarrierVehicle, fleetSize, carrierVehicleTypes); + throw new UnsupportedOperationException("These lines below have not been updated to the new API."); +// defineCarriersChessboard(carriers, newCarrierVehicle, fleetSize, carrierVehicleTypes); } /** @@ -108,7 +105,7 @@ static void createCarriersForChessboard(Carriers carriers, FleetSize fleetSize, * @param * */ - private static void defineCarriersChessboard(Carriers carriers, CarrierVehicle vehicleDepot, FleetSize fleetSize, CarrierVehicleTypes carrierVehicleTypes) { + private static void defineCarriersChessboard(Carriers carriers, CarrierVehicle vehicleDepot, CarrierCapabilities.FleetSize fleetSize, CarrierVehicleTypes carrierVehicleTypes) { CarrierCapabilities carrierCapabilities = CarrierCapabilities.Builder.newInstance() .addType(carrierVehicleTypes.getVehicleTypes().values().iterator().next()).addVehicle(vehicleDepot).setFleetSize(fleetSize).build(); diff --git a/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallUtils.java b/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallUtils.java index 4922742a..b20aabbf 100644 --- a/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallUtils.java +++ b/src/main/java/org/matsim/legacy/run/wasteCollection/AbfallUtils.java @@ -21,30 +21,11 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; +import org.matsim.api.core.v01.population.Leg; import org.matsim.api.core.v01.population.Person; -import org.matsim.contrib.freight.FreightConfigGroup; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierPlan; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlWriterV2; -import org.matsim.contrib.freight.carrier.CarrierShipment; -import org.matsim.contrib.freight.carrier.CarrierUtils; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.carrier.ScheduledTour; -import org.matsim.contrib.freight.carrier.TimeWindow; -import org.matsim.contrib.freight.carrier.Tour; -import org.matsim.contrib.freight.carrier.Tour.Delivery; -import org.matsim.contrib.freight.carrier.Tour.Leg; -import org.matsim.contrib.freight.carrier.Tour.Pickup; -import org.matsim.contrib.freight.carrier.Tour.TourElement; -import org.matsim.contrib.freight.controler.CarrierModule; -import org.matsim.contrib.freight.jsprit.MatsimJspritFactory; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts; -import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts.Builder; -import org.matsim.contrib.freight.jsprit.NetworkRouter; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.config.groups.ControlerConfigGroup; +import org.matsim.core.config.groups.ControllerConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; @@ -53,6 +34,12 @@ import org.matsim.core.population.routes.RouteUtils; import org.matsim.core.utils.geometry.geotools.MGC; import org.matsim.core.utils.geometry.transformations.TransformationFactory; +import org.matsim.freight.carriers.*; +import org.matsim.freight.carriers.Tour.TourElement; +import org.matsim.freight.carriers.controler.CarrierModule; +import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; +import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; +import org.matsim.freight.carriers.jsprit.NetworkRouter; import org.matsim.vehicles.VehicleType; import org.opengis.feature.simple.SimpleFeature; @@ -178,21 +165,21 @@ static HashMap> createDumpMap() { * */ static Config prepareConfig(Config config, int lastIteration, String inputVehicleTypes, String inputCarriers) { - config.controler().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); - new OutputDirectoryHierarchy(config.controler().getOutputDirectory(), config.controler().getRunId(), - config.controler().getOverwriteFileSetting(), ControlerConfigGroup.CompressionType.gzip); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); + new OutputDirectoryHierarchy(config.controller().getOutputDirectory(), config.controller().getRunId(), + config.controller().getOverwriteFileSetting(), ControllerConfigGroup.CompressionType.gzip); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); - config.controler().setLastIteration(lastIteration); + config.controller().setLastIteration(lastIteration); matsimIterations = lastIteration + 1; config.global().setRandomSeed(4177); - config.controler().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); + config.controller().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); config.global().setCoordinateSystem(TransformationFactory.GK4); - FreightConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule(config, FreightConfigGroup.class); + FreightCarriersConfigGroup freightConfigGroup = ConfigUtils.addOrGetModule(config, FreightCarriersConfigGroup.class); freightConfigGroup.setCarriersFile(inputCarriers); freightConfigGroup.setCarriersVehicleTypesFile(inputVehicleTypes); freightConfigGroup.setTravelTimeSliceWidth(1800); - freightConfigGroup.setTimeWindowHandling(FreightConfigGroup.TimeWindowHandling.enforceBeginnings); + freightConfigGroup.setTimeWindowHandling(FreightCarriersConfigGroup.TimeWindowHandling.enforceBeginnings); return config; } @@ -461,7 +448,7 @@ static void createShipmentsForSelectedDay(Collection districtsWit } private static Carrier createSingleCarrier(String depot, HashMap carrierMap, String district) { - Carrier newCarrier = CarrierUtils.createCarrier(Id.create("Carrier " + district, Carrier.class)); + Carrier newCarrier = CarriersUtils.createCarrier(Id.create("Carrier " + district, Carrier.class)); for (Carrier originalCarrier : carrierMap.values()) { if (originalCarrier.getId().toString().contains(depot)) { newCarrier.getCarrierCapabilities() @@ -584,7 +571,7 @@ static void solveWithJsprit(Scenario scenario, Carriers carriers, HashMap districtsWithGarbage, Scenar sizeTour = 0; List elements = scheduledTour.getTour().getTourElements(); for (TourElement element : elements) { - if (element instanceof Pickup pickupElement) { + if (element instanceof Tour.Pickup pickupElement) { String pickupShipmentId = pickupElement.getShipment().getId().toString(); if (scheduledTour.getVehicle().getId().toString().contains("TruckForckenbeck")) { sizeForckenbeck = sizeForckenbeck + (shipmentSizes.get(pickupShipmentId)); @@ -829,7 +816,7 @@ static void outputSummary(Collection districtsWithGarbage, Scenar sizeTour = sizeTour + (shipmentSizes.get(pickupShipmentId)); } } - if (element instanceof Delivery deliveryElement) { + if (element instanceof Tour.Delivery deliveryElement) { String deliveryShipmentId = deliveryElement.getShipment().getId().toString(); if (deliveryElement.getLocation() == Id.createLinkId(linkMhkwRuhleben)) { sizeRuhleben = sizeRuhleben + (shipmentSizes.get(deliveryShipmentId)); @@ -851,7 +838,7 @@ static void outputSummary(Collection districtsWithGarbage, Scenar sizeChessboardDelivery = sizeChessboardDelivery + (shipmentSizes.get(deliveryShipmentId)); } } - if (element instanceof Leg legElement) { + if (element instanceof Tour.Leg legElement) { if (legElement.getRoute().getDistance() != 0) distanceTour = distanceTour + RouteUtils.calcDistance((NetworkRoute) legElement.getRoute(), 0, 0, scenario.getNetwork()); @@ -989,7 +976,7 @@ static void outputSummary(Collection districtsWithGarbage, Scenar FileWriter writer; File file; - file = new File(scenario.getConfig().controler().getOutputDirectory() + "/01_Zusammenfassung.txt"); + file = new File(scenario.getConfig().controller().getOutputDirectory() + "/01_Zusammenfassung.txt"); try { writer = new FileWriter(file, true); if (day != null) { @@ -1145,7 +1132,7 @@ static void outputSummaryShipments(Scenario scenario, String day, HashMap elements = scheduledTour.getTour().getTourElements(); - for (Tour.TourElement element : elements) { + List elements = scheduledTour.getTour().getTourElements(); + for (TourElement element : elements) { if (element instanceof Tour.Pickup) { numCollections++; diff --git a/src/main/java/org/matsim/legacy/run/wasteCollection/Run_Abfall.java b/src/main/java/org/matsim/legacy/run/wasteCollection/Run_Abfall.java index 24a9b8bf..e5b06334 100644 --- a/src/main/java/org/matsim/legacy/run/wasteCollection/Run_Abfall.java +++ b/src/main/java/org/matsim/legacy/run/wasteCollection/Run_Abfall.java @@ -11,17 +11,12 @@ import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; -import org.matsim.contrib.freight.carrier.Carrier; -import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize; -import org.matsim.contrib.freight.carrier.CarrierPlanXmlWriterV2; -import org.matsim.contrib.freight.carrier.CarrierVehicleTypes; -import org.matsim.contrib.freight.carrier.Carriers; -import org.matsim.contrib.freight.controler.FreightUtils; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.controler.Controler; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.gis.ShapeFileReader; +import org.matsim.freight.carriers.*; import org.opengis.feature.simple.SimpleFeature; /** @@ -116,12 +111,12 @@ public static void main(String[] args) throws Exception { switch (netzwerkWahl) { case originalChessboard: - config.controler().setOutputDirectory("output/original_Chessboard/04_Distances"); + config.controller().setOutputDirectory("output/original_Chessboard/04_Distances"); config.network().setInputFile(original_Chessboard); break; case berlinNetwork: // Berlin scenario network - config.controler().setOutputDirectory(outputLocation); + config.controller().setOutputDirectory(outputLocation); config.network().setInputFile(berlin); if (networkChangeEventsFileLocation != "") { log.info("Setting networkChangeEventsInput file: " + networkChangeEventsFileLocation); @@ -152,10 +147,10 @@ public static void main(String[] args) throws Exception { } config = AbfallUtils.prepareConfig(config, 0, vehicleTypesFileLocation, carriersFileLocation); Scenario scenario = ScenarioUtils.loadScenario(config); - FreightUtils.loadCarriersAccordingToFreightConfig(scenario); + CarriersUtils.loadCarriersAccordingToFreightConfig(scenario); // creates carrier - Carriers carriers = FreightUtils.addOrGetCarriers(scenario); + Carriers carriers = CarriersUtils.addOrGetCarriers(scenario); HashMap carrierMap = AbfallUtils.createCarrier(carriers); Map, ? extends Link> allLinks = scenario.getNetwork().getLinks(); @@ -168,18 +163,18 @@ public static void main(String[] args) throws Exception { switch (scenarioWahl) { case chessboardTotalGarbageToCollect: int kgGarbageToCollect = 12 * 1000; - CarrierVehicleTypes carrierVehicleTypes = FreightUtils.getCarrierVehicleTypes(scenario); + CarrierVehicleTypes carrierVehicleTypes = CarriersUtils.getCarrierVehicleTypes(scenario); AbfallChessboardUtils.createShipmentsForChessboardI(carrierMap, kgGarbageToCollect, allLinks, volumeDustbinInLiters, secondsServiceTimePerDustbin, scenario, carriers); - FleetSize fleetSize = FleetSize.INFINITE; + CarrierCapabilities.FleetSize fleetSize = CarrierCapabilities.FleetSize.INFINITE; AbfallChessboardUtils.createCarriersForChessboard(carriers, fleetSize, carrierVehicleTypes); break; case chessboardGarbagePerMeterToCollect: double kgGarbagePerMeterToCollect = 0.2; - CarrierVehicleTypes carrierVehicleTypes2 = FreightUtils.getCarrierVehicleTypes(scenario); + CarrierVehicleTypes carrierVehicleTypes2 = CarriersUtils.getCarrierVehicleTypes(scenario); AbfallChessboardUtils.createShipmentsForChessboardII(carrierMap, kgGarbagePerMeterToCollect, allLinks, volumeDustbinInLiters, secondsServiceTimePerDustbin, scenario, carriers); - FleetSize fleetSize2 = FleetSize.INFINITE; + CarrierCapabilities.FleetSize fleetSize2 = CarrierCapabilities.FleetSize.INFINITE; AbfallChessboardUtils.createCarriersForChessboard(carriers, fleetSize2, carrierVehicleTypes2); break; case berlinSelectedDistricts: @@ -236,7 +231,7 @@ public static void main(String[] args) throws Exception { controler.run(); new CarrierPlanXmlWriterV2(carriers) - .write(scenario.getConfig().controler().getOutputDirectory() + "/output_CarrierPlans.xml"); + .write(scenario.getConfig().controller().getOutputDirectory() + "/output_CarrierPlans.xml"); AbfallUtils.outputSummary(districtsWithGarbage, scenario, carrierMap, day, volumeDustbinInLiters, secondsServiceTimePerDustbin); diff --git a/src/main/java/org/matsim/prepare/RunOpenBerlinCalibration.java b/src/main/java/org/matsim/prepare/RunOpenBerlinCalibration.java index 92a5049e..67ba103b 100644 --- a/src/main/java/org/matsim/prepare/RunOpenBerlinCalibration.java +++ b/src/main/java/org/matsim/prepare/RunOpenBerlinCalibration.java @@ -25,8 +25,8 @@ 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.PlanCalcScoreConfigGroup; -import org.matsim.core.config.groups.StrategyConfigGroup; +import org.matsim.core.config.groups.ReplanningConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; @@ -141,13 +141,13 @@ protected Config prepareConfig(Config config) { throw new IllegalArgumentException("Population path is required [--population]"); } - config.controler().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); + config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists); log.info("Running {} calibration {}", mode, populationPath); config.plans().setInputFile(populationPath.toString()); - config.controler().setRunId(mode.toString()); - config.planCalcScore().setWriteExperiencedPlans(true); + config.controller().setRunId(mode.toString()); + config.scoring().setWriteExperiencedPlans(true); // Location choice does not work with the split types Activities.addScoringParams(config, mode != CalibrationMode.locationChoice); @@ -181,8 +181,8 @@ protected Config prepareConfig(Config config) { // Required for all calibration strategies for (String subpopulation : List.of("person", "commercialPersonTraffic", "commercialPersonTraffic_service")) { - config.strategy().addStrategySettings( - new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings( + new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultSelector.ChangeExpBeta) .setWeight(1.0) .setSubpopulation(subpopulation) @@ -194,26 +194,26 @@ protected Config prepareConfig(Config config) { if (mode == CalibrationMode.locationChoice) { - config.strategy().addStrategySettings(new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings(new ReplanningConfigGroup.StrategySettings() .setStrategyName(FrozenTastes.LOCATION_CHOICE_PLAN_STRATEGY) .setWeight(weight) .setSubpopulation("person") ); - config.strategy().addStrategySettings(new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings(new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute) .setWeight(weight / 5) .setSubpopulation("person") ); // Overwrite these to fix scoring warnings - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("work").setTypicalDuration(8 * 3600)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("pt interaction").setTypicalDuration(30)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("work").setTypicalDuration(8 * 3600)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("pt interaction").setTypicalDuration(30)); config.vspExperimental().setAbleToOverwritePtInteractionParams(true); - config.strategy().setFractionOfIterationsToDisableInnovation(0.8); - config.planCalcScore().setFractionOfIterationsToStartScoreMSA(0.8); + config.replanning().setFractionOfIterationsToDisableInnovation(0.8); + config.scoring().setFractionOfIterationsToStartScoreMSA(0.8); FrozenTastesConfigGroup dccg = ConfigUtils.addOrGetModule(config, FrozenTastesConfigGroup.class); @@ -228,20 +228,20 @@ protected Config prepareConfig(Config config) { // Re-route for all populations for (String subpopulation : List.of("person", "commercialPersonTraffic", "commercialPersonTraffic_service")) { - config.strategy().addStrategySettings(new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings(new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute) .setWeight(weight) .setSubpopulation(subpopulation) ); } - config.controler().setRunId("cadyts"); - config.controler().setOutputDirectory("./output/cadyts-" + scaleFactor); + config.controller().setRunId("cadyts"); + config.controller().setOutputDirectory("./output/cadyts-" + scaleFactor); - config.planCalcScore().setFractionOfIterationsToStartScoreMSA(0.75); - config.strategy().setFractionOfIterationsToDisableInnovation(0.75); + config.scoring().setFractionOfIterationsToStartScoreMSA(0.75); + config.replanning().setFractionOfIterationsToDisableInnovation(0.75); // Need to store more plans because of plan types - config.strategy().setMaxAgentPlanMemorySize(8); + config.replanning().setMaxAgentPlanMemorySize(8); config.vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.ignore); @@ -249,7 +249,7 @@ protected Config prepareConfig(Config config) { // Re-route for all populations for (String subpopulation : List.of("person", "commercialPersonTraffic", "commercialPersonTraffic_service")) { - config.strategy().addStrategySettings(new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings(new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute) .setWeight(weight) .setSubpopulation(subpopulation) @@ -259,7 +259,7 @@ protected Config prepareConfig(Config config) { } else if (mode == CalibrationMode.eval) { iterations = 0; - config.controler().setLastIteration(0); + config.controller().setLastIteration(0); } else throw new IllegalStateException("Mode not implemented:" + mode); @@ -378,7 +378,7 @@ public ScoringFunction createNewScoringFunction(Person person) { sumScoringFunction.addScoringFunction(new CharyparNagelAgentStuckScoring(params)); final CadytsScoring scoringFunction = new CadytsScoring<>(person.getSelectedPlan(), config, cadytsContext); - scoringFunction.setWeightOfCadytsCorrection(30 * config.planCalcScore().getBrainExpBeta()); + scoringFunction.setWeightOfCadytsCorrection(30 * config.scoring().getBrainExpBeta()); sumScoringFunction.addScoringFunction(scoringFunction); return sumScoringFunction; diff --git a/src/main/java/org/matsim/prepare/network/FreeSpeedOptimizer.java b/src/main/java/org/matsim/prepare/network/FreeSpeedOptimizer.java index e4008b38..4a2e7737 100644 --- a/src/main/java/org/matsim/prepare/network/FreeSpeedOptimizer.java +++ b/src/main/java/org/matsim/prepare/network/FreeSpeedOptimizer.java @@ -33,7 +33,7 @@ import org.matsim.application.options.InputOptions; import org.matsim.contrib.osm.networkReader.LinkProperties; import org.matsim.core.network.NetworkUtils; -import org.matsim.core.router.FastDijkstraFactory; +import org.matsim.core.router.DijkstraFactory; import org.matsim.core.router.costcalculators.OnlyTimeDependentTravelDisutility; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.trafficmonitoring.FreeSpeedTravelTime; @@ -189,7 +189,7 @@ private Result evaluateNetwork(Request request, String save) throws IOException FreeSpeedTravelTime tt = new FreeSpeedTravelTime(); OnlyTimeDependentTravelDisutility util = new OnlyTimeDependentTravelDisutility(tt); - LeastCostPathCalculator router = new FastDijkstraFactory(false).createPathCalculator(network, util, tt); + LeastCostPathCalculator router = new DijkstraFactory(false).createPathCalculator(network, util, tt); SummaryStatistics rmse = new SummaryStatistics(); SummaryStatistics mse = new SummaryStatistics(); diff --git a/src/main/java/org/matsim/prepare/network/SampleNetwork.java b/src/main/java/org/matsim/prepare/network/SampleNetwork.java index aad34aaf..a3725d76 100644 --- a/src/main/java/org/matsim/prepare/network/SampleNetwork.java +++ b/src/main/java/org/matsim/prepare/network/SampleNetwork.java @@ -22,7 +22,7 @@ import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.algorithms.MultimodalNetworkCleaner; import org.matsim.core.network.filter.NetworkFilterManager; -import org.matsim.core.router.FastDijkstraFactory; +import org.matsim.core.router.DijkstraFactory; import org.matsim.core.router.costcalculators.OnlyTimeDependentTravelDisutility; import org.matsim.core.router.util.LeastCostPathCalculator; import org.matsim.core.router.util.TravelTime; @@ -260,7 +260,7 @@ private Network createCityNetwork(Network network) { private LeastCostPathCalculator createRandomizedRouter(Network network, TravelTime tt) { OnlyTimeDependentTravelDisutility util = new OnlyTimeDependentTravelDisutility(tt); - return new FastDijkstraFactory(false).createPathCalculator(network, util, tt); + return new DijkstraFactory(false).createPathCalculator(network, util, tt); } private static final class RandomizedTravelTime implements TravelTime { diff --git a/src/main/java/org/matsim/run/Activities.java b/src/main/java/org/matsim/run/Activities.java index 22c0e296..b8fba85a 100644 --- a/src/main/java/org/matsim/run/Activities.java +++ b/src/main/java/org/matsim/run/Activities.java @@ -1,7 +1,7 @@ package org.matsim.run; import org.matsim.core.config.Config; -import org.matsim.core.config.groups.PlanCalcScoreConfigGroup; +import org.matsim.core.config.groups.ScoringConfigGroup; /** * Defines available activity types. @@ -53,7 +53,7 @@ public enum Activities { /** * Apply start and end time to params. */ - public PlanCalcScoreConfigGroup.ActivityParams apply(PlanCalcScoreConfigGroup.ActivityParams params) { + public ScoringConfigGroup.ActivityParams apply(ScoringConfigGroup.ActivityParams params) { if (start >= 0) params = params.setOpeningTime(start * 3600.); if (end >= 0) @@ -69,22 +69,22 @@ public static void addScoringParams(Config config, boolean splitTypes) { for (Activities value : Activities.values()) { // Default length if none is given - config.planCalcScore().addActivityParams(value.apply(new PlanCalcScoreConfigGroup.ActivityParams(value.name())).setTypicalDuration(6 * 3600)); + config.scoring().addActivityParams(value.apply(new ScoringConfigGroup.ActivityParams(value.name())).setTypicalDuration(6 * 3600)); if (splitTypes) for (long ii = 600; ii <= 97200; ii += 600) { - config.planCalcScore().addActivityParams(value.apply(new PlanCalcScoreConfigGroup.ActivityParams(value.name() + "_" + ii).setTypicalDuration(ii))); + config.scoring().addActivityParams(value.apply(new ScoringConfigGroup.ActivityParams(value.name() + "_" + ii).setTypicalDuration(ii))); } } - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("car interaction").setTypicalDuration(60)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("ride interaction").setTypicalDuration(60)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("car interaction").setTypicalDuration(60)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("ride interaction").setTypicalDuration(60)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("commercial_start").setTypicalDuration(3600)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("commercial_end").setTypicalDuration(3600)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("commercial_start").setTypicalDuration(3600)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("commercial_end").setTypicalDuration(3600)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("freight_start").setTypicalDuration(3600)); - config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("freight_end").setTypicalDuration(3600)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("freight_start").setTypicalDuration(3600)); + config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("freight_end").setTypicalDuration(3600)); } diff --git a/src/main/java/org/matsim/run/RunOpenBerlinScenario.java b/src/main/java/org/matsim/run/RunOpenBerlinScenario.java index 2f6260c3..6762c0bd 100644 --- a/src/main/java/org/matsim/run/RunOpenBerlinScenario.java +++ b/src/main/java/org/matsim/run/RunOpenBerlinScenario.java @@ -7,7 +7,7 @@ import org.matsim.application.options.SampleOptions; 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.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule; @@ -51,8 +51,8 @@ protected Config prepareConfig(Config config) { config.counts().setCountsScaleFactor(sampleSize); sw.defaultParams().sampleSize = sampleSize; - config.controler().setRunId(sample.adjustName(config.controler().getRunId())); - config.controler().setOutputDirectory(sample.adjustName(config.controler().getOutputDirectory())); + config.controller().setRunId(sample.adjustName(config.controller().getRunId())); + config.controller().setOutputDirectory(sample.adjustName(config.controller().getOutputDirectory())); config.plans().setInputFile(sample.adjustName(config.plans().getInputFile())); } @@ -60,30 +60,30 @@ protected Config prepareConfig(Config config) { // Required for all calibration strategies for (String subpopulation : List.of("person", "freight", "goodsTraffic", "commercialPersonTraffic", "commercialPersonTraffic_service")) { - config.strategy().addStrategySettings( - new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings( + new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultSelector.ChangeExpBeta) .setWeight(1.0) .setSubpopulation(subpopulation) ); - config.strategy().addStrategySettings( - new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings( + new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute) .setWeight(0.15) .setSubpopulation(subpopulation) ); } - config.strategy().addStrategySettings( - new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings( + new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.TimeAllocationMutator) .setWeight(0.15) .setSubpopulation("person") ); - config.strategy().addStrategySettings( - new StrategyConfigGroup.StrategySettings() + config.replanning().addStrategySettings( + new ReplanningConfigGroup.StrategySettings() .setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.SubtourModeChoice) .setWeight(0.15) .setSubpopulation("person")