From e5a4bccd9c6e26dfaa57b72dccb779ca0b8b407d Mon Sep 17 00:00:00 2001 From: Kai Martins-Turner Date: Tue, 13 Aug 2024 11:26:08 +0200 Subject: [PATCH] combine methods --- ...sGroceryDeliveryMultipleChainsWithToll.java | 5 +---- .../ResourceImplementationUtils.java | 18 ++++-------------- 2 files changed, 5 insertions(+), 18 deletions(-) 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 ab7dea37..61826bcc 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 @@ -364,9 +364,7 @@ private static LogisticChain createTwoEchelonChain(Scenario scenario, String lsp LSPResource distributionCarrierResource = ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( distributionCarrier, scenario.getNetwork()) - .setDistributionScheduler( -// ResourceImplementationUtils.createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingUtils.getRoadPricingScheme(scenario))) - ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) + .setDistributionScheduler(ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); LogisticChainElement distributionCarrierElement = @@ -438,7 +436,6 @@ private static LogisticChain createDirectChain(Scenario scenario, String lspName ResourceImplementationUtils.DistributionCarrierResourceBuilder.newInstance( directCarrier, scenario.getNetwork()) .setDistributionScheduler( -// ResourceImplementationUtils.createDefaultDistributionCarrierSchedulerWithRoadPricing(RoadPricingUtils.getRoadPricingScheme(scenario))) ResourceImplementationUtils.createDefaultDistributionCarrierScheduler(scenario)) .build(); 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 42c351dc..6ed70bb1 100644 --- a/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java +++ b/src/main/java/org/matsim/freight/logistics/resourceImplementations/ResourceImplementationUtils.java @@ -213,33 +213,23 @@ public static void setCarrierType(Carrier carrier, CARRIER_TYPE carrierType) { carrier.getAttributes().putAttribute(CARRIER_TYPE_ATTR, carrierType); } - public static DistributionCarrierScheduler createDefaultDistributionCarrierScheduler(Scenario scenario) { - return new DistributionCarrierScheduler(scenario); - } - - public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler(Scenario scenario) { - return new CollectionCarrierScheduler(scenario); - } - /** - * Utils method to create a DistributionCarrierScheduler with Roadpricing. + * 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 */ - public static DistributionCarrierScheduler createDefaultDistributionCarrierSchedulerWithRoadPricing(Scenario scenario) { + public static DistributionCarrierScheduler createDefaultDistributionCarrierScheduler(Scenario scenario) { return new DistributionCarrierScheduler(scenario); } /** - * Utils method to create a Collection CarrierScheduler with Roadpricing. + * Utils method to create a Collection CarrierScheduler * 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 - * @deprecated This is only a dirty workaround. KMT'Aug'24 */ - public static CollectionCarrierScheduler createDefaultCollectionCarrierSchedulerWithRoadPricing(Scenario scenario) { + public static CollectionCarrierScheduler createDefaultCollectionCarrierScheduler(Scenario scenario) { return new CollectionCarrierScheduler(scenario); }