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..05f6ffcd 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) .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..139ed25e 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 @@ -82,9 +82,9 @@ private static LSP createInitialLSP(Scenario scenario) { // The collection adapter i.e. the Resource is created LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( - collectionCarrier, network) + collectionCarrier) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -149,10 +149,10 @@ private static LSP createInitialLSP(Scenario scenario) { // The adapter i.e. the main run resource is created LSPResource mainRunResource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) .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 @@ -217,12 +217,12 @@ private static LSP createInitialLSP(Scenario scenario) { // The distribution adapter i.e. the Resource is created DistributionCarrierResourceBuilder distributionResourceBuilder = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network); + distributionCarrier); distributionResourceBuilder.setLocationLinkId(distributionLinkId); // 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..74cf3cc4 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 @@ -263,11 +263,11 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType // The scheduler for the main run Resource is created and added to the Resource LSPResource mainRunResource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) .setFromLinkId(depotLinkId) .setToLinkId(hubLinkId) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .build(); mainRunElement = @@ -328,10 +328,10 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType // The distribution adapter i.e. the Resource is created LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .setLocationLinkId(hubLinkId) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); // (The scheduler is where jsprit comes into play.) @@ -371,10 +371,10 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType // The distribution adapter i.e. the Resource is created LSPResource directDistributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - directDistributionCarrier, network) + directDistributionCarrier) .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..de65bf2c 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 @@ -249,9 +249,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("directTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource directCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - directCarrier, network) + directCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement directCarrierElement = @@ -286,10 +286,10 @@ private static LSP createLSP(Scenario scenario) { CarrierVehicle.newInstance( Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierRessource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -342,9 +342,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, vehType)); LSPResource distributionCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .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..1f4f3261 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 @@ -259,9 +259,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("directTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource directCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - directCarrier, network) + directCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement directCarrierElement = @@ -296,10 +296,10 @@ private static LSP createLSP(Scenario scenario) { CarrierVehicle.newInstance( Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierRessource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -352,9 +352,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, vehType)); LSPResource distributionCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .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..2fc800ce 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) .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..2de2f74a 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) .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..b703c176 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 @@ -82,9 +82,9 @@ private static LSP createInitialLSP(Scenario scenario) { // The collection adapter i.e. the Resource is created LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( - collectionCarrier, network) + collectionCarrier) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -150,10 +150,10 @@ private static LSP createInitialLSP(Scenario scenario) { // The adapter i.e. the main run resource is created LSPResource mainRunResource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) .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 @@ -219,12 +219,12 @@ private static LSP createInitialLSP(Scenario scenario) { // The distribution adapter i.e. the Resource is created LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .setLocationLinkId(distributionLinkId) // 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..1d42b458 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 @@ -198,9 +198,9 @@ private static LSP createLSP(Scenario scenario) { vehicleTypes.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - singleCarrier, scenario.getNetwork()) + singleCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -228,10 +228,10 @@ private static LSP createLSP(Scenario scenario) { vehicleTypes.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource mainCarrierResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance( - mainCarrier, scenario.getNetwork()) + mainCarrier) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -278,9 +278,9 @@ private static LSP createLSP(Scenario scenario) { .get(Id.create("heavy40t_electro", VehicleType.class)))); LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, scenario.getNetwork()) + distributionCarrier) .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..0e18dbcd 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 @@ -199,10 +199,10 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierResource1 = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance( - mainCarrier1, network) + mainCarrier1) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -244,9 +244,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource distributionCarrierResource1 = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier1, network) + distributionCarrier1) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement1 = @@ -288,9 +288,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("singleCarrier"), DEPOT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - singleCarrier, network) + singleCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -316,10 +316,10 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance( - mainCarrier, network) + mainCarrier) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -361,9 +361,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .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..a6cd35a8 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 @@ -196,9 +196,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_large"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - singleCarrier, network) + singleCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -235,9 +235,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource carrierLeftResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - carrierLeft, network) + carrierLeft) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = @@ -259,9 +259,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource carrierRightResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - carrierRight, network) + carrierRight) .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..b1a1c5c7 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 @@ -214,9 +214,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_large"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - singleCarrier, network) + singleCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = @@ -256,9 +256,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource carrierLeftResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - carrierLeft, network) + carrierLeft) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = @@ -280,9 +280,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("veh_small"), DEPOT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource carrierRightResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - carrierRight, network) + carrierRight) .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..adeca358 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 @@ -203,10 +203,10 @@ private static LSP createLSP(Scenario scenario) { CarrierVehicle.newInstance( Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierResourceLeft = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrierLeft, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrierLeft) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_LEFT_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -248,9 +248,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LEFT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource distributionCarrierResourceLeft = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrierLeft, network) + distributionCarrierLeft) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElementLeft = @@ -281,10 +281,10 @@ private static LSP createLSP(Scenario scenario) { CarrierVehicle.newInstance( Id.createVehicleId("mainTruck"), DEPOT_LINK_ID, VEH_TYPE_LARGE_50)); LSPResource mainCarrierResource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier, network) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainCarrier) .setFromLinkId(DEPOT_LINK_ID) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(HUB_RIGHT_LINK_ID) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -326,9 +326,9 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_RIGHT_LINK_ID, VEH_TYPE_SMALL_05)); LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .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..03f5a53f 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 @@ -286,10 +286,10 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp vehicleTypesMainRun.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource mainCarrierResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance( - mainCarrier, scenario.getNetwork()) + mainCarrier) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(hubLinkId) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -336,9 +336,9 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp .get(Id.create("heavy40t_electro", VehicleType.class)))); LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, scenario.getNetwork()) + distributionCarrier) .setDistributionScheduler( - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = @@ -408,9 +408,9 @@ private static LogisticChain createDirectChain(Scenario scenario, String lspName vehicleTypes.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - directCarrier, scenario.getNetwork()) + directCarrier) .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..88a1717e 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 @@ -312,10 +312,10 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp vehicleTypesMainRun.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource mainCarrierResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance( - mainCarrier, scenario.getNetwork()) + mainCarrier) .setFromLinkId(depotLinkFromVehicles) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setToLinkId(hubLinkId) .setVehicleReturn(ResourceImplementationUtils.VehicleReturn.returnToFromLink) .build(); @@ -363,10 +363,8 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp .get(Id.create("heavy40t_electro", VehicleType.class)))); LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, scenario.getNetwork()) - .setDistributionScheduler( -// ResourceImplementationUtils.createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingUtils.getRoadPricingScheme(scenario))) - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + distributionCarrier) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = @@ -436,10 +434,9 @@ private static LogisticChain createDirectChain(Scenario scenario, String lspName vehicleTypes.getVehicleTypes().get(Id.create("heavy40t", VehicleType.class)))); LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - directCarrier, scenario.getNetwork()) + directCarrier) .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..a67fb803 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); @@ -94,9 +96,9 @@ public static LSP createLSPWithProperties(Network network) { redCarrier.setCarrierCapabilities(redCapabilities); LSPResource redResource = - ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier, network) + ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -130,9 +132,9 @@ public static LSP createLSPWithProperties(Network network) { blueCarrier.setCarrierCapabilities(blueCapabilities); LSPResource blueResource = - ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier, network) + ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier) .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..877a7219 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 @@ -78,9 +78,9 @@ static LSP createLSPWithTracker(Scenario scenario) { LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( - carrier, scenario.getNetwork()) + carrier) .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..dc898f18 100644 --- a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java +++ b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java @@ -315,20 +315,20 @@ public void endTag(String name, String content, Stack context) { switch (ResourceImplementationUtils.getCarrierType(currentCarrier)) { case collectionCarrier -> lspResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance( - currentCarrier, null) + currentCarrier) .setCollectionScheduler( - ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(null)) .build(); case mainRunCarrier -> lspResource = - ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(currentCarrier, null) + ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(currentCarrier) .setMainRunCarrierScheduler( - ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(null)) .build(); case distributionCarrier -> lspResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - currentCarrier, null) + currentCarrier) .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/CollectionCarrierResource.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierResource.java index 7fb4d726..f54e29ff 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierResource.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierResource.java @@ -25,7 +25,6 @@ import java.util.List; 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.carriers.CarrierVehicle; import org.matsim.freight.logistics.*; @@ -37,14 +36,12 @@ private final Carrier carrier; private final List clientElements; private final CollectionCarrierScheduler collectionScheduler; - private final Network network; CollectionCarrierResource(CollectionCarrierResourceBuilder builder) { super(builder.id); this.collectionScheduler = builder.collectionScheduler; this.clientElements = builder.clientElements; this.carrier = builder.carrier; - this.network = builder.network; } @Override @@ -85,7 +82,4 @@ public Carrier getCarrier() { return carrier; } - public Network getNetwork() { - return network; - } } 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 ad0967f8..1e1e2d05 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/CollectionCarrierScheduler.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.roadpricing.RoadPricingScheme; +import org.matsim.api.core.v01.Scenario; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierService; import org.matsim.freight.carriers.ScheduledTour; @@ -47,22 +47,17 @@ private Carrier carrier; private CollectionCarrierResource resource; private ArrayList pairs; - private RoadPricingScheme rpscheme = null; - - CollectionCarrierScheduler() { - this.pairs = new ArrayList<>(); - } + private final Scenario scenario; /** * 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 - * @param rpscheme the road pricing scheme + * TODO: In the future, the scenario should come via injection(?) This here is only a dirty workaround. KMT'Aug'24 + * + * @param scenario the road pricing scheme */ - @Deprecated - CollectionCarrierScheduler(RoadPricingScheme rpscheme) { + CollectionCarrierScheduler(Scenario scenario) { this.pairs = new ArrayList<>(); - this.rpscheme = rpscheme; + this.scenario = scenario; } @Override @@ -83,7 +78,7 @@ public void scheduleResource() { CarrierService carrierService = convertToCarrierService(tupleToBeAssigned); carrier.getServices().put(carrierService.getId(), carrierService); } - carrier = CarrierSchedulerUtils.solveVrpWithJsprit(carrier, resource.getNetwork(), rpscheme); + CarrierSchedulerUtils.solveVrpWithJsprit(carrier, scenario); } private CarrierService convertToCarrierService(LspShipmentWithTime tuple) { diff --git a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierResource.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierResource.java index 6e6815f7..00ca29ac 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierResource.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierResource.java @@ -24,7 +24,6 @@ import java.util.Collection; 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.carriers.CarrierVehicle; import org.matsim.freight.logistics.*; @@ -36,14 +35,12 @@ private final Carrier carrier; private final Collection clientElements; private final DistributionCarrierScheduler distributionHandler; - private final Network network; DistributionCarrierResource(DistributionCarrierResourceBuilder builder) { super(builder.id); this.distributionHandler = builder.distributionHandler; this.clientElements = builder.clientElements; this.carrier = builder.carrier; - this.network = builder.network; } @Override @@ -80,10 +77,6 @@ public void schedule(int bufferTime, LSPPlan lspPlan) { distributionHandler.scheduleShipments(lspPlan, this, bufferTime); } - public Network getNetwork() { - return network; - } - public Carrier getCarrier() { return carrier; } 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 80902b88..4d8a59e9 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/DistributionCarrierScheduler.java @@ -27,7 +27,7 @@ import java.util.List; import org.locationtech.jts.util.Assert; import org.matsim.api.core.v01.Id; -import org.matsim.contrib.roadpricing.RoadPricingScheme; +import org.matsim.api.core.v01.Scenario; import org.matsim.freight.carriers.*; import org.matsim.freight.carriers.CarrierCapabilities.FleetSize; import org.matsim.freight.carriers.Tour.Leg; @@ -53,22 +53,18 @@ private DistributionCarrierResource resource; private ArrayList pairs; private int carrierCnt = 1; - private RoadPricingScheme rpscheme = null; + private final 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 - * @param rpscheme the road pricing scheme + * TODO: In the future, the scenario should come via injection(?) This here is only a dirty workaround. KMT'Aug'24 + * + * @param scenario the scenario */ - @Deprecated - DistributionCarrierScheduler(RoadPricingScheme rpscheme) { + DistributionCarrierScheduler(Scenario scenario) { this.pairs = new ArrayList<>(); - this.rpscheme = rpscheme; + this.scenario = scenario; } @Override @@ -103,9 +99,8 @@ protected void scheduleResource() { load = 0; Carrier auxiliaryCarrier = CarrierSchedulerUtils.solveVrpWithJsprit( - createAuxiliaryCarrier( - shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), - resource.getNetwork(), rpscheme); + createAuxiliaryCarrier(shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), + scenario); scheduledPlans.add(auxiliaryCarrier.getSelectedPlan()); carrier.getServices().putAll(auxiliaryCarrier.getServices()); cumulatedLoadingTime = 0; @@ -122,7 +117,7 @@ protected void scheduleResource() { CarrierSchedulerUtils.solveVrpWithJsprit( createAuxiliaryCarrier( shipmentsInCurrentTour, availabilityTimeOfLastShipment + cumulatedLoadingTime), - resource.getNetwork(), rpscheme); + scenario); scheduledPlans.add(auxiliaryCarrier.getSelectedPlan()); carrier.getServices().putAll(auxiliaryCarrier.getServices()); shipmentsInCurrentTour.clear(); @@ -315,8 +310,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/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 b3a82f17..f8da646b 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java @@ -28,8 +28,6 @@ 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.api.core.v01.network.Network; -import org.matsim.contrib.roadpricing.RoadPricingScheme; import org.matsim.core.utils.io.IOUtils; import org.matsim.freight.carriers.Carrier; import org.matsim.freight.carriers.CarrierVehicle; @@ -214,36 +212,34 @@ 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 CollectionCarrierScheduler createDefaultCollectionCarrierScheduler() { - return new CollectionCarrierScheduler(); - } - /** - * Utils method to create a DistributionCarrierScheduler with Roadpricing. - * 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 - * @param roadPricingScheme the road pricing scheme + * 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 */ - public static DistributionCarrierScheduler createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingScheme roadPricingScheme) { - return new DistributionCarrierScheduler(roadPricingScheme); + public static DistributionCarrierScheduler createDefaultDistributionCarrierScheduler(Scenario scenario) { + return new DistributionCarrierScheduler(scenario); } /** - * Utils method to create a Collection CarrierScheduler with Roadpricing. - * 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 - * @param roadPricingScheme the road pricing scheme + * 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 */ - public static CollectionCarrierScheduler createDefaultCollectionCarrierSchedulerWithRoadPricing(RoadPricingScheme roadPricingScheme) { - return new CollectionCarrierScheduler(roadPricingScheme); + public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler(Scenario scenario) { + 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 { @@ -263,21 +259,19 @@ public static class DistributionCarrierResourceBuilder { final Id id; final ArrayList clientElements; - final Network network; final Carrier carrier; Id locationLinkId; DistributionCarrierScheduler distributionHandler; - private DistributionCarrierResourceBuilder(Carrier carrier, Network network) { + private DistributionCarrierResourceBuilder(Carrier carrier) { this.id = Id.create(carrier.getId().toString(), LSPResource.class); setCarrierType(carrier, CARRIER_TYPE.distributionCarrier); this.carrier = carrier; this.clientElements = new ArrayList<>(); - this.network = network; } - public static DistributionCarrierResourceBuilder newInstance(Carrier carrier, Network network) { - return new DistributionCarrierResourceBuilder(carrier, network); + public static DistributionCarrierResourceBuilder newInstance(Carrier carrier) { + return new DistributionCarrierResourceBuilder(carrier); } public DistributionCarrierResourceBuilder setLocationLinkId(Id locationLinkId) { @@ -301,21 +295,19 @@ public static class CollectionCarrierResourceBuilder { final Id id; final ArrayList clientElements; - final Network network; final Carrier carrier; Id locationLinkId; CollectionCarrierScheduler collectionScheduler; - private CollectionCarrierResourceBuilder(Carrier carrier, Network network) { + private CollectionCarrierResourceBuilder(Carrier carrier) { this.id = Id.create(carrier.getId().toString(), LSPResource.class); setCarrierType(carrier, CARRIER_TYPE.collectionCarrier); this.carrier = carrier; this.clientElements = new ArrayList<>(); - this.network = network; } - public static CollectionCarrierResourceBuilder newInstance(Carrier carrier, Network network) { - return new CollectionCarrierResourceBuilder(carrier, network); + public static CollectionCarrierResourceBuilder newInstance(Carrier carrier) { + return new CollectionCarrierResourceBuilder(carrier); } public CollectionCarrierResourceBuilder setLocationLinkId(Id locationLinkId) { @@ -339,23 +331,21 @@ public static class MainRunCarrierResourceBuilder { private final Id id; private final ArrayList clientElements; - private final Network network; private Carrier carrier; private Id fromLinkId; private Id toLinkId; private MainRunCarrierScheduler mainRunScheduler; private VehicleReturn vehicleReturn; - private MainRunCarrierResourceBuilder(Carrier carrier, Network network) { + private MainRunCarrierResourceBuilder(Carrier carrier) { this.id = Id.create(carrier.getId().toString(), LSPResource.class); setCarrierType(carrier, CARRIER_TYPE.mainRunCarrier); this.carrier = carrier; this.clientElements = new ArrayList<>(); - this.network = network; } - public static MainRunCarrierResourceBuilder newInstance(Carrier carrier, Network network) { - return new MainRunCarrierResourceBuilder(carrier, network); + public static MainRunCarrierResourceBuilder newInstance(Carrier carrier) { + return new MainRunCarrierResourceBuilder(carrier); } public MainRunCarrierResourceBuilder setMainRunCarrierScheduler( @@ -410,10 +400,6 @@ MainRunCarrierScheduler getMainRunScheduler() { return mainRunScheduler; } - Network getNetwork() { - return network; - } - VehicleReturn getVehicleReturn() { return vehicleReturn; } 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..1d60b887 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/CollectionResourceTest.java @@ -82,8 +82,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(capabilities); - carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..a4db475d 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/DistributionResourceTest.java @@ -83,8 +83,8 @@ public void initialize() { distributionCarrier.setCarrierCapabilities(capabilities); - DistributionCarrierResourceBuilder builder = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network); - builder.setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()); + DistributionCarrierResourceBuilder builder = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier); + builder.setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)); builder.setLocationLinkId(distributionLinkId); distributionResource = builder.build(); } 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..5dfe0fce 100644 --- a/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java +++ b/src/test/java/org/matsim/freight/logistics/adapterTests/MainRunResourceTest.java @@ -82,8 +82,8 @@ public void initialize() { carrier = CarriersUtils.createCarrier(carrierId); carrier.setCarrierCapabilities(capabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(carrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(carrier) + .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/examples/lspReplanning/CollectionLSPReplanningTest.java b/src/test/java/org/matsim/freight/logistics/examples/lspReplanning/CollectionLSPReplanningTest.java index 9168991c..1af7cb9a 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 @@ -115,8 +115,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..d7a2a28a 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 @@ -79,8 +79,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(Id.create("CollectionCarrier", Carrier.class)); 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(); + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier) + .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..a07f3d5f 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 @@ -100,8 +100,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(carrierId); carrier.setCarrierCapabilities(capabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier) + .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..5002d177 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 @@ -102,8 +102,8 @@ private static LSP createLSP(Scenario scenario) { carrierLeft.getCarrierCapabilities().setFleetSize(CarrierCapabilities.FleetSize.INFINITE); 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()) + LSPResource carrierLeftResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierLeft) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); leftCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("leftCarrierElement", LogisticChainElement.class)) @@ -117,8 +117,8 @@ private static LSP createLSP(Scenario scenario) { carrierRight.getCarrierCapabilities().setFleetSize(CarrierCapabilities.FleetSize.INFINITE); 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()) + LSPResource carrierRightResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierRight) + .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..81f6a499 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 @@ -102,8 +102,8 @@ private static LSP createLSP(Scenario scenario) { singleCarrier.getCarrierCapabilities().setFleetSize(CarrierCapabilities.FleetSize.INFINITE); 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()) + LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(singleCarrier) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement singleCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("singleCarrierElement", LogisticChainElement.class)) @@ -131,8 +131,8 @@ private static LSP createLSP(Scenario scenario) { carrierSouth.getCarrierCapabilities().setFleetSize(CarrierCapabilities.FleetSize.INFINITE); 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()) + LSPResource carrierSouthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierSouth) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); southCarrierElement = LSPUtils.LogisticChainElementBuilder.newInstance(Id.create("southCarrierElement", LogisticChainElement.class)) @@ -146,8 +146,8 @@ private static LSP createLSP(Scenario scenario) { carrierNorth.getCarrierCapabilities().setFleetSize(CarrierCapabilities.FleetSize.INFINITE); 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()) + LSPResource carrierNorthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierNorth) + .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..19ced633 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 @@ -101,8 +101,8 @@ public void initialize() { Carrier redCarrier = CarriersUtils.createCarrier(redCarrierId); redCarrier.setCarrierCapabilities(redCapabilities); - LSPResource redCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource redCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(redCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -133,8 +133,8 @@ public void initialize() { Carrier blueCarrier = CarriersUtils.createCarrier(blueCarrierId); blueCarrier.setCarrierCapabilities(blueCapabilities); - LSPResource blueCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource blueCollectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(blueCarrier) + .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..56358341 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 @@ -106,8 +106,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..e8681b29 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/CollectionElementTest.java @@ -74,8 +74,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(carrierId); carrier.setCarrierCapabilities(capabilities); - carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier) + .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..6dcc2a4c 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/DistributionElementTest.java @@ -78,8 +78,8 @@ public void initialize() { Id adapterId = Id.create("DistributionCarrierResource", LSPResource.class); - adapter = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + adapter = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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..5a7fe385 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainElementTests/MainRunElementTest.java @@ -78,8 +78,8 @@ public void initialize() { Carrier mainRunCarrierResourceBuilder = CarriersUtils.createCarrier(carrierId); mainRunCarrierResourceBuilder.setCarrierCapabilities(capabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrierResourceBuilder, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrierResourceBuilder) + .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/CollectionChainTest.java b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java index dc07607b..4c8ea5b5 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CollectionChainTest.java @@ -75,8 +75,8 @@ public void initialize() { carrier.setCarrierCapabilities(capabilities); LSPCarrierResource carrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder - .newInstance(carrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + .newInstance(carrier) + .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..13afaa97 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java @@ -87,8 +87,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); CollectionCarrierResourceBuilder collectionResourceBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder - .newInstance(collectionCarrier, network); - collectionResourceBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + .newInstance(collectionCarrier); + collectionResourceBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)); collectionResourceBuilder.setLocationLinkId(collectionLinkId); Id collectionElementId = Id.create("CollectionElement", @@ -134,8 +134,8 @@ public void initialize() { Carrier mainRunCarrier = CarriersUtils.createCarrier(collectionCarrierId); mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -188,8 +188,8 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder - .newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + .newInstance(carrier) + .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..75401fa5 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CollectionLSPCreationTest.java @@ -77,8 +77,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..1a8600d6 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java @@ -78,8 +78,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -127,8 +127,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -177,8 +177,8 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..bae6d195 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CollectionLSPMobsimTest.java @@ -109,8 +109,8 @@ public void initialize() { - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, scenario.getNetwork()) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()).setLocationLinkId(collectionLinkId) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier) + .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..8276d02f 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -94,8 +94,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -143,8 +143,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -192,8 +192,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..72a085ec 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstAndSecondReloadLSPMobsimTest.java @@ -98,8 +98,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -149,8 +149,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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/FirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java index f2b04718..64d4bd44 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/FirstReloadLSPMobsimTest.java @@ -99,8 +99,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..e7657713 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunLSPMobsimTest.java @@ -98,8 +98,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -147,8 +147,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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..6d9704f7 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MainRunOnlyLSPMobsimTest.java @@ -97,8 +97,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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/MultipleIterationsCollectionLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java index 53aa2fa0..c2a9ed98 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCollectionLSPMobsimTest.java @@ -102,8 +102,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..6ef78b8b 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -103,8 +103,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -154,8 +154,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -203,8 +203,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..e2e7f500 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstAndSecondReloadLSPMobsimTest.java @@ -104,8 +104,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -155,8 +155,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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/MultipleIterationsFirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java index 319b5293..572f7bee 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsFirstReloadLSPMobsimTest.java @@ -102,8 +102,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..6ca4a9cb 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsMainRunLSPMobsimTest.java @@ -103,8 +103,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -154,8 +154,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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/MultipleShipmentsCollectionLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java index eaf9c67e..992cdded 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCollectionLSPMobsimTest.java @@ -97,8 +97,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..98d133aa 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -106,8 +106,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -157,8 +157,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -207,8 +207,8 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..fc0dc5c1 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstAndSecondReloadLSPMobsimTest.java @@ -103,8 +103,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -154,8 +154,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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/MultipleShipmentsFirstReloadLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java index 37eeb985..fc8b079f 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsFirstReloadLSPMobsimTest.java @@ -98,8 +98,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..8846bdad 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsMainRunLSPMobsimTest.java @@ -98,8 +98,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -148,8 +148,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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 b5ef98d3..2229d579 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -98,8 +98,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -149,8 +149,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -198,8 +198,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..c6797f4d 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CollectionLSPPlanTest.java @@ -75,8 +75,8 @@ public void initialize() { carrier.setCarrierCapabilities(capabilities); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..3efe8d0f 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java @@ -79,8 +79,8 @@ public void initialize() { Id collectionResourceId = Id.create("CollectionCarrierResource", LSPResource.class); - final LSPResource collectionCarrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + final LSPResource collectionCarrierResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -128,8 +128,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -178,8 +178,8 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..47adb865 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CollectionLSPShipmentAssigmentTest.java @@ -80,8 +80,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..ca924374 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java @@ -83,8 +83,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + LSPResource collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -132,8 +132,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + LSPResource mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(Id.createLinkId("(4 2) (4 3)")) .setToLinkId(Id.createLinkId("(14 2) (14 3)")) .build(); @@ -181,8 +181,8 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) + .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..345b5563 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CollectionLSPSchedulingTest.java @@ -82,8 +82,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..b50e4bb5 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java @@ -93,8 +93,8 @@ public void initialize() { Carrier collectionCarrier = CarriersUtils.createCarrier(collectionCarrierId); collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -144,8 +144,8 @@ public void initialize() { Carrier mainRunCarrier = CarriersUtils.createCarrier(mainRunCarrierId); mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); @@ -193,8 +193,8 @@ public void initialize() { Carrier distributionCarrier = CarriersUtils.createCarrier(distributionCarrierId); distributionCarrier.setCarrierCapabilities(distributionCapabilities); - distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier) + .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..84b01f26 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/FirstReloadLSPSchedulingTest.java @@ -86,8 +86,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..60d727c0 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MainRunLSPSchedulingTest.java @@ -87,8 +87,8 @@ public void initialize() { Carrier collectionCarrier = CarriersUtils.createCarrier(collectionCarrierId); collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -136,8 +136,8 @@ public void initialize() { Carrier mainRunCarrier = CarriersUtils.createCarrier(mainRunCarrierId); mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .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..540dc805 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCollectionLSPSchedulingTest.java @@ -84,8 +84,8 @@ public void initialize() { Id adapterId = Id.create("CollectionCarrierResource", LSPResource.class); - CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier, network); - adapterBuilder.setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()); + CollectionCarrierResourceBuilder adapterBuilder = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(carrier); + 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..5d175cc0 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java @@ -94,8 +94,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -146,8 +146,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(toLinkId) .build(); @@ -196,8 +196,8 @@ public void initialize() { distributionCarrier.setCarrierCapabilities(distributionCapabilities); - distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) - .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler()) + distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier) + .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..0cc57219 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsFirstReloadLSPSchedulingTest.java @@ -85,8 +85,8 @@ public void initialize() { Carrier collectionCarrier = CarriersUtils.createCarrier(collectionCarrierId); collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .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..5c37fec9 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsMainRunLSPSchedulingTest.java @@ -87,8 +87,8 @@ public void initialize() { Carrier collectionCarrier = CarriersUtils.createCarrier(collectionCarrierId); collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -136,8 +136,8 @@ public void initialize() { Carrier mainRunCarrier = CarriersUtils.createCarrier(mainRunCarrierId); mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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 5274ddd9..77313d8f 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsSecondReloadLSPSchedulingTest.java @@ -92,8 +92,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -144,8 +144,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .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 3fb601f1..2deeac37 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/SecondReloadLSPSchedulingTest.java @@ -92,8 +92,8 @@ public void initialize() { collectionCarrier.setCarrierCapabilities(collectionCapabilities); - collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier, network) - .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler()) + collectionResource = ResourceImplementationUtils.CollectionCarrierResourceBuilder.newInstance(collectionCarrier) + .setCollectionScheduler(ResourceImplementationUtils.createDefaultCollectionCarrierScheduler(scenario)) .setLocationLinkId(collectionLinkId) .build(); @@ -144,8 +144,8 @@ public void initialize() { mainRunCarrier.setCarrierCapabilities(mainRunCapabilities); - mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier, network) - .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler()) + mainRunResource = ResourceImplementationUtils.MainRunCarrierResourceBuilder.newInstance(mainRunCarrier) + .setMainRunCarrierScheduler(ResourceImplementationUtils.createDefaultMainRunCarrierScheduler(scenario)) .setFromLinkId(fromLinkId) .setToLinkId(Id.createLinkId(toLinkId)) .build();