From c395ebc1b93cf37a4bbee4f41d8a659330cd804b Mon Sep 17 00:00:00 2001 From: sime94 Date: Thu, 8 Aug 2024 17:31:07 +0200 Subject: [PATCH] add absolute path starting from config --- src/main/java/org/matsim/run/LausitzScenario.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/matsim/run/LausitzScenario.java b/src/main/java/org/matsim/run/LausitzScenario.java index e9ea075..796b95a 100644 --- a/src/main/java/org/matsim/run/LausitzScenario.java +++ b/src/main/java/org/matsim/run/LausitzScenario.java @@ -34,6 +34,8 @@ import playground.vsp.scoring.IncomeDependentUtilityOfMoneyPersonScoringParameters; import javax.annotation.Nullable; +import java.net.URISyntaxException; +import java.nio.file.Paths; import java.util.Set; @CommandLine.Command(header = ":: Open Lausitz Scenario ::", version = LausitzScenario.VERSION, mixinStandardHelpOptions = true) @@ -119,7 +121,11 @@ protected Config prepareConfig(Config config) { ptFareConfigGroup.setPtFareCalculationModel(PtFareConfigGroup.PtFareCalculationModels.fareZoneBased); DistanceBasedPtFareParams fareParams = ConfigUtils.addOrGetModule(config, DistanceBasedPtFareParams.class); - fareParams.setFareZoneShp("vvo_tarifzone20/vvo_tarifzone20_hoyerswerda_utm32n.shp"); + try { + fareParams.setFareZoneShp(Paths.get(config.getContext().toURI()).getParent().toString() + "/vvo_tarifzone20/vvo_tarifzone20_hoyerswerda_utm32n.shp"); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } // TODO: recreate counts format with car and trucks