diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChain.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChain.java index c4c49942..a601fee7 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChain.java +++ b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChain.java @@ -152,7 +152,7 @@ private static LSP createInitialLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .build(); // The LogisticsSolutionElement for the main run Resource is created diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java index 38d9d978..cab7575d 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java +++ b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfTransportChainHubsVsDirect.java @@ -267,7 +267,7 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType .setFromLinkId(depotLinkId) .setToLinkId(hubLinkId) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .build(); mainRunElement = diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java index 7e0af097..348b5a5f 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java +++ b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid.java @@ -289,7 +289,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java index 7f52bc80..b0578ce0 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java +++ b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java @@ -299,7 +299,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java b/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java index 3368ad98..4b1f08d5 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java +++ b/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfTransportChain.java @@ -153,7 +153,7 @@ private static LSP createInitialLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .build(); // The LogisticsSolutionElement for the main run Resource is created diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java index 5499de1c..ee01be29 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleGroceryDeliveryMultipleChains.java @@ -231,7 +231,7 @@ private static LSP createLSP(Scenario scenario) { mainCarrier, scenario.getNetwork()) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java index 9a3927a0..165d45b9 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java @@ -202,7 +202,7 @@ private static LSP createLSP(Scenario scenario) { mainCarrier1, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -319,7 +319,7 @@ private static LSP createLSP(Scenario scenario) { mainCarrier, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java index cbab951e..1184bd82 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java @@ -206,7 +206,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrierLeft, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LEFT_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -284,7 +284,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_RIGHT_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java index 2ca444c0..4c078ffc 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java @@ -289,7 +289,7 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp mainCarrier, scenario.getNetwork()) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(hubLinkId) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java index 9d49bfab..ebdaf658 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java @@ -315,7 +315,7 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp mainCarrier, scenario.getNetwork()) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(hubLinkId) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java index 64f60616..db6726a9 100644 --- a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java +++ b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java @@ -322,7 +322,7 @@ public void endTag(String name, String content, Stack context) { case mainRunCarrier -> lspResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(currentCarrier, null) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(null)) .build(); case distributionCarrier -> lspResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierResource.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierResource.java index c5b1f41d..8dd7eb1f 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierResource.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierResource.java @@ -26,7 +26,6 @@ import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.network.Link; -import org.matsim.api.core.v01.network.Network; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.logistics.*; import org.matsim.freight.logistics.resourceImplementations.ResourceImplementationUtils.MainRunCarrierResourceBuilder; @@ -43,7 +42,6 @@ private final MainRunCarrierScheduler mainRunScheduler; private final ResourceImplementationUtils.VehicleReturn vehicleReturn; - private final Network network; MainRunCarrierResource(MainRunCarrierResourceBuilder builder) { super(builder.getId()); @@ -58,7 +56,6 @@ log.warn("Return behaviour was not specified. Using the following setting as default: {}", ResourceImplementationUtils.VehicleReturn.endAtToLink); this.vehicleReturn = ResourceImplementationUtils.VehicleReturn.endAtToLink; } - this.network = builder.getNetwork(); } @Override @@ -85,10 +82,6 @@ public Carrier getCarrier() { return carrier; } - public Network getNetwork() { - return network; - } - public ResourceImplementationUtils.VehicleReturn getVehicleReturn() { return vehicleReturn; } diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java index 76844e08..af84fd40 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/MainRunCarrierScheduler.java @@ -23,6 +23,7 @@ import java.util.*; import org.matsim.api.core.v01.Id; +import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Link; import org.matsim.core.population.routes.NetworkRoute; import org.matsim.freight.carriers.*; @@ -48,14 +49,16 @@ * shipments into the vehicle * has passed. */ /*package-private*/ class MainRunCarrierScheduler extends LSPResourceScheduler { - + private Carrier carrier; private MainRunCarrierResource resource; private ArrayList pairs; + private final Scenario scenario; private int tourIdIndex = 1; // Have unique TourIds for the MainRun. - /*package-private*/ MainRunCarrierScheduler() { + /*package-private*/ MainRunCarrierScheduler(Scenario scenario) { this.pairs = new ArrayList<>(); + this.scenario = scenario; } @Override @@ -117,7 +120,7 @@ private CarrierPlan createPlan(Carrier carrier, List tuples // statt! NetworkBasedTransportCosts.Builder tpcostsBuilder = NetworkBasedTransportCosts.Builder.newInstance( - resource.getNetwork(), + scenario.getNetwork(), ResourceImplementationUtils.getVehicleTypeCollection(resource.getCarrier())); NetworkBasedTransportCosts netbasedTransportcosts = tpcostsBuilder.build(); Collection tours = new ArrayList<>(); @@ -193,14 +196,14 @@ private double scorePlanManually(CarrierPlan plan) { // distance NetworkRoute route = (NetworkRoute) leg.getRoute(); for (Id linkId : route.getLinkIds()) { - distance = distance + resource.getNetwork().getLinks().get(linkId).getLength(); + distance = distance + scenario.getNetwork().getLinks().get(linkId).getLength(); } if (route.getEndLinkId() != route .getStartLinkId()) { // Do not calculate any distance, if start and endpoint are // identical distance = - distance + resource.getNetwork().getLinks().get(route.getEndLinkId()).getLength(); + distance + scenario.getNetwork().getLinks().get(route.getEndLinkId()).getLength(); } // travel time (exp.) diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java index a68996bb..5d68cbd1 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java @@ -214,7 +214,7 @@ public static void setCarrierType(Carrier carrier, CARRIER_TYPE carrierType) { } /** - * Utils method to create a DistributionCarrierScheduler + * Utils method to create a DistributionCarrierScheduler * TODO: In the future, the scheduler should get the scenario via injection. This here is only a dirty workaround. KMT'Aug'24 * * @param scenario the scenario @@ -224,7 +224,7 @@ public static DistributionCarrierScheduler createDefaultDistributionCarrierSched } /** - * Utils method to create a Collection CarrierScheduler + * Utils method to create a CollectionCarrierScheduler * TODO: In the future, the scheduler should get the scenario via injection. This here is only a dirty workaround. KMT'Aug'24 * * @param scenario the scenario @@ -233,8 +233,14 @@ public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler return new CollectionCarrierScheduler(scenario); } - public static MainRunCarrierScheduler createDefaultMainRunCarrierScheduler() { - return new MainRunCarrierScheduler(); + /** + * Utils method to create a MainRunCarrierScheduler + * TODO: In the future, the scheduler should get the scenario via injection. This here is only a dirty workaround. KMT'Aug'24 + * + * @param scenario the scenario + */ + public static MainRunCarrierScheduler createDefaultMainRunCarrierScheduler(Scenario scenario) { + return new MainRunCarrierScheduler(scenario); } public enum VehicleReturn { diff --git a/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java b/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java index c055a985..8d9f1c14 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java @@ -83,7 +83,7 @@ public void initialize() { carrier.setCarrierCapabilities(capabilities); mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(carrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")).setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java index 3a7df87b..d1f2a7c3 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java @@ -79,7 +79,7 @@ public void initialize() { mainRunCarrierResourceBuilder.setCarrierCapabilities(capabilities); mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrierResourceBuilder, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java index 9b8ad303..752712cd 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java @@ -135,7 +135,7 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java index cc6c21af..2a591b4e 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java @@ -128,7 +128,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java index 8f790063..ab7d6927 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -144,7 +144,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java index 3cf6ba14..13f7eaf4 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java @@ -150,7 +150,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java index bf2828af..ef553ae6 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java @@ -148,7 +148,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java index 00ad9fb2..43a9e80d 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java @@ -98,7 +98,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java index fc842f82..b16e8ab3 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -155,7 +155,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java index 38b54b1e..8e5ffa19 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java @@ -156,7 +156,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java index e65bd1af..27764a2c 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java @@ -155,7 +155,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java index a34adb0d..e5a76923 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -158,7 +158,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java index 3dcd6b1e..374fae8e 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java @@ -155,7 +155,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java index 30cdce07..8eebf67e 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java @@ -149,7 +149,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java index 38b2d2a8..30b10ac5 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -150,7 +150,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java index 46906141..d9a7faee 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java @@ -129,7 +129,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java index 407e468d..65e1c095 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java @@ -133,7 +133,7 @@ public void initialize() { LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java index e703030f..f971ff90 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java @@ -145,7 +145,7 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java index 1de1a3d1..3b923b04 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java @@ -137,7 +137,7 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java index c225a18e..9110578a 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java @@ -147,7 +147,7 @@ public void initialize() { mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java index 3e6f434b..6b1da45e 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java @@ -137,7 +137,7 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java index 061fd986..1b4fc2ad 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java @@ -145,7 +145,7 @@ public void initialize() { mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(Id.createLinkId(toLinkId)) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java index 014873e4..f4a25f47 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java @@ -145,7 +145,7 @@ public void initialize() { mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(Id.createLinkId(toLinkId)) .build();