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 f5f15572..e447b34f 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 @@ -217,7 +217,7 @@ 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. 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 1ac92435..38d9d978 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 @@ -328,7 +328,7 @@ 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(scenario)) @@ -371,7 +371,7 @@ 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(scenario)) 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 5a0800a5..7e0af097 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,7 +249,7 @@ 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(scenario)) .build(); @@ -342,7 +342,7 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, vehType)); LSPResource distributionCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .setDistributionScheduler( ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java b/src/main/java/org/matsim/freight/logistics/examples/initialPlans/ExampleTwoEchelonGrid_NR.java index f3c1ff8d..7f52bc80 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,7 +259,7 @@ 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(scenario)) .build(); @@ -352,7 +352,7 @@ private static LSP createLSP(Scenario scenario) { Id.createVehicleId("distributionTruck"), HUB_LINK_ID, vehType)); LSPResource distributionCarrierRessource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - distributionCarrier, network) + distributionCarrier) .setDistributionScheduler( ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .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 219a4a0a..cba3ef92 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 @@ -219,7 +219,7 @@ 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. 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 3c18e1dd..5499de1c 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,7 +198,7 @@ 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(scenario)) .build(); @@ -278,7 +278,7 @@ 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(scenario)) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleMixedEchelonChains.java index 31c3c98c..9a3927a0 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 @@ -244,7 +244,7 @@ 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(scenario)) .build(); @@ -288,7 +288,7 @@ 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(scenario)) .build(); @@ -361,7 +361,7 @@ 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(scenario)) .build(); 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 9e8b8685..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,7 +196,7 @@ 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(scenario)) .build(); @@ -235,7 +235,7 @@ 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(scenario)) .build(); @@ -259,7 +259,7 @@ 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(scenario)) .build(); 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 0951a1e2..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,7 +214,7 @@ 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(scenario)) .build(); @@ -256,7 +256,7 @@ 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(scenario)) .build(); @@ -280,7 +280,7 @@ 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(scenario)) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleMultipleTwoEchelonChainsReplanning.java index 7bfb787e..cbab951e 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 @@ -248,7 +248,7 @@ 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(scenario)) .build(); @@ -326,7 +326,7 @@ 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(scenario)) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChains.java index 4ce270ef..2ca444c0 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 @@ -336,7 +336,7 @@ 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(scenario)) .build(); @@ -408,7 +408,7 @@ 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(scenario)) .build(); diff --git a/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java b/src/main/java/org/matsim/freight/logistics/examples/multipleChains/ExampleTwoLspsGroceryDeliveryMultipleChainsWithToll.java index 61826bcc..9d49bfab 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 @@ -363,7 +363,7 @@ 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(scenario)) .build(); @@ -434,7 +434,7 @@ 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(scenario)) .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 92606a89..e817e67c 100644 --- a/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java +++ b/src/main/java/org/matsim/freight/logistics/io/LSPPlanXmlParserV1.java @@ -326,7 +326,7 @@ public void endTag(String name, String content, Stack context) { .build(); case distributionCarrier -> lspResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( - currentCarrier, null) + currentCarrier) .setDistributionScheduler( ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(null)) .build(); 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/ResourceImplementationUtils.java b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java index 6ed70bb1..d47e29e4 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java @@ -254,21 +254,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) { 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 7efd6df3..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,7 +83,7 @@ public void initialize() { distributionCarrier.setCarrierCapabilities(capabilities); - DistributionCarrierResourceBuilder builder = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network); + 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/examples/multipleChains/MultipleChainsReplanningTest.java b/src/test/java/org/matsim/freight/logistics/examples/multipleChains/MultipleChainsReplanningTest.java index c1b30ad2..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,7 +102,7 @@ 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) + LSPResource carrierLeftResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierLeft) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); @@ -117,7 +117,7 @@ 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) + LSPResource carrierRightResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierRight) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); 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 7679b3eb..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,7 +102,7 @@ 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) + LSPResource singleCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(singleCarrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); @@ -131,7 +131,7 @@ 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) + LSPResource carrierSouthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierSouth) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); @@ -146,7 +146,7 @@ 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) + LSPResource carrierNorthResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrierNorth) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .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 20753c88..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,7 +78,7 @@ public void initialize() { Id adapterId = Id.create("DistributionCarrierResource", LSPResource.class); - adapter = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + adapter = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 4b0771de..aa966272 100644 --- a/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java +++ b/src/test/java/org/matsim/freight/logistics/logisticChainTests/CompleteLogisticChainTest.java @@ -188,7 +188,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder - .newInstance(carrier, network) + .newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 5239377a..cfaa5b87 100644 --- a/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspCreationTests/CompleteLSPCreationTest.java @@ -177,7 +177,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java index 41e41914..81ae2a2e 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/CompleteLSPMobsimTest.java @@ -192,7 +192,7 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 3f5515aa..187f17f7 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleIterationsCompleteLSPMobsimTest.java @@ -203,7 +203,7 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 9e6e65e5..5f498f61 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/MultipleShipmentsCompleteLSPMobsimTest.java @@ -207,7 +207,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 0c65a56d..8cf33a29 100644 --- a/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspMobsimTests/RepeatedMultipleShipmentsCompleteLSPMobsimTest.java @@ -198,7 +198,7 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build(); diff --git a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java index a02a53a2..94dfcbd5 100644 --- a/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspPlanTests/CompleteLSPPlanTest.java @@ -178,7 +178,7 @@ public void initialize() { carrier.setCarrierCapabilities(distributionCapabilities); - final LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + 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/CompleteLSPShipmentAssignerTest.java b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java index 3c1181c8..ad63776d 100644 --- a/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java +++ b/src/test/java/org/matsim/freight/logistics/lspShipmentAssignmentTests/CompleteLSPShipmentAssignerTest.java @@ -181,7 +181,7 @@ public void initialize() { Carrier carrier = CarriersUtils.createCarrier(distributionCarrierId); carrier.setCarrierCapabilities(distributionCapabilities); - LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier, network) + LSPResource distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(carrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 50d526de..54685e5e 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/CompleteLSPSchedulingTest.java @@ -193,7 +193,7 @@ public void initialize() { Carrier distributionCarrier = CarriersUtils.createCarrier(distributionCarrierId); distributionCarrier.setCarrierCapabilities(distributionCapabilities); - distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) + distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .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 33936a6b..aebd93fa 100644 --- a/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java +++ b/src/test/java/org/matsim/freight/logistics/resourceImplementations/MultipleShipmentsCompleteLSPSchedulingTest.java @@ -196,7 +196,7 @@ public void initialize() { distributionCarrier.setCarrierCapabilities(distributionCapabilities); - distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier, network) + distributionResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance(distributionCarrier) .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .setLocationLinkId(distributionLinkId) .build();