diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfInitialPlan.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfInitialPlan.java index 3d22cd08..355331eb 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfInitialPlan.java +++ b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleSchedulingOfInitialPlan.java @@ -44,7 +44,7 @@ /*package-private*/ class ExampleSchedulingOfInitialPlan { - private static LSP createInitialLSP(Network network) { + private static LSP createInitialLSP(Scenario scenario) { // The Carrier for the resource of the sole LogisticsSolutionElement of the LSP is created Id carrierId = Id.create("CollectionCarrier", Carrier.class); @@ -73,9 +73,10 @@ private static LSP createInitialLSP(Network network) { // The Resource i.e. the Resource is created LSPResource collectionResource = - ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) + ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( + carrier, scenario.getNetwork()) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -161,7 +162,7 @@ public static void main(String[] args) { Network network = scenario.getNetwork(); // Create LSP and lspShipments - LSP lsp = createInitialLSP(network); + LSP lsp = createInitialLSP(scenario); Collection lspShipments = createInitialLSPShipments(network); // assign the lspShipments to the LSP 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 e26cdccc..f5f15572 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 @@ -84,7 +84,7 @@ private static LSP createInitialLSP(Scenario scenario) { ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( collectionCarrier, network) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -222,7 +222,7 @@ private static LSP createInitialLSP(Scenario scenario) { // The scheduler for the Resource is created and added. This is where jsprit comes into play. distributionResourceBuilder.setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()); + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)); LSPResource distributionResource = distributionResourceBuilder.build(); // The adapter is now inserted into the corresponding LogisticsSolutionElement of the only 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 b9bae50c..1ac92435 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 @@ -331,7 +331,7 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType distributionCarrier, network) .setLocationLinkId(hubLinkId) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); // (The scheduler is where jsprit comes into play.) @@ -374,7 +374,7 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType directDistributionCarrier, network) .setLocationLinkId(depotLinkId) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); // (The scheduler is where jsprit comes into play.) 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 4f5c5f2c..5a0800a5 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 @@ -251,7 +251,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( directCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement directCarrierElement = @@ -344,7 +344,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = 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 86f43c50..f3c1ff8d 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 @@ -261,7 +261,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( directCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement directCarrierElement = @@ -354,7 +354,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = diff --git a/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java b/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java index 3892e49e..c4bfdec1 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java +++ b/src/main/java/org/matsim/freight/logistics/examples/lspScoring/ExampleLSPScoring.java @@ -54,7 +54,7 @@ private ExampleLSPScoring() {} - private static LSP createLSPWithScorer(Network network) { + private static LSP createLSPWithScorer(Scenario scenario) { // The Carrier for the resource of the sole LogisticsSolutionElement of the LSP is created var carrierVehicleType = @@ -84,9 +84,10 @@ private static LSP createLSPWithScorer(Network network) { // The Resource i.e. the Resource is created // The scheduler for the Resource is created and added. This is where jsprit comes into play. LSPResource lspResource = - ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) + ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( + carrier, scenario.getNetwork()) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -198,7 +199,7 @@ static Scenario prepareScenario(Config config) { Scenario scenario = ScenarioUtils.loadScenario(config); // Create LSP and lspShipments - LSP lsp = createLSPWithScorer(scenario.getNetwork()); + LSP lsp = createLSPWithScorer(scenario); Collection lspShipments = createInitialLSPShipments(scenario.getNetwork()); // assign the lspShipments to the LSP diff --git a/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java b/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java index 745c366a..3685f49a 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java +++ b/src/main/java/org/matsim/freight/logistics/examples/mobsimExamples/ExampleMobsimOfSimpleLSP.java @@ -67,9 +67,8 @@ public static void main(String[] args) { .readFile("scenarios/2regions/2regions-network.xml"); // Create LSP and lspShipments - Network network = scenario.getNetwork(); - LSP lsp = createInitialLSP(network); - Collection lspShipments = createInitialLSPShipments(network); + LSP lsp = createInitialLSP(scenario); + Collection lspShipments = createInitialLSPShipments(scenario.getNetwork()); // assign the lspShipments to the LSP for (LSPShipment lspShipment : lspShipments) { @@ -153,7 +152,7 @@ public void install() { } } - private static LSP createInitialLSP(Network network) { + private static LSP createInitialLSP(Scenario scenario) { // The Carrier for the resource of the sole LogisticsSolutionElement of the LSP is created Id carrierId = Id.create("CollectionCarrier", Carrier.class); @@ -182,9 +181,9 @@ private static LSP createInitialLSP(Network network) { // The Resource i.e. the Resource is created LSPResource collectionResource = - ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) + ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, scenario.getNetwork()) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 5a666e9d..219a4a0a 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 @@ -84,7 +84,7 @@ private static LSP createInitialLSP(Scenario scenario) { ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( collectionCarrier, network) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -224,7 +224,7 @@ private static LSP createInitialLSP(Scenario scenario) { // The scheduler for the Resource is created and added. This is where jsprit comes into // play. .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); // The adapter is now inserted into the corresponding LogisticsSolutionElement of the only 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 987e1bd6..3c18e1dd 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 @@ -200,7 +200,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( singleCarrier, scenario.getNetwork()) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -280,7 +280,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, scenario.getNetwork()) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = 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 7879a8b0..31c3c98c 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 @@ -246,7 +246,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier1, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement1 = @@ -290,7 +290,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( singleCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -363,7 +363,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java index 2310fd00..9e8b8685 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChains.java @@ -198,7 +198,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( singleCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -237,7 +237,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( carrierLeft, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = @@ -261,7 +261,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( carrierRight, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); rightCarrierElement = diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java index d5793b72..0951a1e2 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java +++ b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleOneEchelonChainsReplanning.java @@ -216,7 +216,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( singleCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -258,7 +258,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( carrierLeft, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = @@ -282,7 +282,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( carrierRight, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); rightCarrierElement = 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 c028362f..7bfb787e 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 @@ -250,7 +250,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrierLeft, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElementLeft = @@ -328,7 +328,7 @@ private static LSP createLSP(Scenario scenario) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, network) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = 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 38b73ce9..4ce270ef 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 @@ -338,7 +338,7 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, scenario.getNetwork()) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = @@ -410,7 +410,7 @@ private static LogisticChain createDirectChain(Scenario scenario, String lspName ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( directCarrier, scenario.getNetwork()) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = 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 0a2b2c99..ab7dea37 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 @@ -366,7 +366,7 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp distributionCarrier, scenario.getNetwork()) .setDistributionScheduler( // ResourceImplementationUtils.createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingUtils.getRoadPricingScheme(scenario))) - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = @@ -439,7 +439,7 @@ private static LogisticChain createDirectChain(Scenario scenario, String lspName directCarrier, scenario.getNetwork()) .setDistributionScheduler( // ResourceImplementationUtils.createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingUtils.getRoadPricingScheme(scenario))) - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = diff --git a/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/ExampleCheckRequirementsOfAssigner.java b/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/ExampleCheckRequirementsOfAssigner.java index 688a42cd..5bc0479d 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/ExampleCheckRequirementsOfAssigner.java +++ b/src/main/java/org/matsim/freight/logistics/examples/requirementsChecking/ExampleCheckRequirementsOfAssigner.java @@ -66,7 +66,9 @@ class ExampleCheckRequirementsOfAssigner { static final String ATTRIBUTE_COLOR = "color"; - public static LSP createLSPWithProperties(Network network) { + private static LSP createLSPWithProperties(Scenario scenario) { + + final Network network = scenario.getNetwork(); // Create red LogisticsSolution which has the corresponding info final Id redCarrierId = Id.create("RedCarrier", Carrier.class); @@ -96,7 +98,7 @@ public static LSP createLSPWithProperties(Network network) { LSPResource redResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier, network) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -132,7 +134,7 @@ public static LSP createLSPWithProperties(Network network) { LSPResource blueResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier, network) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -227,7 +229,7 @@ public static void main(String[] args) { Network network = scenario.getNetwork(); // Create LSP and lspShipments - LSP lsp = createLSPWithProperties(network); + LSP lsp = createLSPWithProperties(scenario); Collection lspShipments = createShipmentsWithRequirements(network); // assign the lspShipments to the LSP diff --git a/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java b/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java index fbfb5e53..7d4eadeb 100644 --- a/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java +++ b/src/main/java/org/matsim/freight/logistics/examples/simulationTrackers/ExampleSimulationTrackers.java @@ -80,7 +80,7 @@ static LSP createLSPWithTracker(Scenario scenario) { ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( carrier, scenario.getNetwork()) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 5e446b2f..92606a89 100644 --- a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java +++ b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java @@ -317,7 +317,7 @@ public void endTag(String name, String content, Stack context) { ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( currentCarrier, null) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(null)) .build(); case mainRunCarrier -> lspResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(currentCarrier, null) @@ -328,7 +328,7 @@ public void endTag(String name, String content, Stack context) { ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( currentCarrier, null) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(null)) .build(); default -> throw new IllegalStateException( "Unexpected value: " + currentCarrier.getAttributes().toString()); diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java index eda042e1..716565d6 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CarrierSchedulerUtils.java @@ -12,6 +12,7 @@ import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.network.Network; import org.matsim.contrib.roadpricing.RoadPricingScheme; +import org.matsim.contrib.roadpricing.RoadPricingUtils; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierPlan; import org.matsim.freight.carriers.CarriersUtils; @@ -28,23 +29,6 @@ public class CarrierSchedulerUtils { private static final Logger log = LogManager.getLogger(CarrierSchedulerUtils.class); - /** - * Creates a VehicleRoutingProblem from a carrier and a network and solves it with Jsprit. - *

- * This looks for me (KMT) similar to what is done in {@link org.matsim.freight.carriers.CarriersUtils#runJsprit(Scenario)}. - * So, maybe this can be more simplify. - * - * @deprecated please inline; use #solveVrpWithJsprit(Carrier, Network, RoadPricingScheme) instead. - * - * @param carrier Carrier for which the problem should be solved - * @param network the underlying network to create the network based transport costs - * @return Carrier with the solution of the VehicleRoutingProblem and the routed plan. - */ - @Deprecated - public static Carrier solveVrpWithJsprit(Carrier carrier, Network network) { - return solveVrpWithJsprit(carrier, network, null); - } - /** * Creates a VehicleRoutingProblem from a carrier and a network and solves it with Jsprit. * If a roadPricingScheme is given, the tolls are considered in the routing costs. @@ -52,14 +36,19 @@ public static Carrier solveVrpWithJsprit(Carrier carrier, Network network) { * This looks for me (KMT) similar to what is done in {@link org.matsim.freight.carriers.CarriersUtils#runJsprit(Scenario)}. * So, maybe this can be more simplify. * - * @param carrier Carrier for which the problem should be solved - * @param network the underlying network to create the network based transport costs - * @param roadPricingScheme (MATSim's) road pricing scheme from the roadpricing contrib. If null, no tolls are considered. + * @param carrier Carrier for which the problem should be solved + * @param scenario the scenario * @return Carrier with the solution of the VehicleRoutingProblem and the routed plan. */ - public static Carrier solveVrpWithJsprit( - Carrier carrier, Network network, RoadPricingScheme roadPricingScheme) { + public static Carrier solveVrpWithJsprit(Carrier carrier, Scenario scenario) { NetworkBasedTransportCosts netbasedTransportCosts; + Network network = scenario.getNetwork(); + RoadPricingScheme roadPricingScheme = null; + try { + roadPricingScheme = RoadPricingUtils.getRoadPricingScheme(scenario); + } catch (Exception e) { + log.info("Was not able getting RoadPricingScheme. Tolls cannot be considered.", e); + } if (roadPricingScheme != null) { netbasedTransportCosts = NetworkBasedTransportCosts.Builder.newInstance(network, ResourceImplementationUtils.getVehicleTypeCollection(carrier)) .setRoadPricingScheme(roadPricingScheme) diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java index 6c00ce74..601c7d21 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java @@ -24,8 +24,6 @@ import java.util.ArrayList; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.roadpricing.RoadPricingScheme; -import org.matsim.contrib.roadpricing.RoadPricingUtils; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierService; import org.matsim.freight.carriers.ScheduledTour; @@ -51,16 +49,11 @@ private ArrayList pairs; private Scenario scenario; - CollectionCarrierScheduler() { - this.pairs = new ArrayList<>(); - } - /** * Constructor for the CollectionCarrierScheduler. * TODO: In the future, the road pricing scheme should come from some the scenario: RoadPricingUtils.getRoadPricingScheme(scenario). This here is only a dirty workaround. KMT'Aug'24 * * @param scenario the road pricing scheme - * @deprecated This is only a dirty workaround. KMT'Aug'24 */ @Deprecated CollectionCarrierScheduler(Scenario scenario) { @@ -86,7 +79,7 @@ public void scheduleResource() { CarrierService carrierService = convertToCarrierService(tupleToBeAssigned); carrier.getServices().put(carrierService.getId(), carrierService); } - carrier = CarrierSchedulerUtils.solveVrpWithJsprit(carrier, resource.getNetwork(), RoadPricingUtils.getRoadPricingScheme(scenario)); + carrier = CarrierSchedulerUtils.solveVrpWithJsprit(carrier, scenario); } private CarrierService convertToCarrierService(LspShipmentWithTime tuple) { diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java index 060bbbca..1e47b581 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java @@ -28,9 +28,6 @@ import org.locationtech.jts.util.Assert; import org.matsim.api.core.v01.Id; import org.matsim.api.core.v01.Scenario; -import org.matsim.contrib.roadpricing.RoadPricingScheme; -import org.matsim.contrib.roadpricing.RoadPricingUtils; -import org.matsim.core.scenario.ScenarioUtils; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.freight.carriers.Tour.Leg; @@ -58,16 +55,12 @@ private int carrierCnt = 1; private Scenario scenario; - DistributionCarrierScheduler() { - this.pairs = new ArrayList<>(); - } /** * Constructor for the DistributionCarrierScheduler. - * TODO: In the future, the road pricing scheme should come from some the scenario: RoadPricingUtils.getRoadPricingScheme(scenario). This here is only a dirty workaround. KMT'Aug'24 + * TODO: In the future, the scenario shpuld come via injection(?) This here is only a dirty workaround. KMT'Aug'24 * * @param scenario the scenario - * @deprecated This is only a dirty workaround. KMT'Aug'24 */ @Deprecated DistributionCarrierScheduler(Scenario scenario) { @@ -107,9 +100,8 @@ protected void scheduleResource() { load = 0; Carrier auxiliaryCarrier = CarrierSchedulerUtils.solveVrpWithJsprit( - createAuxiliaryCarrier( - shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), - resource.getNetwork(), RoadPricingUtils.getRoadPricingScheme(scenario)); + createAuxiliaryCarrier(shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), + scenario); scheduledPlans.add(auxiliaryCarrier.getSelectedPlan()); carrier.getServices().putAll(auxiliaryCarrier.getServices()); cumulatedLoadingTime = 0; @@ -126,7 +118,7 @@ protected void scheduleResource() { CarrierSchedulerUtils.solveVrpWithJsprit( createAuxiliaryCarrier( shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), - resource.getNetwork(), RoadPricingUtils.getRoadPricingScheme(scenario)); + scenario); scheduledPlans.add(auxiliaryCarrier.getSelectedPlan()); carrier.getServices().putAll(auxiliaryCarrier.getServices()); shipmentsInCurrentTour.clear(); @@ -319,8 +311,7 @@ private void addShipmentUnloadElement( .addPlanElement(id, unload); } - private Carrier createAuxiliaryCarrier( - ArrayList shipmentsInCurrentTour, double startTime) { + private Carrier createAuxiliaryCarrier(ArrayList shipmentsInCurrentTour, double startTime) { final Id carrierId = Id.create(carrier.getId().toString() + carrierCnt, Carrier.class); carrierCnt++; Carrier auxiliaryCarrier = CarriersUtils.createCarrier(carrierId); 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 304223a6..42c351dc 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java @@ -213,12 +213,12 @@ public static void setCarrierType(Carrier carrier, CARRIER_TYPE carrierType) { carrier.getAttributes().putAttribute(CARRIER_TYPE_ATTR, carrierType); } - public static DistributionCarrierScheduler createDefaultDistributionCarrierScheduler() { - return new DistributionCarrierScheduler(); + public static DistributionCarrierScheduler createDefaultDistributionCarrierScheduler(Scenario scenario) { + return new DistributionCarrierScheduler(scenario); } - public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler() { - return new CollectionCarrierScheduler(); + public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler(Scenario scenario) { + return new CollectionCarrierScheduler(scenario); } /** diff --git a/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java b/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java index e4a219b3..605afd1f 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java @@ -83,7 +83,7 @@ public void initialize() { carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); } diff --git a/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java b/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java index 968df3ae..7efd6df3 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java @@ -84,7 +84,7 @@ public void initialize() { DistributionCarrierResourceBuilder builder = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network); - builder.setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()); + builder.setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)); builder.setLocationLinkId(distributionLinkId); distributionResource = builder.build(); } diff --git a/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java b/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java index 9168991c..a37df8fb 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java @@ -116,7 +116,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.build(); diff --git a/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java b/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java index 74705dc4..2f08b802 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/lspScoring/CollectionLSPScoringTest.java @@ -80,7 +80,7 @@ public void initialize() { carrier.setCarrierCapabilities(CarrierCapabilities.Builder.newInstance().addType(collectionVehicleType).addVehicle(carrierVehicle).setFleetSize(FleetSize.INFINITE).build()); LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()).setLocationLinkId(collectionLink.getId()).build(); + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)).setLocationLinkId(collectionLink.getId()).build(); LogisticChainElement collectionElement = LSPUtils.LogisticChainElementBuilder .newInstance(Id.create("CollectionElement", LogisticChainElement.class)).setResource(collectionResource).build(); diff --git a/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java b/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java index 9b474a59..1cc3e78f 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/lspScoring/MultipleIterationsCollectionLSPScoringTest.java @@ -101,7 +101,7 @@ public void initialize() { carrier.setCarrierCapabilities(capabilities); LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java b/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java index b1eb771c..c1b30ad2 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java @@ -103,7 +103,7 @@ private static LSP createLSP(Scenario scenario) { CarriersUtils.addCarrierVehicle(carrierLeft, CarrierVehicle.newInstance(Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource carrierLeftResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierLeft, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("leftCarrierElement", LogisticChainElement.class)) @@ -118,7 +118,7 @@ private static LSP createLSP(Scenario scenario) { CarriersUtils.addCarrierVehicle(carrierRight, CarrierVehicle.newInstance(Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource carrierRightResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierRight, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); rightCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("rightCarrierElement", LogisticChainElement.class)) diff --git a/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java b/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java index f6b1f708..7679b3eb 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/multipleChains/WorstPlanSelectorTest.java @@ -103,7 +103,7 @@ private static LSP createLSP(Scenario scenario) { CarriersUtils.addCarrierVehicle(singleCarrier, CarrierVehicle.newInstance(Id.createVehicleId("directTruck"), DEPOT_SOUTH_LINK_ID, VEH_TYPE_EXPENSIVE)); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(singleCarrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("singleCarrierElement", LogisticChainElement.class)) @@ -132,7 +132,7 @@ private static LSP createLSP(Scenario scenario) { CarriersUtils.addCarrierVehicle(carrierSouth, CarrierVehicle.newInstance(Id.createVehicleId("directTruck"), DEPOT_SOUTH_LINK_ID, VEH_TYPE_CHEAP)); LSPResource carrierSouthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierSouth, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); southCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("southCarrierElement", LogisticChainElement.class)) @@ -147,7 +147,7 @@ private static LSP createLSP(Scenario scenario) { CarriersUtils.addCarrierVehicle(carrierNorth, CarrierVehicle.newInstance(Id.createVehicleId("directTruck"), DEPOT_NORTH_LINK_ID, VEH_TYPE_CHEAP)); LSPResource carrierNorthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierNorth, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); northCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("northCarrierElement", LogisticChainElement.class)) diff --git a/src/test/java/org/matsim/freight/logistics/examples/requirementsChecking/AssignerRequirementsTest.java b/src/test/java/org/matsim/freight/logistics/examples/requirementsChecking/AssignerRequirementsTest.java index 86f387ab..0f2537e7 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/requirementsChecking/AssignerRequirementsTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/requirementsChecking/AssignerRequirementsTest.java @@ -102,7 +102,7 @@ public void initialize() { redCarrier.setCarrierCapabilities(redCapabilities); LSPResource redCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -134,7 +134,7 @@ public void initialize() { blueCarrier.setCarrierCapabilities(blueCapabilities); LSPResource blueCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java b/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java index 6452bdd8..27a4f44c 100644 --- a/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java +++ b/src/test/java/org/matsim/freight/logistics/examples/simulationTrackers/CollectionTrackerTest.java @@ -107,7 +107,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.build(); diff --git a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java index 552270f7..25e6ec2e 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java @@ -75,7 +75,7 @@ public void initialize() { carrier.setCarrierCapabilities(capabilities); carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java index 95eb61fc..20753c88 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java @@ -79,7 +79,7 @@ public void initialize() { Id adapterId = Id.create("DistributionCarrierResource", LSPResource.class); adapter = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java index dc07607b..c9332448 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java @@ -76,7 +76,7 @@ public void initialize() { LSPCarrierResource carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder .newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 ac45d868..4b0771de 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java @@ -88,7 +88,7 @@ public void initialize() { CollectionCarrierResourceBuilder collectionResourceBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder .newInstance(collectionCarrier, network); - collectionResourceBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + collectionResourceBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); collectionResourceBuilder.setLocationLinkId(collectionLinkId); Id collectionElementId = Id.create("CollectionElement", @@ -189,7 +189,7 @@ public void initialize() { final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder .newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java index b6c0bc08..711b0f4f 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java @@ -78,7 +78,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.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 6cab633e..5239377a 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java @@ -79,7 +79,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -178,7 +178,7 @@ public void initialize() { LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java index 4f2637bb..fa51dec6 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java @@ -110,7 +110,7 @@ public void initialize() { collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, scenario.getNetwork()) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()).setLocationLinkId(collectionLinkId) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)).setLocationLinkId(collectionLinkId) .build(); final LogisticChainElement collectionElement; 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 aaf282da..41e41914 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -95,7 +95,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -193,7 +193,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 44f75e7f..b19fe4b1 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java @@ -99,7 +99,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java index f2b04718..f1bd675c 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java @@ -100,7 +100,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 4cbb9f12..c70e3100 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java @@ -99,7 +99,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java index 53aa2fa0..fd32c9eb 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java @@ -103,7 +103,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.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 3fe2d208..3f5515aa 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -104,7 +104,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -204,7 +204,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 34ac3106..4bb3368a 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java @@ -105,7 +105,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java index 319b5293..c87cb61f 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java @@ -103,7 +103,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 36c5ef0f..a7cbcca0 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java @@ -104,7 +104,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java index eaf9c67e..9cf62f27 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java @@ -98,7 +98,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.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 869a8f9c..9e6e65e5 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -107,7 +107,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -208,7 +208,7 @@ public void initialize() { LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 24a70f11..4097ff43 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java @@ -104,7 +104,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java index 37eeb985..b4dea19e 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java @@ -99,7 +99,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 fffd20d8..baa549ce 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java @@ -99,7 +99,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 b5ef98d3..0c65a56d 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -99,7 +99,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -199,7 +199,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java index c8f54470..b8bdbe61 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java @@ -76,7 +76,7 @@ public void initialize() { CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); 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 898ecc07..a02a53a2 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java @@ -80,7 +80,7 @@ public void initialize() { Id collectionResourceId = Id.create("CollectionCarrierResource", LSPResource.class); final LSPResource collectionCarrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -179,7 +179,7 @@ public void initialize() { final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java index 9dab68f3..6fff9a9a 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java @@ -81,7 +81,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); LSPResource collectionResource = adapterBuilder.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 0cc98a4d..3c1181c8 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java @@ -84,7 +84,7 @@ public void initialize() { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -182,7 +182,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java index 9138e715..bbe7a401 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java @@ -83,7 +83,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); collectionResource = adapterBuilder.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 f0bc11cf..50d526de 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java @@ -94,7 +94,7 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -194,7 +194,7 @@ public void initialize() { distributionCarrier.setCarrierCapabilities(distributionCapabilities); distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java index e746f654..ffbfbc02 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java @@ -87,7 +87,7 @@ public void initialize() { collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 772cc082..1feacdd4 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java @@ -88,7 +88,7 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java index 62c8702a..9c0690f7 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java @@ -85,7 +85,7 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); adapterBuilder.setLocationLinkId(collectionLinkId); collectionResource = adapterBuilder.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 44f22afb..33936a6b 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java @@ -95,7 +95,7 @@ public void initialize() { collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -197,7 +197,7 @@ public void initialize() { distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java index 8071308c..cda665aa 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java @@ -86,7 +86,7 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 c5f5834a..96aec6d9 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java @@ -88,7 +88,7 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 5274ddd9..9d19ed21 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java @@ -93,7 +93,7 @@ public void initialize() { collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .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 3fb601f1..d4905b46 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java @@ -93,7 +93,7 @@ public void initialize() { collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build();