Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Jul 31, 2024
1 parent 2ff0151 commit 254892c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ final class ExampleGroceryDeliveryMultipleChains {
private static final Id<Link> HUB_LINK_ID = Id.createLinkId("91085");
private static final double TOLL_VALUE = 1000;
static final double HUBCOSTS_FIX = 100;
private static final List<String> TOLLED_LINKS = ExampleConstants.TOLLED_LINK_LIST_BERLIN;

private ExampleGroceryDeliveryMultipleChains() {}

Expand Down Expand Up @@ -88,7 +89,7 @@ public void install() {
new EventBasedCarrierScorer4MultipleChains();
carrierScorer.setToll(TOLL_VALUE);
carrierScorer.setTolledVehicleTypes( List.of("heavy40t"));
carrierScorer.setTolledLinks(ExampleConstants.TOLLED_LINK_LIST_BERLIN);
carrierScorer.setTolledLinks(TOLLED_LINKS);
bind(CarrierScoringFunctionFactory.class).toInstance(carrierScorer);
bind(LSPScorerFactory.class).toInstance(MyLSPScorer::new);
bind(CarrierStrategyManager.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,22 @@
final class ExampleTwoLspsGroceryDeliveryMultipleChains {

private static final Logger log = LogManager.getLogger(ExampleTwoLspsGroceryDeliveryMultipleChains.class);

private static final Id<Link> HUB_LINK_ID_NEUKOELLN = Id.createLinkId("91085");
private static final double TOLL_VALUE = 1000;
private static final double HUBCOSTS_FIX = 100;

private static final List<String> TOLLED_LINKS = ExampleConstants.TOLLED_LINK_LIST_BERLIN;
private static final List<String> TOLLED_VEHICLE_TYPES = List.of("heavy40t");
private static final double TOLL_VALUE = 1000;

private static final String CARRIER_PLAN_FILE = "https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/projects/freight/foodRetailing_wo_rangeConstraint/input/CarrierLEH_v2_withFleet_Shipment_OneTW_PickupTime_ICEVandBEV.xml";
private static final String VEHICLE_TYPE_FILE = "https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/berlin/projects/freight/foodRetailing_wo_rangeConstraint/input/vehicleTypesBVWP100_DC_noTax.xml";
public static final String EDEKA_SUPERMARKT_TROCKEN = "edeka_SUPERMARKT_TROCKEN";
public static final String KAUFLAND_VERBRAUCHERMARKT_TROCKEN = "kaufland_VERBRAUCHERMARKT_TROCKEN";
private static final String EDEKA_SUPERMARKT_TROCKEN = "edeka_SUPERMARKT_TROCKEN";
private static final String KAUFLAND_VERBRAUCHERMARKT_TROCKEN = "kaufland_VERBRAUCHERMARKT_TROCKEN";

private static final String OUTPUT_DIRECTORY = "output/groceryDelivery_kmt_10";



private ExampleTwoLspsGroceryDeliveryMultipleChains() {}

Expand Down Expand Up @@ -134,8 +143,8 @@ public void install() {
final EventBasedCarrierScorer4MultipleChains carrierScorer =
new EventBasedCarrierScorer4MultipleChains();
carrierScorer.setToll(TOLL_VALUE);
carrierScorer.setTolledVehicleTypes( List.of("heavy40t"));
carrierScorer.setTolledLinks(ExampleConstants.TOLLED_LINK_LIST_BERLIN);
carrierScorer.setTolledVehicleTypes(TOLLED_VEHICLE_TYPES);
carrierScorer.setTolledLinks(TOLLED_LINKS);
bind(CarrierScoringFunctionFactory.class).toInstance(carrierScorer);
bind(LSPScorerFactory.class).toInstance(MyLSPScorer::new);
bind(CarrierStrategyManager.class)
Expand Down Expand Up @@ -181,7 +190,7 @@ private static Config prepareConfig(String[] args) {
}
ConfigUtils.applyCommandline(config, args);
} else {
config.controller().setOutputDirectory("output/groceryDelivery_kmt_10");
config.controller().setOutputDirectory(OUTPUT_DIRECTORY);
config.controller().setLastIteration(1);
}

Expand Down

0 comments on commit 254892c

Please sign in to comment.