From 8562c48ad46ef584204e36833b44a591c0563d02 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Sun, 1 Dec 2024 22:58:50 +0100 Subject: [PATCH 1/5] Correct misspelled CarrierControler... to CarrierController... ; Use Controller instead of Controler --- .../FreightDemandGeneration.java | 4 +- .../freight/carriers/CarriersUtils.java | 2 +- .../CarrierAgent.java | 2 +- .../CarrierAgentTracker.java | 2 +- .../CarrierControllerListener.java} | 9 ++-- .../CarrierControllerUtils.java} | 4 +- .../CarrierDriverAgent.java | 2 +- .../CarrierModule.java | 6 +-- .../CarrierReRouteVehicles.java | 2 +- .../CarrierScoringFunctionFactory.java | 2 +- .../CarrierStrategyManager.java | 2 +- .../CarrierStrategyManagerImpl.java | 2 +- .../CarrierTimeAllocationMutator.java | 2 +- .../CarrierTimeAndSpaceTourRouter.java | 2 +- .../CarrierVehicleReRouter.java | 3 +- .../FreightActivity.java | 2 +- .../FreightAgentSource.java | 2 +- .../WithinDayActivityReScheduling.java | 2 +- .../carriers/jsprit/NetworkRouter.java | 2 +- .../CarrierScoringFunctionFactoryImpl.java | 4 +- .../usecases/chessboard/RunChessboard.java | 16 +++---- .../RunPassengerAlongWithCarriers.java | 19 ++++---- ...stener.java => LSPControllerListener.java} | 8 ++-- .../org/matsim/freight/logistics/LSPImpl.java | 2 +- .../matsim/freight/logistics/LSPModule.java | 6 +-- ...chedulingOfTransportChainHubsVsDirect.java | 20 ++++----- .../initialPlans/ExampleTestOutput.java | 8 ++-- .../initialPlans/ExampleTwoEchelonGrid.java | 32 +++++++------- .../ExampleTwoEchelonGrid_NR.java | 44 +++++++++---------- .../initialPlans/MyCarrierScorer.java | 2 +- .../MyEventBasedCarrierScorer.java | 2 +- .../lspScoring/ExampleLSPScoring.java | 12 ++--- .../ExampleMobsimOfSimpleLSP.java | 12 ++--- .../ExampleMobsimOfTransportChain.java | 12 ++--- ...ventBasedCarrierScorer4MultipleChains.java | 2 +- ...dCarrierScorer4MultipleChainsInclToll.java | 2 +- .../ExampleGroceryDeliveryMultipleChains.java | 24 +++++----- .../ExampleMultipleMixedEchelonChains.java | 24 +++++----- .../ExampleMultipleOneEchelonChains.java | 24 +++++----- ...pleMultipleOneEchelonChainsReplanning.java | 24 +++++----- ...pleMultipleTwoEchelonChainsReplanning.java | 24 +++++----- ...eTwoLspsGroceryDeliveryMultipleChains.java | 30 ++++++------- ...GroceryDeliveryMultipleChainsWithToll.java | 36 +++++++-------- .../freight/carriers/CarrierModuleTest.java | 8 ++-- .../EquilWithCarrierWithPersonsIT.java | 2 +- .../EquilWithCarrierWithoutPersonsIT.java | 2 +- ...istanceScoringFunctionFactoryForTests.java | 2 +- .../ScoringFunctionFactoryForTests.java | 2 +- .../StrategyManagerFactoryForTests.java | 8 ++-- .../TimeScoringFunctionFactoryForTests.java | 2 +- .../utils/CarrierControllerUtilsTest.java | 6 ++- .../CollectionLSPReplanningTest.java | 19 ++++---- .../lspScoring/CollectionLSPScoringTest.java | 12 ++--- .../lspScoring/ExampleLSPScoringTest.java | 7 +-- ...pleIterationsCollectionLSPScoringTest.java | 18 ++++---- .../MultipleChainsReplanningTest.java | 24 +++++----- .../multipleChains/WorstPlanSelectorTest.java | 24 +++++----- .../CollectionTrackerTest.java | 10 +++-- .../CollectionLSPMobsimTest.java | 12 ++--- .../lspMobsimTests/CompleteLSPMobsimTest.java | 10 +++-- .../FirstAndSecondReloadLSPMobsimTest.java | 10 +++-- .../FirstReloadLSPMobsimTest.java | 10 +++-- .../lspMobsimTests/MainRunLSPMobsimTest.java | 10 +++-- .../MainRunOnlyLSPMobsimTest.java | 10 +++-- ...ipleIterationsCollectionLSPMobsimTest.java | 18 ++++---- ...ltipleIterationsCompleteLSPMobsimTest.java | 24 +++++----- ...ionsFirstAndSecondReloadLSPMobsimTest.java | 18 ++++---- ...pleIterationsFirstReloadLSPMobsimTest.java | 18 ++++---- ...ultipleIterationsMainRunLSPMobsimTest.java | 24 +++++----- ...tipleShipmentsCollectionLSPMobsimTest.java | 10 +++-- ...ultipleShipmentsCompleteLSPMobsimTest.java | 26 ++++++----- ...entsFirstAndSecondReloadLSPMobsimTest.java | 18 ++++---- ...ipleShipmentsFirstReloadLSPMobsimTest.java | 16 ++++--- ...MultipleShipmentsMainRunLSPMobsimTest.java | 16 ++++--- ...ultipleShipmentsCompleteLSPMobsimTest.java | 10 +++-- ...UsecasesCarrierScoringFunctionFactory.java | 4 +- .../replanning/ReceiverStrategyManager.java | 2 +- ...rateSmallScaleCommercialTrafficDemand.java | 4 +- 78 files changed, 440 insertions(+), 419 deletions(-) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierAgent.java (99%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierAgentTracker.java (99%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler/CarrierControlerListener.java => controller/CarrierControllerListener.java} (92%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler/CarrierControlerUtils.java => controller/CarrierControllerUtils.java} (94%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierDriverAgent.java (99%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierModule.java (97%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierReRouteVehicles.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierScoringFunctionFactory.java (96%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierStrategyManager.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierStrategyManagerImpl.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierTimeAllocationMutator.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierTimeAndSpaceTourRouter.java (99%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/CarrierVehicleReRouter.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/FreightActivity.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/FreightAgentSource.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/carriers/{controler => controller}/WithinDayActivityReScheduling.java (98%) rename contribs/freight/src/main/java/org/matsim/freight/logistics/{LSPControlerListener.java => LSPControllerListener.java} (98%) rename contribs/freight/src/test/java/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithPersonsIT.java (99%) rename contribs/freight/src/test/java/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithoutPersonsIT.java (99%) diff --git a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java index ac3c44cb5a6..d01a6226691 100644 --- a/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java +++ b/contribs/application/src/main/java/org/matsim/freightDemandGeneration/FreightDemandGeneration.java @@ -37,8 +37,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.geometry.CoordinateTransformation; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierModule; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierModule; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.freight.carriers.usecases.chessboard.CarrierScoringFunctionFactoryImpl; import picocli.CommandLine; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java index 7c8e7220e3e..c868457972f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java @@ -338,7 +338,7 @@ public static Carriers getOrCreateCarriers(Scenario scenario) { public static Carriers addOrGetCarriers(Scenario scenario) { // I have separated getOrCreateCarriers and getCarriers, since when the - // controler is started, it is better to fail if the carriers are not found. + // controller is started, it is better to fail if the carriers are not found. // kai, oct'19 Carriers carriers = (Carriers) scenario.getScenarioElement(CARRIERS); if (carriers == null) { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java index da31ae5637d..5be81661579 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java index 09c4036d92f..8474ba0b8c7 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierAgentTracker.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java similarity index 92% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java index f8a103bcbe5..9754f54c130 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerListener.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import jakarta.inject.Inject; import org.apache.logging.log4j.LogManager; @@ -46,13 +46,13 @@ * // not sure if this _should_ be public, but current LSP design makes this necessary. kai, sep'20 */ -public class CarrierControlerListener implements ScoringListener, ReplanningListener { +public class CarrierControllerListener implements ScoringListener, ReplanningListener { // not sure if this _should_ be public, but current LSP design makes this necessary. // It is done analogue to CarrierAgentTracker. kmt oct'22 @SuppressWarnings("unused") - private static final Logger log = LogManager.getLogger( CarrierControlerListener.class ) ; + private static final Logger log = LogManager.getLogger( CarrierControllerListener.class ) ; private final CarrierStrategyManager strategyManager; private final CarrierAgentTracker carrierAgentTracker; @@ -62,7 +62,8 @@ public class CarrierControlerListener implements ScoringListener, ReplanningList /** * Constructs a controller with a set of carriers, re-planning capabilities and scoring-functions. */ - @Inject CarrierControlerListener( @Nullable CarrierStrategyManager strategyManager, CarrierAgentTracker carrierAgentTracker ) { + @Inject + CarrierControllerListener(@Nullable CarrierStrategyManager strategyManager, CarrierAgentTracker carrierAgentTracker ) { // The current default is bind( CarrierStrategyManager.class ).toProvider( () -> null ); this.strategyManager = strategyManager; this.carrierAgentTracker = carrierAgentTracker; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerUtils.java similarity index 94% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerUtils.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerUtils.java index fe19207bfcc..5d15a6821f0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierControlerUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerUtils.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; /** * Utils class for (package-private) content of freight.carriers.controler - package; @@ -27,7 +27,7 @@ * @author kturner * */ -public class CarrierControlerUtils { +public class CarrierControllerUtils { public static CarrierStrategyManager createDefaultCarrierStrategyManager() { return new CarrierStrategyManagerImpl(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java index c7f030f3457..e0de8c3ca82 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierDriverAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java similarity index 97% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java index e2b9e1d8354..5a3a45c6035 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierModule.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.google.inject.Inject; import com.google.inject.Provider; @@ -49,8 +49,8 @@ public final class CarrierModule extends AbstractModule { bind(Carriers.class).toProvider( new CarrierProvider() ).asEagerSingleton(); // needs to be eager since it is still scenario construction. kai, oct'19 // this is probably ok - bind(CarrierControlerListener.class).in( Singleton.class ); - addControlerListenerBinding().to(CarrierControlerListener.class); + bind(CarrierControllerListener.class).in( Singleton.class ); + addControlerListenerBinding().to(CarrierControllerListener.class); bind(CarrierAgentTracker.class).in( Singleton.class ); addEventHandlerBinding().to( CarrierAgentTracker.class ); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierReRouteVehicles.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierReRouteVehicles.java index f59ba81c930..daf94e0e147 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierReRouteVehicles.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierReRouteVehicles.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierScoringFunctionFactory.java similarity index 96% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierScoringFunctionFactory.java index c73a41b3008..79338a48884 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierScoringFunctionFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierScoringFunctionFactory.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.matsim.core.scoring.ScoringFunction; import org.matsim.freight.carriers.Carrier; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManager.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManager.java index f1d6d06e84e..8a7a3cfa263 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManager.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManager.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.google.inject.Provider; import org.matsim.core.replanning.GenericStrategyManager; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java index 5bcad45b183..6e56807737d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierStrategyManagerImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.matsim.api.core.v01.population.HasPlansAndId; import org.matsim.core.replanning.GenericPlanStrategy; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java index 3b7fc83af01..b7c58ef8e84 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAllocationMutator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java @@ -18,7 +18,7 @@ * *********************************************************************** * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java similarity index 99% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java index 0a6a7399c9f..8c2362252df 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierTimeAndSpaceTourRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java index cd03cb5fd94..e169c6cd001 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/CarrierVehicleReRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm; import com.graphhopper.jsprit.core.algorithm.state.StateManager; @@ -45,7 +45,6 @@ import org.matsim.freight.carriers.CarrierVehicleTypes; import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; -import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; import java.util.Collection; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightActivity.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightActivity.java index 42cd58ae587..ee3f0e65afc 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightActivity.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightActivity.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.matsim.api.core.v01.Coord; import org.matsim.api.core.v01.Id; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java index f5613f1a961..7af83457a4b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/FreightAgentSource.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java rename to contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java index 285939a7174..fee97256f5d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controler/WithinDayActivityReScheduling.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import com.google.inject.Inject; import org.apache.logging.log4j.LogManager; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java index 7dac94a1c8c..2388801503b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkRouter.java @@ -22,7 +22,7 @@ import org.matsim.freight.carriers.CarrierPlan; import org.matsim.freight.carriers.ScheduledTour; -import org.matsim.freight.carriers.controler.CarrierTimeAndSpaceTourRouter; +import org.matsim.freight.carriers.controller.CarrierTimeAndSpaceTourRouter; /** * Router that routes {@link CarrierPlan}. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java index 759b3da5890..a08cc97c960 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java @@ -36,8 +36,8 @@ import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.scoring.SumScoringFunction; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.FreightActivity; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.FreightActivity; import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.vehicles.Vehicle; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java index e8f7887cfea..16779812e59 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java @@ -28,9 +28,7 @@ import org.matsim.api.core.v01.network.Network; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.controler.events.IterationEndsEvent; import org.matsim.core.controler.listener.IterationEndsListener; import org.matsim.core.replanning.GenericPlanStrategyImpl; @@ -46,7 +44,7 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.controller.*; import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.freight.carriers.usecases.analysis.LegHistogram; @@ -74,11 +72,11 @@ public static void main(String[] args){ Carriers carriers = CarriersUtils.addOrGetCarriers( scenario ); CarrierVehicleTypes types = CarriersUtils.getCarrierVehicleTypes( scenario ); - Controler controler = new Controler( scenario); + Controller controller = ControllerUtils.createController( scenario ); - controler.addOverridingModule(new CarrierModule() ); + controller.addOverridingModule(new CarrierModule() ); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { @@ -113,7 +111,7 @@ public void install() { } }); - controler.run(); + controller.run(); } @@ -139,7 +137,7 @@ private static class MyCarrierPlanStrategyManagerProvider implements Provider strategy = new GenericPlanStrategyImpl<>( new ExpBetaPlanChanger.Factory().build() ); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java index 40a49ecf40c..de2e7d3eb5e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java @@ -29,10 +29,7 @@ import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.MatsimServices; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.controler.listener.IterationEndsListener; import org.matsim.core.gbl.Gbl; import org.matsim.core.replanning.GenericPlanStrategyImpl; @@ -47,7 +44,7 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.controller.*; import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.freight.carriers.usecases.analysis.LegHistogram; @@ -67,7 +64,7 @@ public void run() { Scenario scenario = prepareScenario(config); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); CarrierVehicleTypes types = new CarrierVehicleTypes(); new CarrierVehicleTypeReader(types).readURL( IOUtils.extendUrl(url, "vehicleTypes.xml" ) ); @@ -75,9 +72,9 @@ public void run() { final Carriers carriers = new Carriers(); new CarrierPlanXmlReader(carriers, types ).readURL( IOUtils.extendUrl(url, "carrierPlans.xml" ) ); - controler.addOverridingModule( new CarrierModule() ); + controller.addOverridingModule( new CarrierModule() ); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ this.bind( CarrierStrategyManager.class ).toProvider( new MyCarrierPlanStrategyManagerFactory(types) ); this.bind( CarrierScoringFunctionFactory.class ).toInstance(carrier -> { @@ -91,9 +88,9 @@ public void run() { } ); - prepareFreightOutputDataAndStats(scenario, controler.getEvents(), controler, carriers); + prepareFreightOutputDataAndStats(scenario, controller.getEvents(), controller, carriers); - controler.run(); + controller.run(); } @@ -154,7 +151,7 @@ public MyCarrierPlanStrategyManagerFactory(CarrierVehicleTypes types) { final TravelDisutility travelDisutility = CarrierTravelDisutilities.createBaseDisutility(types, modeTravelTimes.get(TransportMode.car ) ); final LeastCostPathCalculator router = leastCostPathCalculatorFactory.createPathCalculator(network, travelDisutility, modeTravelTimes.get(TransportMode.car)); - final CarrierStrategyManager carrierStrategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + final CarrierStrategyManager carrierStrategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); carrierStrategyManager.setMaxPlansPerAgent(5); carrierStrategyManager.addStrategy(new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 0.95); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControlerListener.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java similarity index 98% rename from contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControlerListener.java rename to contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java index e3c864be9bb..54e7040f67b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControlerListener.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java @@ -41,11 +41,11 @@ import org.matsim.freight.carriers.CarrierPlanWriter; import org.matsim.freight.carriers.Carriers; import org.matsim.freight.carriers.CarriersUtils; -import org.matsim.freight.carriers.controler.CarrierAgentTracker; +import org.matsim.freight.carriers.controller.CarrierAgentTracker; import org.matsim.freight.logistics.io.LSPPlanXmlWriter; import org.matsim.freight.logistics.shipment.LspShipment; -class LSPControlerListener +class LSPControllerListener implements StartupListener, BeforeMobsimListener, AfterMobsimListener, @@ -54,7 +54,7 @@ class LSPControlerListener IterationStartsListener, IterationEndsListener, ShutdownListener { - private static final Logger log = LogManager.getLogger(LSPControlerListener.class); + private static final Logger log = LogManager.getLogger(LSPControllerListener.class); private final Scenario scenario; private final List registeredHandlers = new ArrayList<>(); @@ -70,7 +70,7 @@ class LSPControlerListener @Inject - LSPControlerListener(Scenario scenario) { + LSPControllerListener(Scenario scenario) { this.scenario = scenario; } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPImpl.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPImpl.java index 54840359388..d25cbfb043a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPImpl.java @@ -71,7 +71,7 @@ public static LSPPlan copyPlan(LSPPlan plan2copy) { } /** - * This is used from {@link LSPControlerListener} and not meant to be used from user code. Users + * This is used from {@link LSPControllerListener} and not meant to be used from user code. Users * should bind {@link LSPScorerFactory}. */ /* package-private */ void setScorer(LSPScorer scorer) { diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPModule.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPModule.java index 2eb4085ec56..520aead053b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPModule.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPModule.java @@ -37,7 +37,7 @@ import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.selectors.PlanSelector; import org.matsim.freight.carriers.FreightCarriersConfigGroup; -import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.controller.*; import org.matsim.freight.logistics.analysis.LspScoreStatsModule; public class LSPModule extends AbstractModule { @@ -48,8 +48,8 @@ public void install() { FreightCarriersConfigGroup freightConfig = ConfigUtils.addOrGetModule(getConfig(), FreightCarriersConfigGroup.class); - bind(LSPControlerListener.class).in(Singleton.class); - addControlerListenerBinding().to(LSPControlerListener.class); + bind(LSPControllerListener.class).in(Singleton.class); + addControlerListenerBinding().to(LSPControllerListener.class); install(new CarrierModule()); install(new LspScoreStatsModule()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java index b9ef4efa4eb..8daef42c974 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java @@ -33,16 +33,14 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.RandomPlanSelector; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.carriers.events.CarrierServiceEndEvent; import org.matsim.freight.carriers.events.CarrierTourEndEvent; import org.matsim.freight.carriers.events.eventhandler.CarrierServiceEndEventHandler; @@ -133,16 +131,16 @@ public static void main(String[] args) { log.info("schedule the LSP with the shipments and according to the scheduler of the Resource"); lsp.scheduleLogisticChains(); - log.info("Set up simulation controler and LSPModule"); + log.info("Set up simulation controller and LSPModule"); LSPUtils.addLSPs(scenario, new LSPs(Collections.singletonList(lsp))); // @KMT: LSPModule ist vom Design her nur im Zusammenhang mit dem Controler sinnvoll. Damit kann // man dann auch vollständig auf // Injection setzen. - Controler controler = new Controler(scenario); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -164,7 +162,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; @@ -174,7 +172,7 @@ public void install() { log.info("Run MATSim"); - controler.run(); + controller.run(); // print the schedules for the assigned LSPShipments log.info("print the schedules for the assigned LSPShipments"); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java index 8a0fbd8ce12..b4aee003ecf 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java @@ -26,6 +26,8 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; @@ -47,14 +49,14 @@ public static void main(String[] args) { Scenario scenario = ScenarioUtils.loadScenario(config); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); } } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java index a776131e925..b289d95c39a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java @@ -33,9 +33,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; @@ -43,9 +41,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -97,8 +95,8 @@ public static void main(String[] args) { Scenario scenario = prepareScenario(config); log.info("Prepare Controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -106,7 +104,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -119,7 +117,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -141,22 +139,22 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Some results ...."); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printScores(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printScores(controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printShipmentsOfLSP( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printResults_shipmentPlan( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printResults_shipmentLog( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); } log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java index 18525885ce7..ffaf4c0aa48 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java @@ -33,9 +33,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; @@ -43,9 +41,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.io.LSPPlanXmlReader; import org.matsim.freight.logistics.io.LSPPlanXmlWriter; @@ -123,8 +121,8 @@ public static void main(String[] args) { Scenario scenario = prepareScenario(config); log.info("Prepare Controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -132,7 +130,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -145,7 +143,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -166,31 +164,31 @@ public void install() { log.warn("Runs settings were: Demand: {}\n CarrierCosts: {}\n HubCosts: " + HUBCOSTS_FIX + "\n tollValue: " + TOLL_VALUE, demandSetting, costSetting); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); // Ggf. muss der Ordner noch erstellt werden (?) - new LSPPlanXmlWriter(LSPUtils.getLSPs(controler.getScenario())) - .write(controler.getConfig().controller().getOutputDirectory() + "/lsps.xml"); + new LSPPlanXmlWriter(LSPUtils.getLSPs(controller.getScenario())) + .write(controller.getConfig().controller().getOutputDirectory() + "/lsps.xml"); new LSPPlanXmlReader( - LSPUtils.getLSPs(controler.getScenario()), - CarriersUtils.getCarriers(controler.getScenario())); - new CarrierPlanWriter(CarriersUtils.getCarriers(controler.getScenario())) - .write(controler.getConfig().controller().getOutputDirectory() + "/carriers.xml"); + LSPUtils.getLSPs(controller.getScenario()), + CarriersUtils.getCarriers(controller.getScenario())); + new CarrierPlanWriter(CarriersUtils.getCarriers(controller.getScenario())) + .write(controller.getConfig().controller().getOutputDirectory() + "/carriers.xml"); log.info("Some results ...."); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printScores(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printScores(controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printShipmentsOfLSP( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printResults_shipmentPlan( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); ResourceImplementationUtils.printResults_shipmentLog( - controler.getControlerIO().getOutputPath(), lsp); + controller.getControlerIO().getOutputPath(), lsp); } log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyCarrierScorer.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyCarrierScorer.java index 7ee4a9f4d74..83b1fa4dc3a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyCarrierScorer.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyCarrierScorer.java @@ -24,7 +24,7 @@ import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.scoring.SumScoringFunction; import org.matsim.freight.carriers.Carrier; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; /** * @author Kai Martins-Turner (kturner) diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyEventBasedCarrierScorer.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyEventBasedCarrierScorer.java index da264c45ca1..846ecf3b5fe 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyEventBasedCarrierScorer.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/MyEventBasedCarrierScorer.java @@ -34,7 +34,7 @@ import org.matsim.core.scoring.SumScoringFunction; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.Tour; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.freight.carriers.events.CarrierTourEndEvent; import org.matsim.freight.carriers.events.CarrierTourStartEvent; import org.matsim.freight.logistics.examples.ExampleConstants; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java index d857da8727f..0d3d9fcb155 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java @@ -34,6 +34,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; @@ -177,18 +179,18 @@ public static void main(String[] args) { } } - static Controler prepareControler(Scenario scenario) { + static Controller prepareControler(Scenario scenario) { // Start the Mobsim one iteration is sufficient for scoring - Controler controler = new Controler(scenario); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { bind(LSPScorerFactory.class).toInstance(TipScorer::new); } }); - return controler; + return controller; } static Scenario prepareScenario(Config config) { diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java index 74a5990c7a0..bdbd71224f8 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java @@ -35,6 +35,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; @@ -80,7 +82,7 @@ public static void main(String[] args) { // schedule the LSP with the lspShipments and according to the scheduler of the Resource lsp.scheduleLogisticChains(); - // set up simulation controler and LSPModule + // set up simulation controller and LSPModule ArrayList lspList = new ArrayList<>(); lspList.add(lsp); LSPs lsps = new LSPs(lspList); @@ -90,8 +92,8 @@ public static void main(String[] args) { config.controller().setLastIteration(0); config.controller().setOverwriteFileSetting(OverwriteFileSetting.overwriteExistingFiles); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -100,11 +102,11 @@ public void install() { }); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); for (LspShipment lspShipment : lsp.getLspShipments()) { System.out.println("LspShipment: " + lspShipment.getId()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java index 1e81d985419..ee58841c0a6 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java @@ -34,6 +34,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; @@ -341,14 +343,14 @@ public static void main(String[] args) { // schedule the LSP with the lspShipments and according to the scheduler of the Resource lsp.scheduleLogisticChains(); - // set up simulation controler and LSPModule + // set up simulation controller and LSPModule ArrayList lspList = new ArrayList<>(); lspList.add(lsp); LSPs lsps = new LSPs(lspList); LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -363,11 +365,11 @@ public void install() { config.network().setInputFile("scenarios/2regions/2regions-network.xml"); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); for (LspShipment lspShipment : lsp.getLspShipments()) { System.out.println("Shipment: " + lspShipment.getId()); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChains.java index d0932dc1753..5469d53b508 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChains.java @@ -33,7 +33,7 @@ import org.matsim.core.scoring.SumScoringFunction; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.Tour; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.freight.carriers.events.CarrierTourEndEvent; import org.matsim.freight.carriers.events.CarrierTourStartEvent; import org.matsim.freight.logistics.analysis.Vehicle2CarrierEventHandler; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChainsInclToll.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChainsInclToll.java index 91e60ea2b8e..292c95e72c2 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChainsInclToll.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/EventBasedCarrierScorer4MultipleChainsInclToll.java @@ -35,7 +35,7 @@ import org.matsim.core.scoring.SumScoringFunction.ArbitraryEventScoring; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.Tour; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.freight.carriers.events.CarrierTourEndEvent; import org.matsim.freight.carriers.events.CarrierTourStartEvent; import org.matsim.freight.logistics.analysis.Driver2VehicleEventHandler; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java index b4dee499b34..e2bb5db2bc0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java @@ -35,18 +35,16 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.replanning.selectors.ExpBetaPlanSelector; import org.matsim.core.replanning.selectors.GenericWorstPlanForRemovalSelector; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.ExampleConstants; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -71,9 +69,9 @@ public static void main(String[] args) { log.info("Prepare scenario"); Scenario scenario = prepareScenario(config); - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -81,7 +79,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -96,7 +94,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -118,11 +116,11 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java index 5a1a0090fbd..fcf31169400 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java @@ -32,9 +32,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; @@ -42,9 +40,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.ExampleConstants; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -96,9 +94,9 @@ public static void main(String[] args) { log.info("Prepare scenario"); Scenario scenario = prepareScenario(config); - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -106,7 +104,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -121,7 +119,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -141,11 +139,11 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java index 2e107c961db..6e01b0e38ac 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java @@ -35,18 +35,16 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -97,9 +95,9 @@ public static void main(String[] args) { log.info("Prepare scenario"); Scenario scenario = prepareScenario(config); - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -107,7 +105,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -119,7 +117,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -139,11 +137,11 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java index 58aa47a74ab..4012855405c 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java @@ -36,9 +36,7 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.replanning.selectors.ExpBetaPlanSelector; @@ -47,9 +45,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -100,9 +98,9 @@ public static void main(String[] args) { log.info("Prepare scenario"); Scenario scenario = prepareScenario(config); - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -110,7 +108,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -122,7 +120,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -155,11 +153,11 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java index 0b36343790d..a0204e7fb36 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java @@ -36,9 +36,7 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.replanning.selectors.ExpBetaPlanSelector; @@ -47,9 +45,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -102,9 +100,9 @@ public static void main(String[] args) { log.info("Prepare scenario"); Scenario scenario = prepareScenario(config); - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -113,7 +111,7 @@ public void install() { }); // @formatter:off - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -121,7 +119,7 @@ public void install() { bind(CarrierScoringFunctionFactory.class).toInstance(carrierScorer); bind(LSPScorerFactory.class).toInstance(MyLSPScorer::new); bind(CarrierStrategyManager.class).toProvider( () -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; }); @@ -141,11 +139,11 @@ public void install() { // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); log.info("Done."); } diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java index 57231be2dc1..e6b9e33265b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java @@ -55,9 +55,7 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.replanning.selectors.ExpBetaPlanSelector; @@ -65,9 +63,9 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.analysis.RunFreightAnalysisEventBased; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.ExampleConstants; import org.matsim.freight.logistics.resourceImplementations.CarrierSchedulerUtils; @@ -132,13 +130,13 @@ public static void main(String[] args) { lsps.add(createLspWithDirectChain(scenario, "Kaufland_DIRECT", MultipleChainsUtils.createLSPShipmentsFromCarrierShipments(carrierKaufland), getDepotLinkFromVehicle(carrierKaufland), vehicleTypes)); LSPUtils.addLSPs(scenario, new LSPs(lsps)); - Controler controler = prepareControler(scenario); + Controller controller = prepareController(scenario); log.info("Run MATSim"); - controler.run(); + controller.run(); - runCarrierAnalysis(controler.getControlerIO().getOutputPath(), config); + runCarrierAnalysis(controller.getControlerIO().getOutputPath(), config); log.info("Done."); } @@ -170,10 +168,10 @@ private static Config prepareConfig(String[] args) { return config; } - private static Controler prepareControler(Scenario scenario) { - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + private static Controller prepareController(Scenario scenario) { + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -181,7 +179,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -196,7 +194,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -213,7 +211,7 @@ public void install() { }); } }); - return controler; + return controller; } private static void runCarrierAnalysis(String outputPath, Config config) { diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java index e27b2e27a4b..01dd11e9435 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java @@ -36,9 +36,7 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.replanning.selectors.ExpBetaPlanSelector; @@ -47,9 +45,9 @@ import org.matsim.core.utils.misc.Time; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.analysis.RunFreightAnalysisEventBased; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.ExampleConstants; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -118,19 +116,19 @@ public static void main(String[] args) { LSPUtils.addLSPs(scenario, new LSPs(lsps)); - Controler controler = prepareControler(scenario, rpScheme); + Controller controller = prepareController(scenario, rpScheme); log.info("Run MATSim"); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); - runCarrierAnalysis(controler.getControlerIO().getOutputPath(), config); + runCarrierAnalysis(controller.getControlerIO().getOutputPath(), config); log.info("Done."); } @@ -158,10 +156,10 @@ private static Config prepareConfig(String[] args) { return config; } - private static Controler prepareControler(Scenario scenario, RoadPricingScheme rpScheme) { - log.info("Prepare controler"); - Controler controler = new Controler(scenario); - controler.addOverridingModule( + private static Controller prepareController(Scenario scenario, RoadPricingScheme rpScheme) { + log.info("Prepare controller"); + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -170,7 +168,7 @@ public void install() { } }); - controler.addOverridingModule( + controller.addOverridingModule( new AbstractModule() { @Override public void install() { @@ -180,7 +178,7 @@ public void install() { .toProvider( () -> { CarrierStrategyManager strategyManager = - CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy( new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; @@ -198,10 +196,10 @@ public void install() { } }); if (!rpScheme.getTolledLinkIds().isEmpty()) { - // RoadPricing.configure(controler); - controler.addOverridingModule( new RoadPricingModule(rpScheme) ); + // RoadPricing.configure(controller); + controller.addOverridingModule( new RoadPricingModule(rpScheme) ); } - return controler; + return controller; } /* diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierModuleTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierModuleTest.java index 49dc173dd05..c722c3e7936 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierModuleTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierModuleTest.java @@ -33,11 +33,9 @@ import org.matsim.core.controler.Controler; import org.matsim.core.controler.OutputDirectoryHierarchy; import org.matsim.core.scenario.ScenarioUtils; -import org.matsim.freight.carriers.CarriersUtils; -import org.matsim.freight.carriers.FreightCarriersConfigGroup; -import org.matsim.freight.carriers.controler.CarrierModule; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierModule; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.carriers.mobsim.DistanceScoringFunctionFactoryForTests; import org.matsim.freight.carriers.mobsim.StrategyManagerFactoryForTests; import org.matsim.testcases.MatsimTestUtils; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java similarity index 99% rename from contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java index 75800bfd34d..be381fc83a7 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java similarity index 99% rename from contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java rename to contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java index 70b01111b10..6b29b060161 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java @@ -19,7 +19,7 @@ * */ -package org.matsim.freight.carriers.controler; +package org.matsim.freight.carriers.controller; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java index 81ad7c6e577..f86e4fa825b 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java @@ -40,7 +40,7 @@ import org.matsim.freight.carriers.CarrierConstants; import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; import java.util.HashSet; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java index 68dbf0bc7ab..460c0e0d735 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java @@ -39,7 +39,7 @@ import org.matsim.freight.carriers.CarrierConstants; import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; import java.util.HashSet; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java index 680ef4e1953..fb774d2d9e2 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java @@ -36,9 +36,9 @@ import org.matsim.core.router.util.TravelTime; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierPlan; -import org.matsim.freight.carriers.controler.CarrierReRouteVehicles; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; +import org.matsim.freight.carriers.controller.CarrierReRouteVehicles; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; import org.matsim.vehicles.Vehicle; import java.util.Map; @@ -83,7 +83,7 @@ public CarrierStrategyManager get() { GenericPlanStrategyImpl planStrat_reRoutePlan = new GenericPlanStrategyImpl<>( new BestPlanSelector<>() ); planStrat_reRoutePlan.addStrategyModule(new CarrierReRouteVehicles.Factory(router, network, travelTimes.get(TransportMode.car )).build() ); - CarrierStrategyManager stratManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager stratManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); stratManager.addStrategy(planStrat_reRoutePlan, null, 1.0); diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java index a8cc127ba93..e5bdc0b131a 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java @@ -40,7 +40,7 @@ import org.matsim.freight.carriers.CarrierConstants; import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; import java.util.HashSet; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java index 87ac86ec9b3..24968c4d1e6 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java @@ -42,6 +42,8 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.PlansConfigGroup; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.network.NetworkUtils; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; @@ -426,7 +428,7 @@ void testRunJsprit_allInformationGiven(){ Scenario scenario = ScenarioUtils.loadScenario(config); CarriersUtils.loadCarriersAccordingToFreightConfig(scenario ); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); try { CarriersUtils.runJsprit(scenario); @@ -435,7 +437,7 @@ void testRunJsprit_allInformationGiven(){ Assertions.fail(); } - Assertions.assertEquals(vraFile, ConfigUtils.addOrGetModule( controler.getConfig(), FreightCarriersConfigGroup.class ).getVehicleRoutingAlgorithmFile()); + Assertions.assertEquals(vraFile, ConfigUtils.addOrGetModule( controller.getConfig(), FreightCarriersConfigGroup.class ).getVehicleRoutingAlgorithmFile()); } /** diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java index c3600d60c10..ea611a35edc 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java @@ -36,7 +36,8 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.replanning.GenericPlanStrategy; @@ -45,8 +46,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils.CollectionCarrierResourceBuilder; @@ -194,11 +195,11 @@ public void initialize() { LSPUtils.addLSPs(scenario, new LSPs(Collections.singletonList(collectionLSP))); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new LSPModule() ); + controller.addOverridingModule(new LSPModule() ); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager manager = new LSPStrategyManagerImpl(); @@ -211,7 +212,7 @@ public void initialize() { }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -223,8 +224,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java index 2e06a80c4cf..e0dd95c3fad 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java @@ -40,6 +40,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; @@ -156,10 +158,10 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule( new LSPModule() ); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule( new LSPModule() ); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPScorerFactory.class ).toInstance(ExampleLSPScoring.TipScorer::new); } @@ -170,8 +172,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java index 78f968387b9..2e5f813c721 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java @@ -27,6 +27,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; import org.matsim.freight.logistics.LSP; import org.matsim.freight.logistics.LSPUtils; import org.matsim.testcases.MatsimTestUtils; @@ -44,11 +45,11 @@ public void testMain() { Scenario scenario = ExampleLSPScoring.prepareScenario(config); - Controler controler = ExampleLSPScoring.prepareControler(scenario); + Controller controller = ExampleLSPScoring.prepareControler(scenario); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); for (LSP lsp : LSPUtils.getLSPs(scenario).getLSPs().values()) { Assertions.assertEquals(13.245734044444207, lsp.getSelectedPlan().getScore(), Double.MIN_VALUE); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java index ee94945117d..cd73679404e 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java @@ -38,6 +38,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.replanning.GenericPlanStrategyImpl; @@ -45,8 +47,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -169,16 +171,16 @@ public void initialize() { lspList.add(collectionLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule( new LSPModule() ); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule( new LSPModule() ); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPScorerFactory.class ).toInstance(ExampleLSPScoring.TipScorer::new); bind( LSPStrategyManager.class ).toInstance( new LSPModule.LSPStrategyManagerEmptyImpl() ); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -189,8 +191,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java index 501e710b12f..6b815ecf943 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java @@ -37,18 +37,16 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; import org.matsim.core.scenario.ScenarioUtils; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -225,22 +223,22 @@ public void initialize() { Scenario scenario = prepareScenario(config); - Controler controler = new Controler(scenario); - controler.addOverridingModule(new AbstractModule() { + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); } }); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { final EventBasedCarrierScorer4MultipleChains carrierScorer = new EventBasedCarrierScorer4MultipleChains(); bind(CarrierScoringFunctionFactory.class).toInstance(carrierScorer); bind(LSPScorerFactory.class).toInstance(MyLSPScorer::new); bind(CarrierStrategyManager.class).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; }); @@ -252,14 +250,14 @@ public void install() { } }); - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - LSP lsp = LSPUtils.getLSPs(controler.getScenario()).getLSPs().values().iterator().next(); + LSP lsp = LSPUtils.getLSPs(controller.getScenario()).getLSPs().values().iterator().next(); initialPlanCount = lsp.getPlans().size(); initialPlanShipmentPlanCount = lsp.getPlans().getFirst().getShipmentPlans().size(); - controler.run(); + controller.run(); updatedPlanCount = lsp.getPlans().size(); innovatedPlanShipmentPlanCount = lsp.getPlans().get(1).getShipmentPlans().size(); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java index fccfa68e09d..7556c24f8c6 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java @@ -36,9 +36,7 @@ import org.matsim.core.config.ConfigUtils; 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; -import org.matsim.core.controler.OutputDirectoryHierarchy; +import org.matsim.core.controler.*; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.GenericPlanStrategyImpl; import org.matsim.core.replanning.selectors.BestPlanSelector; @@ -48,9 +46,9 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.shipment.LspShipment; @@ -248,15 +246,15 @@ public void initialize() { Scenario scenario = prepareScenario(config); - Controler controler = new Controler(scenario); - controler.addOverridingModule(new AbstractModule() { + Controller controller = ControllerUtils.createController(scenario); + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); } }); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { final EventBasedCarrierScorer4MultipleChains carrierScorer = new EventBasedCarrierScorer4MultipleChains(); @@ -264,7 +262,7 @@ public void install() { bind(CarrierScoringFunctionFactory.class).toInstance(carrierScorer); bind(LSPScorerFactory.class).toInstance(MyLSPScorer::new); bind(CarrierStrategyManager.class).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new BestPlanSelector<>()), null, 1); return strategyManager; }); @@ -279,10 +277,10 @@ public void install() { } }); - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - this.lsp = LSPUtils.getLSPs(controler.getScenario()).getLSPs().values().iterator().next(); + this.lsp = LSPUtils.getLSPs(controller.getScenario()).getLSPs().values().iterator().next(); } private Config prepareConfig() { diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java index b6695f5377d..9858cddf1a3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java @@ -37,6 +37,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.events.handler.EventHandler; import org.matsim.core.network.io.MatsimNetworkReader; @@ -185,9 +187,9 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -199,8 +201,8 @@ public void install() { // config.network().setInputFile("scenarios/2regions/2regions-network.xml"); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java index c97220d04f1..c7fcfa27c7f 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java @@ -43,6 +43,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.events.handler.BasicEventHandler; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.scenario.ScenarioUtils; @@ -182,10 +184,10 @@ public void initialize() { lspList.add(collectionLSP); lsps = new LSPs(lspList); } - Controler controler = new Controler(scenario); - controler.getEvents().addHandler((BasicEventHandler) event -> log.warn(event)); + Controller controller = ControllerUtils.createController(scenario); + controller.getEvents().addHandler((BasicEventHandler) event -> log.warn(event)); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -194,8 +196,8 @@ public void install() { LSPUtils.addLSPs(scenario, lsps); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java index aff14551751..4d6983fb661 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -36,6 +36,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.network.io.MatsimNetworkReader; import org.matsim.core.scenario.ScenarioUtils; @@ -284,9 +286,9 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -300,8 +302,8 @@ public void install() { config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java index de67d12221c..eec97b8a5d1 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -258,9 +260,9 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -271,8 +273,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java index f32adf076fa..a23d4eca1e5 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -203,9 +205,9 @@ public void initialize() { LSPs lsps = new LSPs(lspList); LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -216,8 +218,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java index 0717249ee6f..cf0e4895fd7 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -234,9 +236,9 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -247,8 +249,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java index 2ddbb434170..282b578270f 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -182,9 +184,9 @@ public void initialize() { LSPUtils.addLSPs(scenario, lsps); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -195,8 +197,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java index 703861839c5..af1c3f08741 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils.CollectionCarrierResourceBuilder; @@ -169,20 +171,20 @@ public void initialize() { lspList.add(collectionLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); } }); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toInstance( new LSPModule.LSPStrategyManagerEmptyImpl() ); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -193,8 +195,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java index 8c914933a58..eeb0d34dce8 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -296,11 +298,11 @@ public void initialize() { lspList.add(completeLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -308,7 +310,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -319,12 +321,12 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printResults_shipmentPlan(controler.getControlerIO().getOutputPath(), lsp); - ResourceImplementationUtils.printResults_shipmentLog(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printResults_shipmentPlan(controller.getControlerIO().getOutputPath(), lsp); + ResourceImplementationUtils.printResults_shipmentLog(controller.getControlerIO().getOutputPath(), lsp); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java index 0741c46ea6d..4edcebb8a13 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -262,11 +264,11 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -274,7 +276,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -285,8 +287,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java index 30c1ca58a93..f0167615a8c 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -206,11 +208,11 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -218,7 +220,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -229,8 +231,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java index 1046eefc491..741b2838909 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -241,11 +243,11 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -253,7 +255,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -264,12 +266,12 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printResults_shipmentPlan(controler.getControlerIO().getOutputPath(), lsp); - ResourceImplementationUtils.printResults_shipmentLog(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printResults_shipmentPlan(controller.getControlerIO().getOutputPath(), lsp); + ResourceImplementationUtils.printResults_shipmentLog(controller.getControlerIO().getOutputPath(), lsp); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java index c0a54bf98d3..b68714fd639 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -164,10 +166,10 @@ public void initialize() { lspList.add(collectionLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -178,8 +180,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java index c15ce76cb22..b4553664f91 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -41,6 +41,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -49,8 +51,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -65,7 +67,7 @@ import org.matsim.vehicles.VehicleUtils; public class MultipleShipmentsCompleteLSPMobsimTest { - + private static final Logger log = LogManager.getLogger(MultipleShipmentsCompleteLSPMobsimTest.class); @RegisterExtension public final MatsimTestUtils utils = new MatsimTestUtils(); @@ -299,11 +301,11 @@ public void initialize() { lspList.add(completeLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -311,7 +313,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -322,12 +324,12 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printResults_shipmentPlan(controler.getControlerIO().getOutputPath(), lsp); - ResourceImplementationUtils.printResults_shipmentLog(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printResults_shipmentPlan(controller.getControlerIO().getOutputPath(), lsp); + ResourceImplementationUtils.printResults_shipmentLog(controller.getControlerIO().getOutputPath(), lsp); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java index 0cf80a23fc6..e9c598334d1 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -47,8 +49,8 @@ import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; -import org.matsim.freight.carriers.controler.CarrierControlerUtils; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.examples.lspReplanning.AssignmentStrategyFactory; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils; @@ -261,11 +263,11 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new LSPModule()); - controler.addOverridingModule( new AbstractModule(){ + controller.addOverridingModule(new LSPModule()); + controller.addOverridingModule( new AbstractModule(){ @Override public void install(){ bind( LSPStrategyManager.class ).toProvider(() -> { LSPStrategyManager strategyManager = new LSPStrategyManagerImpl(); @@ -273,7 +275,7 @@ public void initialize() { return strategyManager; }); bind( CarrierStrategyManager.class ).toProvider(() -> { - CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.addStrategy(new GenericPlanStrategyImpl<>(new RandomPlanSelector<>()), null, 1); return strategyManager; }); @@ -284,8 +286,8 @@ public void initialize() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java index c9857e222ef..e48ed12439d 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -202,10 +204,10 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -216,12 +218,12 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printResults_shipmentPlan(controler.getControlerIO().getOutputPath(), lsp); - ResourceImplementationUtils.printResults_shipmentLog(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printResults_shipmentPlan(controller.getControlerIO().getOutputPath(), lsp); + ResourceImplementationUtils.printResults_shipmentLog(controller.getControlerIO().getOutputPath(), lsp); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java index 8c5767d0d8f..5d383570486 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -236,10 +238,10 @@ public void initialize() { lspList.add(lsp); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -250,12 +252,12 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); - for (LSP lsp : LSPUtils.getLSPs(controler.getScenario()).getLSPs().values()) { - ResourceImplementationUtils.printResults_shipmentPlan(controler.getControlerIO().getOutputPath(), lsp); - ResourceImplementationUtils.printResults_shipmentLog(controler.getControlerIO().getOutputPath(), lsp); + for (LSP lsp : LSPUtils.getLSPs(controller.getScenario()).getLSPs().values()) { + ResourceImplementationUtils.printResults_shipmentPlan(controller.getControlerIO().getOutputPath(), lsp); + ResourceImplementationUtils.printResults_shipmentLog(controller.getControlerIO().getOutputPath(), lsp); } } diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java index 7018f2e6a07..03e916f8b15 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -39,6 +39,8 @@ import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; +import org.matsim.core.controler.Controller; +import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.network.io.MatsimNetworkReader; @@ -290,10 +292,10 @@ public void initialize() { lspList.add(completeLSP); LSPs lsps = new LSPs(lspList); - Controler controler = new Controler(scenario); + Controller controller = ControllerUtils.createController(scenario); LSPUtils.addLSPs(scenario, lsps); - controler.addOverridingModule(new AbstractModule() { + controller.addOverridingModule(new AbstractModule() { @Override public void install() { install(new LSPModule()); @@ -304,8 +306,8 @@ public void install() { config.controller().setOverwriteFileSetting(OverwriteFileSetting.deleteDirectoryIfExists); config.controller().setOutputDirectory(utils.getOutputDirectory()); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 - controler.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + controller.run(); } @Test diff --git a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/UsecasesCarrierScoringFunctionFactory.java b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/UsecasesCarrierScoringFunctionFactory.java index f1287ff4de3..ba49d350c14 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/UsecasesCarrierScoringFunctionFactory.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/UsecasesCarrierScoringFunctionFactory.java @@ -8,8 +8,8 @@ import org.matsim.api.core.v01.population.Activity; import org.matsim.api.core.v01.population.Leg; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory; -import org.matsim.freight.carriers.controler.FreightActivity; +import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; +import org.matsim.freight.carriers.controller.FreightActivity; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.scoring.ScoringFunction; import org.matsim.core.scoring.SumScoringFunction; diff --git a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/replanning/ReceiverStrategyManager.java b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/replanning/ReceiverStrategyManager.java index f10d7d98145..f697154a305 100644 --- a/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/replanning/ReceiverStrategyManager.java +++ b/contribs/freightreceiver/src/main/java/org/matsim/freight/receiver/replanning/ReceiverStrategyManager.java @@ -20,7 +20,7 @@ package org.matsim.freight.receiver.replanning; -import org.matsim.freight.carriers.controler.CarrierStrategyManager; +import org.matsim.freight.carriers.controller.CarrierStrategyManager; import org.matsim.freight.receiver.Receiver; import org.matsim.freight.receiver.ReceiverPlan; import org.matsim.core.replanning.GenericStrategyManager; diff --git a/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java b/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java index 094c2f753f4..c3aa017dc39 100644 --- a/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java +++ b/contribs/small-scale-traffic-generation/src/main/java/org/matsim/smallScaleCommercialTrafficGeneration/GenerateSmallScaleCommercialTrafficDemand.java @@ -70,7 +70,7 @@ import org.matsim.facilities.ActivityFacility; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.analysis.RunFreightAnalysisEventBased; -import org.matsim.freight.carriers.controler.*; +import org.matsim.freight.carriers.controller.*; import org.matsim.freight.carriers.usecases.chessboard.CarrierTravelDisutilities; import org.matsim.smallScaleCommercialTrafficGeneration.data.CommercialTourSpecifications; import org.matsim.smallScaleCommercialTrafficGeneration.data.DefaultTourSpecificationsByUsingKID2002; @@ -1063,7 +1063,7 @@ public CarrierStrategyManager get() { travelDisutility, modeTravelTimes.get(TransportMode.car)); // final GenericStrategyManager strategyManager = new GenericStrategyManager<>(); - final CarrierStrategyManager strategyManager = CarrierControlerUtils.createDefaultCarrierStrategyManager(); + final CarrierStrategyManager strategyManager = CarrierControllerUtils.createDefaultCarrierStrategyManager(); strategyManager.setMaxPlansPerAgent(5); { GenericPlanStrategyImpl strategy = new GenericPlanStrategyImpl<>( From f2cad384638cc5995cbf43b626f46998698b40de Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Sun, 1 Dec 2024 23:00:23 +0100 Subject: [PATCH 2/5] optimize imports --- .../org/matsim/freight/carriers/Carrier.java | 5 ++--- .../freight/carriers/CarrierCapabilities.java | 3 +-- .../matsim/freight/carriers/CarrierImpl.java | 7 +++---- .../matsim/freight/carriers/CarrierPlan.java | 3 +-- .../freight/carriers/CarrierPlanReaderV1.java | 3 +-- .../freight/carriers/CarrierPlanWriter.java | 3 +-- .../carriers/CarrierPlanXmlParserV2.java | 7 +++---- .../carriers/CarrierPlanXmlParserV2_1.java | 7 +++---- .../carriers/CarrierPlanXmlReader.java | 7 +++---- .../carriers/CarrierPlanXmlWriterV1.java | 11 +++++----- .../carriers/CarrierPlanXmlWriterV2.java | 7 +++---- .../carriers/CarrierPlanXmlWriterV2_1.java | 19 ++++++++--------- .../freight/carriers/CarrierService.java | 1 - .../carriers/CarrierVehicleTypeReader.java | 9 ++++---- .../carriers/CarrierVehicleTypeReaderV1.java | 3 +-- .../carriers/CarrierVehicleTypeWriter.java | 3 +-- .../carriers/CarrierVehicleTypeWriterV1.java | 5 ++--- .../freight/carriers/CarrierVehicleTypes.java | 5 ++--- .../org/matsim/freight/carriers/Carriers.java | 7 +++---- .../freight/carriers/CarriersUtils.java | 9 ++++---- .../carriers/FreightCarriersConfigGroup.java | 5 ++--- .../matsim/freight/carriers/TimeWindow.java | 1 - .../org/matsim/freight/carriers/Tour.java | 3 +-- .../analysis/CarrierLoadAnalysis.java | 21 +++++++++---------- .../analysis/CarrierPlanAnalysis.java | 11 +++++----- ...tTimeAndDistanceAnalysisEventsHandler.java | 15 +++++++------ .../RunFreightAnalysisEventBased.java | 7 +++---- .../carriers/controller/CarrierAgent.java | 3 +-- .../controller/CarrierAgentTracker.java | 3 +-- .../controller/CarrierControllerListener.java | 3 +-- .../controller/CarrierDriverAgent.java | 11 +++++----- .../carriers/controller/CarrierModule.java | 3 +-- .../CarrierStrategyManagerImpl.java | 3 +-- .../CarrierTimeAllocationMutator.java | 5 ++--- .../CarrierTimeAndSpaceTourRouter.java | 5 ++--- .../controller/CarrierVehicleReRouter.java | 3 +-- .../controller/FreightAgentSource.java | 4 ++-- .../WithinDayActivityReScheduling.java | 7 +++---- .../carriers/events/AbstractCarrierEvent.java | 3 +-- .../carriers/events/CarrierEventsReaders.java | 3 +-- .../events/CarrierServiceEndEvent.java | 3 +-- .../events/CarrierServiceStartEvent.java | 3 +-- .../CarrierShipmentDeliveryEndEvent.java | 3 +-- .../CarrierShipmentDeliveryStartEvent.java | 7 +++---- .../events/CarrierShipmentPickupEndEvent.java | 7 +++---- .../CarrierShipmentPickupStartEvent.java | 3 +-- .../carriers/events/CarrierTourEndEvent.java | 3 +-- .../events/CarrierTourStartEvent.java | 7 +++---- .../events/CarrierTourStartEventCreator.java | 3 +-- .../CarrierServiceStartEventHandler.java | 1 - .../CarrierTourEndEventHandler.java | 1 - .../CarrierTourStartEventHandler.java | 1 - .../Vehicle2CarrierEventHandler.java | 5 ++--- .../carriers/jsprit/MatsimJspritFactory.java | 9 ++++---- .../jsprit/NetworkBasedTransportCosts.java | 5 ++--- .../NetworkBasedTransportCostsFactory.java | 9 ++++---- ...cleTypeDependentRoadPricingCalculator.java | 4 +--- .../usecases/analysis/CarrierScoreStats.java | 9 ++++---- .../usecases/analysis/LegHistogram.java | 17 +++++++-------- .../CarrierScoringFunctionFactoryImpl.java | 5 ++--- .../chessboard/FreightScenarioCreator.java | 7 +++---- .../chessboard/InitialCarrierPlanCreator.java | 3 +-- .../InnerOuterCityScenarioCreator.java | 5 ++--- .../chessboard/PassengerScenarioCreator.java | 5 ++--- .../usecases/chessboard/RunChessboard.java | 3 +-- .../RunPassengerAlongWithCarriers.java | 5 ++--- ...PlanAndOptimizeItsVehicleRouteFactory.java | 5 ++--- .../FreightLogisticsConfigGroup.java | 1 - .../logistics/LSPControllerListener.java | 1 - .../analysis/Driver2VehicleEventHandler.java | 5 ++--- .../logistics/events/LspEventsReader.java | 3 +-- .../initialPlans/ExampleTestOutput.java | 1 - .../ExampleMobsimOfSimpleLSP.java | 1 - .../ExampleMobsimOfTransportChain.java | 1 - ...eTwoLspsGroceryDeliveryMultipleChains.java | 2 -- ...GroceryDeliveryMultipleChainsWithToll.java | 1 - .../RandomLogisticChainShipmentAssigner.java | 2 +- .../RandomShiftingStrategyFactory.java | 1 - .../requirementsChecking/RedRequirement.java | 1 - .../ExampleSimulationTrackers.java | 1 - .../CarrierSchedulerUtils.java | 1 - .../CollectionCarrierScheduler.java | 1 - .../DistributionCarrierScheduler.java | 1 - .../LSPTourStartEventHandler.java | 3 +-- .../TransshipmentHubScheduler.java | 2 +- .../carriers/CarrierEventsReadersTest.java | 10 ++++----- .../carriers/CarrierPlanReaderV1Test.java | 1 - .../carriers/CarrierPlanXmlReaderV2Test.java | 12 +++++------ .../CarrierPlanXmlReaderV2WithDtdTest.java | 6 ++---- .../carriers/CarrierPlanXmlWriterV1Test.java | 1 - .../carriers/CarrierPlanXmlWriterV2Test.java | 8 +++---- .../CarrierPlanXmlWriterV2_1Test.java | 7 +++---- .../carriers/CarrierReadWriteV2_1Test.java | 4 +--- .../CarrierVehicleTypeLoaderTest.java | 3 +-- .../CarrierVehicleTypeReaderTest.java | 6 +++--- .../carriers/CarrierVehicleTypeTest.java | 3 +-- .../CarrierVehicleTypeWriterTest.java | 3 --- .../freight/carriers/CarriersUtilsTest.java | 7 +++---- .../FreightCarriersConfigGroupTest.java | 9 ++++---- .../FreightAnalysisEventBasedTest.java | 5 ++--- .../EquilWithCarrierWithPersonsIT.java | 2 +- .../EquilWithCarrierWithoutPersonsIT.java | 2 +- ...istanceConstraintFromVehiclesFileTest.java | 11 +++++----- .../jsprit/DistanceConstraintTest.java | 11 +++++----- .../carriers/jsprit/FixedCostsTest.java | 8 +++---- .../carriers/jsprit/IntegrationIT.java | 3 +-- .../jsprit/MatsimTransformerTest.java | 11 +++++----- .../NetworkBasedTransportCostsTest.java | 10 ++++----- ...istanceScoringFunctionFactoryForTests.java | 7 +++---- .../ScoringFunctionFactoryForTests.java | 7 +++---- .../StrategyManagerFactoryForTests.java | 5 ++--- .../TimeScoringFunctionFactoryForTests.java | 7 +++---- .../utils/CarrierControllerUtilsIT.java | 6 ++---- .../utils/CarrierControllerUtilsTest.java | 8 +++---- .../logistics/events/LspEventsReaderTest.java | 4 ++-- ...ulingOfTransportChainHubsVsDirectTest.java | 2 +- .../ExampleTwoEchelonGridTest.java | 2 +- .../CollectionLSPReplanningTest.java | 2 +- .../lspScoring/CollectionLSPScoringTest.java | 3 +-- .../lspScoring/ExampleLSPScoringTest.java | 3 +-- ...pleIterationsCollectionLSPScoringTest.java | 3 +-- .../ExampleMobsimOfSimpleLSPTest.java | 4 ++-- .../MultipleChainsReplanningTest.java | 2 +- .../CollectionTrackerTest.java | 7 +++---- .../logistics/io/LSPReadWriteTest.java | 2 +- 125 files changed, 251 insertions(+), 376 deletions(-) diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/Carrier.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/Carrier.java index 8ee9e1812e5..e80fbb6c9fa 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/Carrier.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/Carrier.java @@ -21,13 +21,12 @@ package org.matsim.freight.carriers; +import java.util.List; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.population.HasPlansAndId; import org.matsim.utils.objectattributes.attributable.Attributable; -import java.util.List; -import java.util.Map; - /** * A carrier. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierCapabilities.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierCapabilities.java index fa14ddfd9bb..cca27a8c435 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierCapabilities.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierCapabilities.java @@ -21,12 +21,11 @@ package org.matsim.freight.carriers; +import java.util.*; import org.matsim.api.core.v01.Id; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; -import java.util.*; - /** * This contains the capabilities/resources a carrier has/can deploy. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierImpl.java index 8dcc53adc75..54bebb6b9d2 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierImpl.java @@ -21,14 +21,13 @@ package org.matsim.freight.carriers; -import org.matsim.api.core.v01.Id; -import org.matsim.utils.objectattributes.attributable.Attributes; -import org.matsim.utils.objectattributes.attributable.AttributesImpl; - import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.matsim.api.core.v01.Id; +import org.matsim.utils.objectattributes.attributable.Attributes; +import org.matsim.utils.objectattributes.attributable.AttributesImpl; /** * This is a carrier that has capabilities and resources, jobs and plans to fulfill its obligations. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlan.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlan.java index 9c51aac159e..e1f56c19d4a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlan.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlan.java @@ -21,13 +21,12 @@ package org.matsim.freight.carriers; +import java.util.Collection; import org.matsim.api.core.v01.population.BasicPlan; import org.matsim.utils.objectattributes.attributable.Attributable; import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; -import java.util.Collection; - /** * * A specific plan of a carrier, and its score. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java index 4e13ad599b6..d242e5ebce8 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanReaderV1.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -34,8 +35,6 @@ import org.matsim.vehicles.VehicleType; import org.xml.sax.Attributes; -import java.util.*; - /** * A reader that reads carriers and their plans. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanWriter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanWriter.java index 3d7922d9489..3e27e759e82 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanWriter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanWriter.java @@ -22,9 +22,8 @@ package org.matsim.freight.carriers; import com.google.inject.Inject; -import org.matsim.utils.objectattributes.AttributeConverter; - import java.util.Map; +import org.matsim.utils.objectattributes.AttributeConverter; /** * @author mrieser / Simunto diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java index a63697cfab4..c47a04a5469 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2.java @@ -21,7 +21,10 @@ package org.matsim.freight.carriers; +import static org.matsim.freight.carriers.CarrierConstants.*; + import com.google.inject.Inject; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -40,10 +43,6 @@ import org.matsim.vehicles.VehicleType; import org.xml.sax.Attributes; -import java.util.*; - -import static org.matsim.freight.carriers.CarrierConstants.*; - class CarrierPlanXmlParserV2 extends MatsimXmlParser { public static final Logger logger = LogManager.getLogger(CarrierPlanXmlParserV2.class); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java index 8503eb4acad..e8b3911df61 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlParserV2_1.java @@ -21,7 +21,10 @@ package org.matsim.freight.carriers; +import static org.matsim.freight.carriers.CarrierConstants.*; + import com.google.inject.Inject; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -40,10 +43,6 @@ import org.matsim.vehicles.VehicleType; import org.xml.sax.Attributes; -import java.util.*; - -import static org.matsim.freight.carriers.CarrierConstants.*; - class CarrierPlanXmlParserV2_1 extends MatsimXmlParser { public static final Logger logger = LogManager.getLogger(CarrierPlanXmlParserV2_1.class); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlReader.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlReader.java index 5155f5bdebc..4842ab434f9 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlReader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlReader.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers; +import java.io.InputStream; +import java.net.URL; +import java.util.Stack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.core.api.internal.MatsimReader; @@ -28,10 +31,6 @@ import org.xml.sax.Attributes; import org.xml.sax.SAXException; -import java.io.InputStream; -import java.net.URL; -import java.util.Stack; - /** * A reader that reads carriers and their plans. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1.java index 510ea9b1ac3..e2b7e09d930 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1.java @@ -22,6 +22,11 @@ package org.matsim.freight.carriers; import com.graphhopper.jsprit.core.problem.job.Shipment; +import java.io.BufferedWriter; +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -30,12 +35,6 @@ import org.matsim.core.utils.io.MatsimXmlWriter; import org.matsim.core.utils.misc.Time; -import java.io.BufferedWriter; -import java.io.IOException; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - /** * A writer that writes carriers and their plans in a xml-file. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2.java index b78af8aa3e6..e47ffdb782d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2.java @@ -22,6 +22,9 @@ package org.matsim.freight.carriers; import com.google.inject.Inject; +import java.io.BufferedWriter; +import java.io.IOException; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -38,10 +41,6 @@ import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate; import org.matsim.vehicles.VehicleType; -import java.io.BufferedWriter; -import java.io.IOException; -import java.util.*; - /** * A writer that writes carriers and their plans in a xml-file. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java index 92699982378..6195fb3834f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1.java @@ -21,7 +21,16 @@ package org.matsim.freight.carriers; +import static org.matsim.freight.carriers.CarrierConstants.*; + import com.google.inject.Inject; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -34,16 +43,6 @@ import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate; import org.matsim.vehicles.VehicleType; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import static org.matsim.freight.carriers.CarrierConstants.*; - /** * A writer that writes carriers and their plans in a xml-file. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java index b7106fa6de9..20ad184013e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierService.java @@ -27,7 +27,6 @@ import org.matsim.utils.objectattributes.attributable.Attributes; import org.matsim.utils.objectattributes.attributable.AttributesImpl; - public final class CarrierService implements Attributable { public static class Builder { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReader.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReader.java index f10e5fc9bd5..0d8d070c5c6 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReader.java @@ -21,6 +21,10 @@ package org.matsim.freight.carriers; +import java.io.InputStream; +import java.net.URL; +import java.util.Map; +import java.util.Stack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -33,11 +37,6 @@ import org.xml.sax.Attributes; import org.xml.sax.SAXException; -import java.io.InputStream; -import java.net.URL; -import java.util.Map; -import java.util.Stack; - /** * Reader reading carrierVehicleTypes from a xml-file. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderV1.java index 92e2bacc590..52d56eaf0d2 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderV1.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers; +import java.util.Stack; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -33,8 +34,6 @@ import org.matsim.vehicles.VehicleUtils; import org.xml.sax.Attributes; -import java.util.Stack; - class CarrierVehicleTypeReaderV1 extends MatsimXmlParser { private static final Logger log = LogManager.getLogger(CarrierVehicleTypeReaderV1.class) ; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriter.java index 4fbd8d68bbb..573f8441cae 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriter.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.core.api.internal.MatsimWriter; import org.matsim.vehicles.MatsimVehicleWriter; @@ -28,8 +29,6 @@ import org.matsim.vehicles.VehicleUtils; import org.matsim.vehicles.Vehicles; -import java.util.Map; - /** * A writer that writes carriers and their plans in a xml-file. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterV1.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterV1.java index 823123e916a..b6671235c2a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterV1.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterV1.java @@ -21,6 +21,8 @@ package org.matsim.freight.carriers; +import java.io.BufferedWriter; +import java.io.IOException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.core.utils.io.MatsimXmlWriter; @@ -28,9 +30,6 @@ import org.matsim.vehicles.EngineInformation; import org.matsim.vehicles.VehicleType; -import java.io.BufferedWriter; -import java.io.IOException; - @Deprecated // only there if someone insists on writing V1 public final class CarrierVehicleTypeWriterV1 extends MatsimXmlWriter { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypes.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypes.java index e9900cdc6cb..0250412938a 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypes.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarrierVehicleTypes.java @@ -21,11 +21,10 @@ package org.matsim.freight.carriers; -import org.matsim.api.core.v01.Id; -import org.matsim.vehicles.VehicleType; - import java.util.HashMap; import java.util.Map; +import org.matsim.api.core.v01.Id; +import org.matsim.vehicles.VehicleType; /** * VehicleTypeContainer mapping all vehicleTypes. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/Carriers.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/Carriers.java index f13f0bc56ae..4512008b9e8 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/Carriers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/Carriers.java @@ -21,13 +21,12 @@ package org.matsim.freight.carriers; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.matsim.api.core.v01.Id; - import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.matsim.api.core.v01.Id; /** * A container that maps carriers. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java index c868457972f..bae1ba79c29 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/CarriersUtils.java @@ -28,6 +28,10 @@ import com.graphhopper.jsprit.core.problem.job.Shipment; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; +import java.util.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.AtomicInteger; +import javax.management.InvalidAttributeValueException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -44,11 +48,6 @@ import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; -import javax.management.InvalidAttributeValueException; -import java.util.*; -import java.util.concurrent.*; -import java.util.concurrent.atomic.AtomicInteger; - public class CarriersUtils { static final String CARRIER_VEHICLE = "carrierVehicle"; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightCarriersConfigGroup.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightCarriersConfigGroup.java index 1aed1a936f2..2474df19550 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightCarriersConfigGroup.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/FreightCarriersConfigGroup.java @@ -22,11 +22,10 @@ package org.matsim.freight.carriers; import jakarta.validation.constraints.Positive; -import org.matsim.core.config.ConfigGroup; -import org.matsim.core.config.ReflectiveConfigGroup; - import java.net.URL; import java.util.Map; +import org.matsim.core.config.ConfigGroup; +import org.matsim.core.config.ReflectiveConfigGroup; public class FreightCarriersConfigGroup extends ReflectiveConfigGroup { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/TimeWindow.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/TimeWindow.java index 8c5e9fc0d25..1eadbe077c0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/TimeWindow.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/TimeWindow.java @@ -24,7 +24,6 @@ import org.matsim.core.utils.misc.Time; - /** * Q: What happens/should happen if the time window is not sufficient to unload, or * the vehicle arrives after the time window? diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java index cb522e857fb..b9734e0bc64 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/Tour.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -30,8 +31,6 @@ import org.matsim.core.population.routes.NetworkRoute; import org.matsim.core.population.routes.RouteUtils; -import java.util.*; - /** * This is a tour of a carrier which is a sequence of activities and legs. *

diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierLoadAnalysis.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierLoadAnalysis.java index 7de5125e51e..b28fdf86c13 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierLoadAnalysis.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierLoadAnalysis.java @@ -21,6 +21,16 @@ package org.matsim.freight.carriers.analysis; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND; + +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Path; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.Map; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -34,17 +44,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.Map; - -import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND; - /** * @author Kai Martins-Turner (kturner) */ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierPlanAnalysis.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierPlanAnalysis.java index aeec93fd605..610c376a5db 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierPlanAnalysis.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/CarrierPlanAnalysis.java @@ -21,17 +21,16 @@ package org.matsim.freight.carriers.analysis; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.matsim.api.core.v01.Id; -import org.matsim.core.utils.misc.Time; -import org.matsim.freight.carriers.*; - import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Path; import java.util.TreeMap; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.matsim.api.core.v01.Id; +import org.matsim.core.utils.misc.Time; +import org.matsim.freight.carriers.*; /** * Some basic analysis / data collection for {@link Carriers}(files) diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java index c62863465d5..4e53c559222 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/FreightTimeAndDistanceAnalysisEventsHandler.java @@ -21,6 +21,13 @@ package org.matsim.freight.carriers.analysis; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.nio.file.Path; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TreeMap; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -44,14 +51,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.io.BufferedWriter; -import java.io.FileWriter; -import java.io.IOException; -import java.nio.file.Path; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.TreeMap; - /** * @author Kai Martins-Turner (kturner) */ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/RunFreightAnalysisEventBased.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/RunFreightAnalysisEventBased.java index 7269a70ac7f..d6a01e09409 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/RunFreightAnalysisEventBased.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/analysis/RunFreightAnalysisEventBased.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers.analysis; +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; @@ -36,10 +39,6 @@ import org.matsim.freight.carriers.FreightCarriersConfigGroup; import org.matsim.freight.carriers.events.CarrierEventsReaders; -import java.io.File; -import java.io.IOException; -import java.nio.file.Path; - //import static org.matsim.application.ApplicationUtils.globFile; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java index 5be81661579..1afe10da4d0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.controller; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -38,8 +39,6 @@ import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleUtils; -import java.util.*; - /** * This keeps track of the carrier during simulation. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java index 8474ba0b8c7..f2bd02a204e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierAgentTracker.java @@ -22,6 +22,7 @@ package org.matsim.freight.carriers.controller; import com.google.inject.Inject; +import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -35,8 +36,6 @@ import org.matsim.freight.carriers.events.CarrierEventCreator; import org.matsim.freight.carriers.events.CarrierEventCreatorUtils; -import java.util.*; - /** * This keeps track of all carrierAgents during simulation. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java index 9754f54c130..136fecf4725 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierControllerListener.java @@ -22,6 +22,7 @@ package org.matsim.freight.carriers.controller; import jakarta.inject.Inject; +import javax.annotation.Nullable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; @@ -31,8 +32,6 @@ import org.matsim.core.controler.listener.ScoringListener; import org.matsim.freight.carriers.CarriersUtils; -import javax.annotation.Nullable; - /** * Controls the workflow of the simulation. *

diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java index e0de8c3ca82..ba8e40e3d71 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierDriverAgent.java @@ -21,6 +21,11 @@ package org.matsim.freight.carriers.controller; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -41,12 +46,6 @@ import org.matsim.freight.carriers.events.CarrierEventCreator; import org.matsim.vehicles.Vehicle; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - /** * This keeps track of a scheduledTour during simulation and can thus be seen as the driver of the vehicle that runs the tour. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java index 5a3a45c6035..d95e1e7ac18 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierModule.java @@ -24,6 +24,7 @@ import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; +import java.util.List; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.population.Activity; @@ -38,8 +39,6 @@ import org.matsim.core.scoring.ScoringFunction; import org.matsim.freight.carriers.*; -import java.util.List; - public final class CarrierModule extends AbstractModule { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java index 6e56807737d..8a673af527b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierStrategyManagerImpl.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.controller; +import java.util.List; import org.matsim.api.core.v01.population.HasPlansAndId; import org.matsim.core.replanning.GenericPlanStrategy; import org.matsim.core.replanning.GenericStrategyManager; @@ -30,8 +31,6 @@ import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierPlan; -import java.util.List; - class CarrierStrategyManagerImpl implements CarrierStrategyManager{ final GenericStrategyManager delegate = new GenericStrategyManagerImpl<>(); @Override public void addStrategy( GenericPlanStrategy strategy, String subpopulation, double weight ){ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java index b7c58ef8e84..b38a96a8fd2 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAllocationMutator.java @@ -20,15 +20,14 @@ */ package org.matsim.freight.carriers.controller; +import java.util.ArrayList; +import java.util.Collection; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.ReplanningContext; import org.matsim.core.replanning.modules.GenericPlanStrategyModule; import org.matsim.freight.carriers.CarrierPlan; import org.matsim.freight.carriers.ScheduledTour; -import java.util.ArrayList; -import java.util.Collection; - /** * @author nagel * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java index 8c2362252df..116495f7549 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierTimeAndSpaceTourRouter.java @@ -21,6 +21,8 @@ package org.matsim.freight.carriers.controller; +import java.util.ArrayList; +import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -41,9 +43,6 @@ import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; -import java.util.ArrayList; -import java.util.List; - /** * Router routing scheduledTours. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java index e169c6cd001..1d9a02d74d0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/CarrierVehicleReRouter.java @@ -35,6 +35,7 @@ import com.graphhopper.jsprit.io.algorithm.AlgorithmConfig; import com.graphhopper.jsprit.io.algorithm.AlgorithmConfigXmlReader; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; +import java.util.Collection; import org.matsim.api.core.v01.network.Network; import org.matsim.contrib.roadpricing.RoadPricingScheme; import org.matsim.core.replanning.ReplanningContext; @@ -46,8 +47,6 @@ import org.matsim.freight.carriers.jsprit.MatsimJspritFactory; import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; -import java.util.Collection; - class CarrierVehicleReRouter implements GenericPlanStrategyModule{ private final Network network; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java index 7af83457a4b..c1550c49701 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/FreightAgentSource.java @@ -22,6 +22,8 @@ package org.matsim.freight.carriers.controller; import com.google.inject.Inject; +import java.util.ArrayList; +import java.util.Collection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -35,8 +37,6 @@ import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleUtils; -import java.util.ArrayList; -import java.util.Collection; /** * Created by IntelliJ IDEA. User: zilske Date: 10/31/11 Time: 5:59 PM To change * this template use File | Settings | File Templates. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java index fee97256f5d..0e4cbebfa6d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/controller/WithinDayActivityReScheduling.java @@ -22,6 +22,9 @@ package org.matsim.freight.carriers.controller; import com.google.inject.Inject; +import java.util.Collection; +import java.util.HashSet; +import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -38,10 +41,6 @@ import org.matsim.freight.carriers.Tour.Start; import org.matsim.freight.carriers.Tour.TourActivity; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - /* * Physically enforces beginnings of time windows for freight activities, i.e. freight agents * wait before closed doors until they can deliver / pick up their goods. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java index 1380144b9b4..497bc3dca7e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/AbstractCarrierEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.Event; import org.matsim.api.core.v01.events.HasLinkId; @@ -29,8 +30,6 @@ import org.matsim.freight.carriers.Carrier; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * A general freight event contains the information (= {@link Id}) of the * - {@link Carrier} diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java index 23c9176a0ff..ee06d87ba6d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierEventsReaders.java @@ -21,11 +21,10 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.MatsimEventsReader; -import java.util.Map; - /** * Creates an {@link MatsimEventsReader} that also handles the carrier specific events. *

diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java index bfd8ad7d68c..f806248471c 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceEndEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,8 +29,6 @@ import org.matsim.freight.carriers.CarrierService; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * An event, that informs that a Freight {@link CarrierService} activity has ended. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java index 1b866d5ce5b..d1b4d816ace 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierServiceStartEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,8 +29,6 @@ import org.matsim.freight.carriers.CarrierService; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * An event, that informs that a Freight {@link CarrierService} activity has started. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java index c02717031fa..8f60260a067 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryEndEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,8 +29,6 @@ import org.matsim.freight.carriers.CarrierShipment; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * An event, that informs that a Freight {@link CarrierShipment} delivery-activity has ended. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java index 43cf21fc752..a30035968c0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentDeliveryStartEvent.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers.events; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; + +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,10 +31,6 @@ import org.matsim.freight.carriers.CarrierShipment; import org.matsim.vehicles.Vehicle; -import java.util.Map; - -import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; - /** * An event, that informs that a Freight {@link CarrierShipment} delivery-activity has started. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java index 90e1fd137b7..4316e6f4dfe 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupEndEvent.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers.events; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; + +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,10 +31,6 @@ import org.matsim.freight.carriers.CarrierShipment; import org.matsim.vehicles.Vehicle; -import java.util.Map; - -import static org.matsim.freight.carriers.events.CarrierEventAttributes.*; - /** * An event, that informs that a Freight {@link CarrierShipment} pickup-activity has ended. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java index ab36e627190..fe851a10138 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierShipmentPickupStartEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,8 +29,6 @@ import org.matsim.freight.carriers.CarrierShipment; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * An event, that informs that a Freight {@link CarrierShipment} pickup-activity has started. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java index 82e133f2166..1c0e3579312 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourEndEvent.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,8 +29,6 @@ import org.matsim.freight.carriers.Tour; import org.matsim.vehicles.Vehicle; -import java.util.Map; - /** * An event, that informs when a Freight {@link Tour} has ended. * There are NO specific information of the tour given, because the {@link Tour} is determined by the {@link Vehicle} and its {@link Carrier}. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java index 9c64e8213b2..aa4ff9f1084 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEvent.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers.events; +import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_TOUR_ID; + +import java.util.Map; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.GenericEvent; import org.matsim.api.core.v01.network.Link; @@ -28,10 +31,6 @@ import org.matsim.freight.carriers.Tour; import org.matsim.vehicles.Vehicle; -import java.util.Map; - -import static org.matsim.freight.carriers.events.CarrierEventAttributes.ATTRIBUTE_TOUR_ID; - /** * An event, that informs when a Freight {@link Tour} has started. * There are NO specific information of the tour given, because the {@link Tour} is determined by the {@link Vehicle} and its {@link Carrier}. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java index aacf3e6ef12..fea34b4f577 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/CarrierTourStartEventCreator.java @@ -21,6 +21,7 @@ package org.matsim.freight.carriers.events; +import java.util.TreeMap; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.ActivityEndEvent; import org.matsim.api.core.v01.events.Event; @@ -32,8 +33,6 @@ import org.matsim.freight.carriers.ScheduledTour; import org.matsim.vehicles.Vehicle; -import java.util.TreeMap; - /*package-private*/ final class CarrierTourStartEventCreator implements CarrierEventCreator { final TreeMap, ActivityEndEvent> endEventMap = new TreeMap<>(); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierServiceStartEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierServiceStartEventHandler.java index a8ea55c13e8..362974eae3f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierServiceStartEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierServiceStartEventHandler.java @@ -24,7 +24,6 @@ import org.matsim.core.events.handler.EventHandler; import org.matsim.freight.carriers.events.CarrierServiceStartEvent; - public interface CarrierServiceStartEventHandler extends EventHandler { void handleEvent( CarrierServiceStartEvent event ); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourEndEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourEndEventHandler.java index 2d30ce4d70c..d14a5d285cf 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourEndEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourEndEventHandler.java @@ -24,7 +24,6 @@ import org.matsim.core.events.handler.EventHandler; import org.matsim.freight.carriers.events.CarrierTourEndEvent; - public interface CarrierTourEndEventHandler extends EventHandler { void handleEvent( CarrierTourEndEvent event ); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourStartEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourStartEventHandler.java index 5f4b26ce4bb..3a7997cc9ef 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourStartEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/CarrierTourStartEventHandler.java @@ -24,7 +24,6 @@ import org.matsim.core.events.handler.EventHandler; import org.matsim.freight.carriers.events.CarrierTourStartEvent; - public interface CarrierTourStartEventHandler extends EventHandler { void handleEvent( CarrierTourStartEvent event ); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java index bc9236decbf..0d5b9902f57 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/events/eventhandler/Vehicle2CarrierEventHandler.java @@ -20,15 +20,14 @@ */ package org.matsim.freight.carriers.events.eventhandler; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.matsim.api.core.v01.Id; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.events.CarrierTourEndEvent; import org.matsim.freight.carriers.events.CarrierTourStartEvent; import org.matsim.vehicles.Vehicle; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - /** * Basic event handler that collects the relation between vehicles and carrier. * Necessary since link enter and leave events do not contain any information of the carrier. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java index 8710e50c7ba..d7fe28fcfe8 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/MatsimJspritFactory.java @@ -45,6 +45,10 @@ import com.graphhopper.jsprit.io.algorithm.AlgorithmConfig; import com.graphhopper.jsprit.io.algorithm.AlgorithmConfigXmlReader; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Coord; @@ -57,11 +61,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - /** * A factory that creates matsim-object from jsprit * (...) and vice versa. diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java index e6d8e1a0e45..0e9ece0da53 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCosts.java @@ -26,6 +26,8 @@ import com.graphhopper.jsprit.core.problem.driver.Driver; import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; import com.graphhopper.jsprit.core.problem.vehicle.VehicleImpl; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.api.core.v01.network.Network; @@ -45,9 +47,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - /** * This calculates transport-times, transport-costs and the distance to cover * the distance from one location to another. It calculates these values based diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java index 6a0be5414f0..558ec523a81 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsFactory.java @@ -21,19 +21,18 @@ package org.matsim.freight.carriers.jsprit; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.router.util.TravelTime; -import org.matsim.freight.carriers.FreightCarriersConfigGroup; import org.matsim.freight.carriers.Carriers; +import org.matsim.freight.carriers.FreightCarriersConfigGroup; import org.matsim.vehicles.VehicleType; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - /** * @author steffenaxer */ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java index 6175780ab9a..7c9541f5777 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/jsprit/VehicleTypeDependentRoadPricingCalculator.java @@ -21,14 +21,12 @@ package org.matsim.freight.carriers.jsprit; import com.graphhopper.jsprit.core.problem.vehicle.VehicleType; +import java.util.*; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.contrib.roadpricing.RoadPricingScheme; import org.matsim.contrib.roadpricing.RoadPricingSchemeImpl.Cost; -import java.util.*; - - /** * Calculator that manages and calculates vehicle type dependent road pricing schemas. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java index 84556de1a14..ab4fa18632f 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/CarrierScoreStats.java @@ -21,6 +21,10 @@ package org.matsim.freight.carriers.usecases.analysis; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Locale; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.core.controler.events.IterationEndsEvent; @@ -35,11 +39,6 @@ import org.matsim.freight.carriers.CarrierPlan; import org.matsim.freight.carriers.Carriers; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.UncheckedIOException; -import java.util.Locale; - /** * As you can see, it is basically a copy of {@link org.matsim.analysis.ScoreStatsControlerListener}. However, it is modified to score {@link Carrier}s * rather than Persons. (Oct'13, schroeder) diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java index fff393eee93..1954eff762e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/analysis/LegHistogram.java @@ -22,6 +22,14 @@ package org.matsim.freight.carriers.usecases.analysis; import jakarta.inject.Inject; +import java.awt.*; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.PrintStream; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartUtils; import org.jfree.chart.JFreeChart; @@ -42,15 +50,6 @@ import org.matsim.api.core.v01.population.Population; import org.matsim.core.utils.misc.Time; -import java.awt.*; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintStream; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - /** * It is a copy of {@link org.matsim.analysis.LegHistogram}. It is modified to include or exclude persons. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java index a08cc97c960..ee2b54c9399 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/CarrierScoringFunctionFactoryImpl.java @@ -22,6 +22,8 @@ package org.matsim.freight.carriers.usecases.chessboard; import com.google.inject.Inject; +import java.util.HashSet; +import java.util.Set; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -41,9 +43,6 @@ import org.matsim.freight.carriers.jsprit.VehicleTypeDependentRoadPricingCalculator; import org.matsim.vehicles.Vehicle; -import java.util.HashSet; -import java.util.Set; - /** * Defines example carrier scoring function (factory). * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java index c258d01e703..3d291829b77 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/FreightScenarioCreator.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers.usecases.chessboard; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; @@ -34,10 +37,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - /** * Creates chessboard freight scenario. * diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java index fb2979e4be1..9bd932848f7 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InitialCarrierPlanCreator.java @@ -34,6 +34,7 @@ import com.graphhopper.jsprit.io.algorithm.AlgorithmConfig; import com.graphhopper.jsprit.io.algorithm.AlgorithmConfigXmlReader; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; +import java.util.Collection; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Network; import org.matsim.core.config.Config; @@ -44,8 +45,6 @@ import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; import org.matsim.freight.carriers.jsprit.NetworkRouter; -import java.util.Collection; - final class InitialCarrierPlanCreator { private final Network network; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java index d5b48f1df69..789a5681a46 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/InnerOuterCityScenarioCreator.java @@ -21,12 +21,11 @@ package org.matsim.freight.carriers.usecases.chessboard; -import org.matsim.api.core.v01.Id; -import org.matsim.api.core.v01.network.Link; - import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.network.Link; final class InnerOuterCityScenarioCreator { diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java index 3a742ced5e6..1060931835e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/PassengerScenarioCreator.java @@ -21,6 +21,8 @@ package org.matsim.freight.carriers.usecases.chessboard; +import java.util.ArrayList; +import java.util.List; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -36,9 +38,6 @@ import org.matsim.core.router.util.LeastCostPathCalculator.Path; import org.matsim.core.scenario.ScenarioUtils; -import java.util.ArrayList; -import java.util.List; - final class PassengerScenarioCreator { static int agentCounter = 1; diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java index 16779812e59..ff62264a468 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunChessboard.java @@ -23,6 +23,7 @@ import com.google.inject.Provider; import jakarta.inject.Inject; +import java.util.Map; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Network; @@ -48,8 +49,6 @@ import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.freight.carriers.usecases.analysis.LegHistogram; -import java.util.Map; - public final class RunChessboard { public static void main(String[] args){ diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java index de2e7d3eb5e..2561968e1f2 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/RunPassengerAlongWithCarriers.java @@ -23,6 +23,8 @@ import com.google.inject.Provider; import jakarta.inject.Inject; +import java.net.URL; +import java.util.Map; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Network; @@ -48,9 +50,6 @@ import org.matsim.freight.carriers.usecases.analysis.CarrierScoreStats; import org.matsim.freight.carriers.usecases.analysis.LegHistogram; -import java.net.URL; -import java.util.Map; - final class RunPassengerAlongWithCarriers { final static URL url = ExamplesUtils.getTestScenarioURL("freight-chessboard-9x9"); diff --git a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java index 0051af3de81..a043c85d958 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/carriers/usecases/chessboard/SelectBestPlanAndOptimizeItsVehicleRouteFactory.java @@ -30,6 +30,8 @@ import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; import com.graphhopper.jsprit.core.util.Solutions; import com.graphhopper.jsprit.io.algorithm.VehicleRoutingAlgorithms; +import java.net.URL; +import java.util.Collection; import org.matsim.api.core.v01.network.Network; import org.matsim.core.replanning.GenericPlanStrategy; import org.matsim.core.replanning.GenericPlanStrategyImpl; @@ -46,9 +48,6 @@ import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts; import org.matsim.freight.carriers.jsprit.NetworkRouter; -import java.net.URL; -import java.util.Collection; - final class SelectBestPlanAndOptimizeItsVehicleRouteFactory { final URL url = ExamplesUtils.getTestScenarioURL("freight-chessboard-9x9"); diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/FreightLogisticsConfigGroup.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/FreightLogisticsConfigGroup.java index b346cd92a38..bab230379ba 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/FreightLogisticsConfigGroup.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/FreightLogisticsConfigGroup.java @@ -22,7 +22,6 @@ package org.matsim.freight.logistics; import java.net.URL; -import java.util.Arrays; import java.util.Map; import org.matsim.core.config.ConfigGroup; import org.matsim.core.config.ReflectiveConfigGroup; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java index 54e7040f67b..0da2e144cbc 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/LSPControllerListener.java @@ -26,7 +26,6 @@ import java.util.List; import java.util.Set; import javax.annotation.Nullable; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/analysis/Driver2VehicleEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/analysis/Driver2VehicleEventHandler.java index 5cfde304930..906541a3e41 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/analysis/Driver2VehicleEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/analysis/Driver2VehicleEventHandler.java @@ -21,6 +21,8 @@ package org.matsim.freight.logistics.analysis; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent; import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent; @@ -29,9 +31,6 @@ import org.matsim.api.core.v01.population.Person; import org.matsim.vehicles.Vehicle; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - /** * Basic event handler that collects the relation between vehicles and drivers. * Necessary since link enter and leave events do not contain the driver anymore. diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/events/LspEventsReader.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/events/LspEventsReader.java index 1380da69044..b65cf79b7c0 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/events/LspEventsReader.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/events/LspEventsReader.java @@ -23,11 +23,10 @@ import java.util.Map; import java.util.TreeMap; - -import org.matsim.freight.logistics.LSP; import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.MatsimEventsReader; import org.matsim.freight.carriers.events.CarrierEventsReaders; +import org.matsim.freight.logistics.LSP; /** * Creates an {@link MatsimEventsReader} that also handles the {@link diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java index b4aee003ecf..7cfc3b4ca82 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTestOutput.java @@ -25,7 +25,6 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java index bdbd71224f8..59fb551c08b 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java @@ -34,7 +34,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java index ee58841c0a6..1853cc27331 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java @@ -33,7 +33,6 @@ import org.matsim.core.config.Config; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java index e6b9e33265b..1ed5bcc050d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java @@ -44,7 +44,6 @@ import java.io.IOException; import java.util.*; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; @@ -73,7 +72,6 @@ import org.matsim.freight.logistics.shipment.LspShipment; import org.matsim.vehicles.VehicleType; - /** * This bases on {@link ExampleGroceryDeliveryMultipleChains}. * Now it will include two different LSPs diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java index 01dd11e9435..cd397b50937 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java @@ -23,7 +23,6 @@ import java.io.IOException; import java.util.*; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.analysis.personMoney.PersonMoneyEventsAnalysisModule; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomLogisticChainShipmentAssigner.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomLogisticChainShipmentAssigner.java index 7477d0e0ac3..6cd0c2389c6 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomLogisticChainShipmentAssigner.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomLogisticChainShipmentAssigner.java @@ -26,9 +26,9 @@ import java.util.Random; import org.matsim.core.gbl.Gbl; import org.matsim.core.gbl.MatsimRandom; +import org.matsim.freight.logistics.InitialShipmentAssigner; import org.matsim.freight.logistics.LSPPlan; import org.matsim.freight.logistics.LogisticChain; -import org.matsim.freight.logistics.InitialShipmentAssigner; import org.matsim.freight.logistics.shipment.LspShipment; /** diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomShiftingStrategyFactory.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomShiftingStrategyFactory.java index ee25acd18e5..45ae711dcf1 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomShiftingStrategyFactory.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/multipleChains/RandomShiftingStrategyFactory.java @@ -25,7 +25,6 @@ import java.util.Iterator; import java.util.List; import java.util.Random; - import org.matsim.core.config.groups.ScoringConfigGroup; import org.matsim.core.gbl.MatsimRandom; import org.matsim.core.replanning.GenericPlanStrategy; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/RedRequirement.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/RedRequirement.java index ea51cb3a65a..0422427ab30 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/RedRequirement.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/RedRequirement.java @@ -45,7 +45,6 @@ import org.matsim.freight.logistics.LogisticChain; import org.matsim.freight.logistics.shipment.LspShipmentRequirement; - /*package-private*/ class RedRequirement implements LspShipmentRequirement { static final String RED = "red"; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java index 88d29d56327..26959c6081d 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java @@ -25,7 +25,6 @@ import java.util.Collection; import java.util.Collections; import java.util.Random; - import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java index bbd9235ca64..deb8e984b2e 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java @@ -6,7 +6,6 @@ import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; import java.util.List; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java index 708f57974e4..0534d285f7c 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java @@ -22,7 +22,6 @@ package org.matsim.freight.logistics.resourceImplementations; import java.util.Objects; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java index 249b5a76031..51704f91cb9 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java @@ -22,7 +22,6 @@ package org.matsim.freight.logistics.resourceImplementations; import java.util.*; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.locationtech.jts.util.Assert; diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/LSPTourStartEventHandler.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/LSPTourStartEventHandler.java index 4b3ff6a8daf..46a0ae0e709 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/LSPTourStartEventHandler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/LSPTourStartEventHandler.java @@ -21,6 +21,7 @@ package org.matsim.freight.logistics.resourceImplementations; +import java.util.Objects; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; import org.matsim.freight.carriers.Carrier; @@ -40,8 +41,6 @@ import org.matsim.freight.logistics.shipment.LspShipmentPlanElement; import org.matsim.freight.logistics.shipment.LspShipmentUtils; -import java.util.Objects; - /*package-private*/ class LSPTourStartEventHandler implements CarrierTourStartEventHandler, LSPSimulationTracker { diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/TransshipmentHubScheduler.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/TransshipmentHubScheduler.java index e4d151903e9..6c6081c81bf 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/TransshipmentHubScheduler.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/resourceImplementations/TransshipmentHubScheduler.java @@ -29,10 +29,10 @@ import org.matsim.freight.logistics.LSPResourceScheduler; import org.matsim.freight.logistics.LogisticChainElement; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils.TranshipmentHubSchedulerBuilder; +import org.matsim.freight.logistics.shipment.LspShipment; import org.matsim.freight.logistics.shipment.LspShipmentPlan; import org.matsim.freight.logistics.shipment.LspShipmentPlanElement; import org.matsim.freight.logistics.shipment.LspShipmentUtils; -import org.matsim.freight.logistics.shipment.LspShipment; /*package-private*/ class TransshipmentHubScheduler extends LSPResourceScheduler { diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierEventsReadersTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierEventsReadersTest.java index bf1cb7be9a6..2b1c2ead062 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierEventsReadersTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierEventsReadersTest.java @@ -20,6 +20,10 @@ package org.matsim.freight.carriers; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.ArrayList; +import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -36,12 +40,6 @@ import org.matsim.testcases.utils.EventsCollector; import org.matsim.vehicles.Vehicle; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.util.ArrayList; -import java.util.List; - - /** * @author Kai Martins-Turner (kturner) * @author Niclas Richter (nixlaos) diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanReaderV1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanReaderV1Test.java index 38749fbabdf..8092ccfd02d 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanReaderV1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanReaderV1Test.java @@ -26,7 +26,6 @@ import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.core.population.routes.NetworkRoute; -import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.Tour.Leg; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2Test.java index 0deffa73889..9d445358dc3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2Test.java @@ -21,8 +21,12 @@ package org.matsim.freight.carriers; -import org.junit.jupiter.api.BeforeEach; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.*; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; @@ -32,16 +36,10 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.gbl.Gbl; import org.matsim.core.scenario.ScenarioUtils; -import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.*; - public class CarrierPlanXmlReaderV2Test { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2WithDtdTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2WithDtdTest.java index fb12a37ff82..db3141cf8cb 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2WithDtdTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlReaderV2WithDtdTest.java @@ -21,20 +21,18 @@ package org.matsim.freight.carriers; +import java.util.*; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.core.gbl.Gbl; -import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; -import java.util.*; - public class CarrierPlanXmlReaderV2WithDtdTest { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1Test.java index f4840b577ae..630ba406b86 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV1Test.java @@ -24,7 +24,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; -import org.matsim.freight.carriers.*; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2Test.java index 46444ed07d3..28f155f2549 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2Test.java @@ -21,20 +21,18 @@ package org.matsim.freight.carriers; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.TransportMode; -import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; -import java.util.*; - -import static org.junit.jupiter.api.Assertions.*; - public class CarrierPlanXmlWriterV2Test { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1Test.java index b3a12fdb60f..f331ff0b671 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierPlanXmlWriterV2_1Test.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers; +import static org.junit.jupiter.api.Assertions.*; + +import java.util.*; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -30,10 +33,6 @@ import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; -import java.util.*; - -import static org.junit.jupiter.api.Assertions.*; - public class CarrierPlanXmlWriterV2_1Test { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierReadWriteV2_1Test.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierReadWriteV2_1Test.java index 71d69e6d216..4ce250f11e3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierReadWriteV2_1Test.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierReadWriteV2_1Test.java @@ -21,13 +21,11 @@ package org.matsim.freight.carriers; +import java.util.Collections; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import org.matsim.freight.carriers.*; import org.matsim.testcases.MatsimTestUtils; -import java.util.Collections; - public class CarrierReadWriteV2_1Test { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeLoaderTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeLoaderTest.java index 97954bb151d..e6c7333ae73 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeLoaderTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeLoaderTest.java @@ -21,12 +21,11 @@ package org.matsim.freight.carriers; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; -import org.matsim.freight.carriers.*; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderTest.java index 3a2f5a5648e..ec715e0aa44 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeReaderTest.java @@ -21,6 +21,9 @@ package org.matsim.freight.carriers; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.BeforeEach; @@ -30,9 +33,6 @@ import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.VehicleType; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - public class CarrierVehicleTypeReaderTest { @RegisterExtension private MatsimTestUtils utils = new MatsimTestUtils() ; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeTest.java index a95fac8d1ec..36038dc0647 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeTest.java @@ -21,13 +21,12 @@ package org.matsim.freight.carriers; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.TransportMode; -import org.matsim.freight.carriers.CarrierVehicleTypes; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.*; import org.matsim.vehicles.EngineInformation.FuelType; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterTest.java index 307408885a6..0076de83c33 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarrierVehicleTypeWriterTest.java @@ -23,9 +23,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; -import org.matsim.freight.carriers.CarrierVehicleTypeReader; -import org.matsim.freight.carriers.CarrierVehicleTypeWriter; -import org.matsim.freight.carriers.CarrierVehicleTypes; import org.matsim.testcases.MatsimTestUtils; public class CarrierVehicleTypeWriterTest { diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java index 04772ee65a2..70892f49e51 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/CarriersUtilsTest.java @@ -21,18 +21,17 @@ package org.matsim.freight.carriers; +import static org.matsim.testcases.MatsimTestUtils.EPSILON; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; -import org.matsim.freight.carriers.*; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import static org.matsim.testcases.MatsimTestUtils.EPSILON; - /** */ public class CarriersUtilsTest { @@ -43,7 +42,7 @@ public class CarriersUtilsTest { @Test void testAddAndGetVehicleToCarrier() { VehicleType vehicleType = VehicleUtils.createDefaultVehicleType(); - + Carrier carrier = new CarrierImpl(Id.create("carrier", Carrier.class)); Id testVehicleId = Id.createVehicleId("testVehicle"); CarrierVehicle carrierVehicle = CarrierVehicle.newInstance(testVehicleId, Id.createLinkId("link0"),vehicleType); diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightCarriersConfigGroupTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightCarriersConfigGroupTest.java index 33a4d6736e8..5c3d053190b 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightCarriersConfigGroupTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/FreightCarriersConfigGroupTest.java @@ -21,6 +21,10 @@ package org.matsim.freight.carriers; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.matsim.core.config.Config; @@ -28,11 +32,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.freight.carriers.FreightCarriersConfigGroup.UseDistanceConstraintForTourPlanning; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.util.Map; - /** * @author mrieser / Simunto */ diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventBasedTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventBasedTest.java index c7fc851bf24..58587ab5248 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventBasedTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/analysis/FreightAnalysisEventBasedTest.java @@ -21,15 +21,14 @@ package org.matsim.freight.carriers.analysis; +import java.io.IOException; +import java.net.URL; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.testcases.MatsimTestUtils; -import java.io.IOException; -import java.net.URL; - public class FreightAnalysisEventBasedTest { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java index be381fc83a7..7a48f4c0426 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT.java @@ -21,8 +21,8 @@ package org.matsim.freight.carriers.controller; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java index 6b29b060161..d106530ef27 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT.java @@ -33,9 +33,9 @@ import org.matsim.core.config.groups.RoutingConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; -import org.matsim.freight.carriers.FreightCarriersConfigGroup; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarriersUtils; +import org.matsim.freight.carriers.FreightCarriersConfigGroup; import org.matsim.freight.carriers.ScheduledTour; import org.matsim.freight.carriers.Tour; import org.matsim.freight.carriers.mobsim.DistanceScoringFunctionFactoryForTests; diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java index 43abc654497..b9c2cbaa909 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintFromVehiclesFileTest.java @@ -21,6 +21,10 @@ package org.matsim.freight.carriers.jsprit; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.Assertions; @@ -39,18 +43,13 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.FreightCarriersConfigGroup.UseDistanceConstraintForTourPlanning; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.FreightCarriersConfigGroup.UseDistanceConstraintForTourPlanning; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutionException; - /** * * @author rewert, kturner diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java index 50b8505cb70..044be8d0f77 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/DistanceConstraintTest.java @@ -21,6 +21,10 @@ package org.matsim.freight.carriers.jsprit; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutionException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.Assertions; @@ -39,18 +43,13 @@ import org.matsim.core.utils.io.IOUtils; import org.matsim.examples.ExamplesUtils; import org.matsim.freight.carriers.*; -import org.matsim.freight.carriers.FreightCarriersConfigGroup.UseDistanceConstraintForTourPlanning; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; +import org.matsim.freight.carriers.FreightCarriersConfigGroup.UseDistanceConstraintForTourPlanning; import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.Vehicle; import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutionException; - /** * * @author rewert, kturner diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java index 7e0e4bbe12e..4d466e54bdc 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/FixedCostsTest.java @@ -27,10 +27,12 @@ import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; +import java.net.URL; +import java.util.Collection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; @@ -46,10 +48,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.net.URL; -import java.util.Collection; - - /** * @author kturner * diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java index 762a2efe08a..8b157434f38 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/IntegrationIT.java @@ -27,6 +27,7 @@ import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.reporting.SolutionPrinter; import com.graphhopper.jsprit.core.util.Solutions; +import java.util.concurrent.ExecutionException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -41,8 +42,6 @@ import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts.Builder; import org.matsim.testcases.MatsimTestUtils; -import java.util.concurrent.ExecutionException; - public class IntegrationIT { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java index 15f7a1a7c86..d952de404bf 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/MatsimTransformerTest.java @@ -21,6 +21,8 @@ package org.matsim.freight.carriers.jsprit; +import static org.junit.jupiter.api.Assertions.*; + import com.graphhopper.jsprit.core.problem.Location; import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.job.Job; @@ -31,6 +33,9 @@ import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; import com.graphhopper.jsprit.core.problem.vehicle.VehicleImpl; import com.graphhopper.jsprit.core.problem.vehicle.VehicleTypeImpl; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; @@ -44,12 +49,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.*; - public class MatsimTransformerTest { @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java index 64e7eeba641..d58cadf388a 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/jsprit/NetworkBasedTransportCostsTest.java @@ -21,9 +21,13 @@ package org.matsim.freight.carriers.jsprit; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import com.graphhopper.jsprit.core.problem.Location; import com.graphhopper.jsprit.core.problem.driver.Driver; import com.graphhopper.jsprit.core.problem.vehicle.Vehicle; +import java.util.Arrays; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; @@ -43,12 +47,6 @@ import org.matsim.vehicles.VehicleUtils; import org.matsim.vehicles.VehiclesFactory; -import java.util.Arrays; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - - public class NetworkBasedTransportCostsTest { diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java index f86e4fa825b..89bec08003a 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/DistanceScoringFunctionFactoryForTests.java @@ -22,6 +22,8 @@ package org.matsim.freight.carriers.mobsim; import jakarta.inject.Inject; +import java.util.HashSet; +import java.util.Set; import org.junit.jupiter.api.Disabled; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -38,14 +40,11 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierConstants; -import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; +import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; -import java.util.HashSet; -import java.util.Set; - @Disabled public class DistanceScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java index 460c0e0d735..87e50dacbe5 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/ScoringFunctionFactoryForTests.java @@ -21,6 +21,8 @@ package org.matsim.freight.carriers.mobsim; +import java.util.HashSet; +import java.util.Set; import org.junit.jupiter.api.Disabled; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -37,14 +39,11 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierConstants; -import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; +import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; -import java.util.HashSet; -import java.util.Set; - @Disabled public class ScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java index fb774d2d9e2..c61519ea613 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/StrategyManagerFactoryForTests.java @@ -23,6 +23,7 @@ import com.google.inject.Provider; import jakarta.inject.Inject; +import java.util.Map; import org.junit.jupiter.api.Disabled; import org.matsim.api.core.v01.TransportMode; import org.matsim.api.core.v01.network.Link; @@ -36,13 +37,11 @@ import org.matsim.core.router.util.TravelTime; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierPlan; +import org.matsim.freight.carriers.controller.CarrierControllerUtils; import org.matsim.freight.carriers.controller.CarrierReRouteVehicles; import org.matsim.freight.carriers.controller.CarrierStrategyManager; -import org.matsim.freight.carriers.controller.CarrierControllerUtils; import org.matsim.vehicles.Vehicle; -import java.util.Map; - @Disabled public class StrategyManagerFactoryForTests implements Provider{ diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java index e5bdc0b131a..3b3f8965acf 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/mobsim/TimeScoringFunctionFactoryForTests.java @@ -22,6 +22,8 @@ package org.matsim.freight.carriers.mobsim; import jakarta.inject.Inject; +import java.util.HashSet; +import java.util.Set; import org.junit.jupiter.api.Disabled; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; @@ -38,14 +40,11 @@ import org.matsim.deprecated.scoring.ScoringFunctionAccumulator.LegScoring; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierConstants; -import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.CarrierVehicle; +import org.matsim.freight.carriers.CarriersUtils; import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory; import org.matsim.vehicles.Vehicle; -import java.util.HashSet; -import java.util.Set; - @Disabled public class TimeScoringFunctionFactoryForTests implements CarrierScoringFunctionFactory{ diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsIT.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsIT.java index 76738a411a9..3abd2a401c2 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsIT.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsIT.java @@ -26,8 +26,9 @@ import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; -import org.junit.jupiter.api.BeforeEach; +import java.util.Collection; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; @@ -45,9 +46,6 @@ import org.matsim.vehicles.*; import org.matsim.vehicles.EngineInformation.FuelType; -import java.util.Collection; - - //TODO: length of routes (legs) AND end time of route are missing. /** * @author kturner diff --git a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java index 24968c4d1e6..a72c68dd3b3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/carriers/utils/CarrierControllerUtilsTest.java @@ -28,10 +28,12 @@ import com.graphhopper.jsprit.core.problem.VehicleRoutingProblem; import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution; import com.graphhopper.jsprit.core.util.Solutions; +import java.net.URL; +import java.util.Collection; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; @@ -41,7 +43,6 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.PlansConfigGroup; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.network.NetworkUtils; @@ -58,9 +59,6 @@ import org.matsim.testcases.MatsimTestUtils; import org.matsim.vehicles.*; -import java.net.URL; -import java.util.Collection; - public class CarrierControllerUtilsTest{ @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/events/LspEventsReaderTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/events/LspEventsReaderTest.java index 5455ab846ef..e94073aace3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/events/LspEventsReaderTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/events/LspEventsReaderTest.java @@ -4,8 +4,8 @@ import java.io.ByteArrayOutputStream; import java.util.ArrayList; import java.util.List; -import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.events.Event; import org.matsim.core.api.experimental.events.EventsManager; @@ -63,4 +63,4 @@ private static class TestEventHandler handledEvents.add(event); } } -} \ No newline at end of file +} diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirectTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirectTest.java index 0e413a0719a..53fdd3eebcc 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirectTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirectTest.java @@ -25,8 +25,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.testcases.MatsimTestUtils; public class ExampleSchedulingOfTransportChainHubsVsDirectTest { diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGridTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGridTest.java index d2fce96569c..525936facc3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGridTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGridTest.java @@ -25,8 +25,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.testcases.MatsimTestUtils; public class ExampleTwoEchelonGridTest { diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java index ea611a35edc..eaa6c22e3f4 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java @@ -25,8 +25,8 @@ import java.util.*; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java index e0dd95c3fad..acfb73567df 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java @@ -28,8 +28,8 @@ import java.util.*; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -39,7 +39,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java index 2e5f813c721..39139e17be7 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java @@ -21,12 +21,11 @@ package org.matsim.freight.logistics.examples.lspScoring; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Scenario; import org.matsim.core.config.Config; import org.matsim.core.config.groups.VspExperimentalConfigGroup; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.freight.logistics.LSP; import org.matsim.freight.logistics.LSPUtils; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java index cd73679404e..e18204c2f99 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java @@ -26,8 +26,8 @@ import java.util.*; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -37,7 +37,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSPTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSPTest.java index 89c841a26bb..8c50a3b20b3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSPTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSPTest.java @@ -25,8 +25,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.testcases.MatsimTestUtils; /** @@ -52,4 +52,4 @@ public void testForRuntimeExceptionsAndCompareEvents() { MatsimTestUtils.assertEqualEventsFiles(utils.getClassInputDirectory() + "output_events.xml.gz", utils.getOutputDirectory() + "output_events.xml.gz" ); } -} \ No newline at end of file +} diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java index 6b815ecf943..b98dd24e4ca 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java @@ -28,8 +28,8 @@ import java.util.Collections; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java index 9858cddf1a3..47dac541f34 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java @@ -21,12 +21,14 @@ package org.matsim.freight.logistics.examples.simulationTrackers; +import static org.junit.jupiter.api.Assertions.*; + import java.util.*; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -36,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -59,8 +60,6 @@ import org.matsim.vehicles.VehicleType; import org.matsim.vehicles.VehicleUtils; -import static org.junit.jupiter.api.Assertions.*; - public class CollectionTrackerTest { private static final Logger log = LogManager.getLogger(CollectionTrackerTest.class); @RegisterExtension diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/io/LSPReadWriteTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/io/LSPReadWriteTest.java index 9d3083cca8b..82a2d86a835 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/io/LSPReadWriteTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/io/LSPReadWriteTest.java @@ -1,8 +1,8 @@ package org.matsim.freight.logistics.io; import java.util.Collections; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.freight.carriers.CarrierPlanXmlReader; import org.matsim.freight.carriers.CarrierVehicleTypeReader; import org.matsim.freight.carriers.CarrierVehicleTypes; From e81ec2acccfa698bdb63399f612491718686f655 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Sun, 1 Dec 2024 23:03:54 +0100 Subject: [PATCH 3/5] optimize imports --- .../logistics/lspMobsimTests/CollectionLSPMobsimTest.java | 4 +--- .../logistics/lspMobsimTests/CompleteLSPMobsimTest.java | 3 +-- .../lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java | 3 +-- .../logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java | 3 +-- .../logistics/lspMobsimTests/MainRunLSPMobsimTest.java | 3 +-- .../logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java | 3 +-- .../MultipleIterationsCollectionLSPMobsimTest.java | 3 +-- .../MultipleIterationsCompleteLSPMobsimTest.java | 3 +-- .../MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java | 3 +-- .../MultipleIterationsFirstReloadLSPMobsimTest.java | 3 +-- .../MultipleIterationsMainRunLSPMobsimTest.java | 3 +-- .../MultipleShipmentsCollectionLSPMobsimTest.java | 3 +-- .../MultipleShipmentsCompleteLSPMobsimTest.java | 3 +-- .../MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java | 3 +-- .../MultipleShipmentsFirstReloadLSPMobsimTest.java | 3 +-- .../lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java | 3 +-- .../RepeatedMultipleShipmentsCompleteLSPMobsimTest.java | 3 +-- 17 files changed, 17 insertions(+), 35 deletions(-) diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java index c7fcfa27c7f..df196d86233 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java @@ -31,18 +31,16 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; -import org.matsim.api.core.v01.events.Event; 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.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.events.handler.BasicEventHandler; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java index 4d6983fb661..4a17e1dbc4d 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -24,8 +24,8 @@ import java.util.*; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -35,7 +35,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java index eec97b8a5d1..3294ed1b7c2 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java index a23d4eca1e5..d5ba96be6d0 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java index cf0e4895fd7..aac62ebf43a 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java index 282b578270f..57a4886fba3 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java index af1c3f08741..910cd4ce3ea 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java index eeb0d34dce8..8b2a05157c6 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java index 4edcebb8a13..14d2f7a263f 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java index f0167615a8c..fb6fb93f516 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java index 741b2838909..8dac1d91417 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java index b68714fd639..6a6c4aafdb6 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java index b4553664f91..984027f50d9 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -29,8 +29,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -40,7 +40,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java index e9c598334d1..37d260c2f28 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java index e48ed12439d..7b75f3a8fd7 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java index 5d383570486..d0119ec03a2 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java index 03e916f8b15..f14a75d3802 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -27,8 +27,8 @@ import java.util.LinkedList; import java.util.List; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.extension.RegisterExtension; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.RegisterExtension; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; @@ -38,7 +38,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; From 65846ba43ab2018556121927c157e3be1f542df2 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Sun, 1 Dec 2024 23:05:03 +0100 Subject: [PATCH 4/5] fix compile error --- .../logistics/examples/lspScoring/ExampleLSPScoring.java | 9 ++++----- .../examples/lspScoring/ExampleLSPScoringTest.java | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java index 0d3d9fcb155..69f9cc76a59 100644 --- a/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java +++ b/contribs/freight/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java @@ -33,7 +33,6 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; -import org.matsim.core.controler.Controler; import org.matsim.core.controler.Controller; import org.matsim.core.controler.ControllerUtils; import org.matsim.core.controler.OutputDirectoryHierarchy.OverwriteFileSetting; @@ -164,22 +163,22 @@ public static void main(String[] args) { Scenario scenario = prepareScenario(config); - Controler controler = prepareControler(scenario); + Controller controller = prepareController(scenario); // The VSP default settings are designed for person transport simulation. After talking to Kai, // they will be set to WARN here. Kai MT may'23 - controler + controller .getConfig() .vspExperimental() .setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); - controler.run(); + controller.run(); for (LSP lsp2 : LSPUtils.getLSPs(scenario).getLSPs().values()) { System.out.println("The tip of all customers was: " + lsp2.getSelectedPlan().getScore()); } } - static Controller prepareControler(Scenario scenario) { + static Controller prepareController(Scenario scenario) { // Start the Mobsim one iteration is sufficient for scoring Controller controller = ControllerUtils.createController(scenario); controller.addOverridingModule(new LSPModule()); diff --git a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java index 39139e17be7..c6634e58239 100644 --- a/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java +++ b/contribs/freight/src/test/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoringTest.java @@ -44,7 +44,7 @@ public void testMain() { Scenario scenario = ExampleLSPScoring.prepareScenario(config); - Controller controller = ExampleLSPScoring.prepareControler(scenario); + Controller controller = ExampleLSPScoring.prepareController(scenario); //The VSP default settings are designed for person transport simulation. After talking to Kai, they will be set to WARN here. Kai MT may'23 controller.getConfig().vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); From 900ed647c178b6ddf595ca42200919c509468b37 Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Sun, 1 Dec 2024 23:21:55 +0100 Subject: [PATCH 5/5] also move test input --- .../carrierPlansEquils.xml | 0 .../EquilWithCarrierWithPersonsIT/network.xml | 0 .../EquilWithCarrierWithPersonsIT/plans100.xml | 0 .../carrierPlansEquils.xml | 0 .../EquilWithCarrierWithoutPersonsIT/network.xml | 0 .../output_events.xml.gz | Bin .../{controler => controller}/vehicleTypes_v2.xml | 0 7 files changed, 0 insertions(+), 0 deletions(-) rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithPersonsIT/network.xml (100%) mode change 100755 => 100644 rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithPersonsIT/plans100.xml (100%) rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml (100%) rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithoutPersonsIT/network.xml (100%) mode change 100755 => 100644 rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz (100%) rename contribs/freight/test/input/org/matsim/freight/carriers/{controler => controller}/vehicleTypes_v2.xml (100%) diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/network.xml old mode 100755 new mode 100644 similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/network.xml diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/plans100.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/plans100.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithPersonsIT/plans100.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithPersonsIT/plans100.xml diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/carrierPlansEquils.xml diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/network.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/network.xml old mode 100755 new mode 100644 similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/network.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/network.xml diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz b/contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/EquilWithCarrierWithoutPersonsIT/output_events.xml.gz diff --git a/contribs/freight/test/input/org/matsim/freight/carriers/controler/vehicleTypes_v2.xml b/contribs/freight/test/input/org/matsim/freight/carriers/controller/vehicleTypes_v2.xml similarity index 100% rename from contribs/freight/test/input/org/matsim/freight/carriers/controler/vehicleTypes_v2.xml rename to contribs/freight/test/input/org/matsim/freight/carriers/controller/vehicleTypes_v2.xml