From 63b3611a71e6e9316d9b01aa2f6cca2ecc13d54b Mon Sep 17 00:00:00 2001 From: schlenther Date: Wed, 31 Jul 2024 16:13:35 +0200 Subject: [PATCH] rename 'input' directory to 'scenarios' --- Makefile | 10 +++++----- {input => scenarios}/shp/dilutionArea.cpg | 0 {input => scenarios}/shp/dilutionArea.dbf | Bin {input => scenarios}/shp/dilutionArea.prj | 0 {input => scenarios}/shp/dilutionArea.qmd | 0 {input => scenarios}/shp/dilutionArea.shp | Bin {input => scenarios}/shp/dilutionArea.shx | Bin {input => scenarios/test}/test.config.xml | 0 .../test}/test.with-drt.config.xml | 0 ...kelheim-v3.0-25pct.kexi-with-av.config.xml | 0 .../v3.0/kelheim-v3.0-25pct.kexi.config.xml | 0 .../v3.0/kelheim-v3.0-config.xml | 0 ...1-25pct.kexi-with-av-intermodal.config.xml | 0 ...kelheim-v3.1-25pct.kexi-with-av.config.xml | 0 .../v3.1/kelheim-v3.1-25pct.kexi.config.xml | 0 .../v3.1/kelheim-v3.1-config.xml | 0 src/main/R/srv.R | 2 +- .../org/matsim/run/RunKelheimScenario.java | 2 +- src/main/python/calibrate.py | 4 ++-- .../matsim/run/MeanNoiseDashboardTest.java | 18 +++++++++--------- .../matsim/run/RunKelheimIntegrationTest.java | 4 ++-- 21 files changed, 20 insertions(+), 20 deletions(-) rename {input => scenarios}/shp/dilutionArea.cpg (100%) rename {input => scenarios}/shp/dilutionArea.dbf (100%) rename {input => scenarios}/shp/dilutionArea.prj (100%) rename {input => scenarios}/shp/dilutionArea.qmd (100%) rename {input => scenarios}/shp/dilutionArea.shp (100%) rename {input => scenarios}/shp/dilutionArea.shx (100%) rename {input => scenarios/test}/test.config.xml (100%) rename {input => scenarios/test}/test.with-drt.config.xml (100%) rename {input => scenarios}/v3.0/kelheim-v3.0-25pct.kexi-with-av.config.xml (100%) rename {input => scenarios}/v3.0/kelheim-v3.0-25pct.kexi.config.xml (100%) rename {input => scenarios}/v3.0/kelheim-v3.0-config.xml (100%) rename {input => scenarios}/v3.1/kelheim-v3.1-25pct.kexi-with-av-intermodal.config.xml (100%) rename {input => scenarios}/v3.1/kelheim-v3.1-25pct.kexi-with-av.config.xml (100%) rename {input => scenarios}/v3.1/kelheim-v3.1-25pct.kexi.config.xml (100%) rename {input => scenarios}/v3.1/kelheim-v3.1-config.xml (100%) diff --git a/Makefile b/Makefile index 7887d84e..8005e8bf 100644 --- a/Makefile +++ b/Makefile @@ -73,7 +73,7 @@ input/sumo.net.xml: input/network.osm --osm-files $< -o=$@ -input/$V/kelheim-$V-network.xml.gz: input/sumo.net.xml +scenarios/$V/kelheim-$V-network.xml.gz: input/sumo.net.xml $(sc) prepare network-from-sumo $<\ --output $@ @@ -82,7 +82,7 @@ input/$V/kelheim-$V-network.xml.gz: input/sumo.net.xml --network $@\ --output $@ -input/$V/kelheim-$V-network-with-pt.xml.gz: input/$V/kelheim-$V-network.xml.gz +scenarios/$V/kelheim-$V-network-with-pt.xml.gz: input/$V/kelheim-$V-network.xml.gz $(sc) prepare transit-from-gtfs --network $<\ --name kelheim-$V --date "2021-08-18" --target-crs $(CRS) \ --output input/$V\ @@ -102,7 +102,7 @@ input/freight-trips.xml.gz: input/$V/kelheim-$V-network.xml.gz --shp ../shared-svn/projects/KelRide/matsim-input-files/20211217_kelheim/20211217_kehlheim/kehlheim.shp --shp-crs $(CRS)\ --output $@ -input/$V/kelheim-$V-25pct.plans-initial.xml.gz: input/freight-trips.xml.gz input/$V/kelheim-$V-network.xml.gz +scenarios/$V/kelheim-$V-25pct.plans-initial.xml.gz: input/freight-trips.xml.gz scenarios/$V/kelheim-$V-network.xml.gz $(sc) prepare trajectory-to-plans\ --name prepare --sample-size 0.25\ --max-typical-duration 0\ @@ -141,11 +141,11 @@ input/$V/kelheim-$V-25pct.plans-initial.xml.gz: input/freight-trips.xml.gz input --samples 0.1 0.01\ -check: input/$V/kelheim-$V-25pct.plans-initial.xml.gz +check: scenarios/$V/kelheim-$V-25pct.plans-initial.xml.gz $(sc) analysis check-population $<\ --input-crs $(CRS)\ --shp ../shared-svn/projects/KelRide/matsim-input-files/20211217_kelheim/20211217_kehlheim/kehlheim.shp --shp-crs $(CRS) # Aggregated target -prepare: input/$V/kelheim-$V-25pct.plans-initial.xml.gz input/$V/kelheim-$V-network-with-pt.xml.gz +prepare: scenarios/$V/kelheim-$V-25pct.plans-initial.xml.gz scenarios/$V/kelheim-$V-network-with-pt.xml.gz echo "Done" \ No newline at end of file diff --git a/input/shp/dilutionArea.cpg b/scenarios/shp/dilutionArea.cpg similarity index 100% rename from input/shp/dilutionArea.cpg rename to scenarios/shp/dilutionArea.cpg diff --git a/input/shp/dilutionArea.dbf b/scenarios/shp/dilutionArea.dbf similarity index 100% rename from input/shp/dilutionArea.dbf rename to scenarios/shp/dilutionArea.dbf diff --git a/input/shp/dilutionArea.prj b/scenarios/shp/dilutionArea.prj similarity index 100% rename from input/shp/dilutionArea.prj rename to scenarios/shp/dilutionArea.prj diff --git a/input/shp/dilutionArea.qmd b/scenarios/shp/dilutionArea.qmd similarity index 100% rename from input/shp/dilutionArea.qmd rename to scenarios/shp/dilutionArea.qmd diff --git a/input/shp/dilutionArea.shp b/scenarios/shp/dilutionArea.shp similarity index 100% rename from input/shp/dilutionArea.shp rename to scenarios/shp/dilutionArea.shp diff --git a/input/shp/dilutionArea.shx b/scenarios/shp/dilutionArea.shx similarity index 100% rename from input/shp/dilutionArea.shx rename to scenarios/shp/dilutionArea.shx diff --git a/input/test.config.xml b/scenarios/test/test.config.xml similarity index 100% rename from input/test.config.xml rename to scenarios/test/test.config.xml diff --git a/input/test.with-drt.config.xml b/scenarios/test/test.with-drt.config.xml similarity index 100% rename from input/test.with-drt.config.xml rename to scenarios/test/test.with-drt.config.xml diff --git a/input/v3.0/kelheim-v3.0-25pct.kexi-with-av.config.xml b/scenarios/v3.0/kelheim-v3.0-25pct.kexi-with-av.config.xml similarity index 100% rename from input/v3.0/kelheim-v3.0-25pct.kexi-with-av.config.xml rename to scenarios/v3.0/kelheim-v3.0-25pct.kexi-with-av.config.xml diff --git a/input/v3.0/kelheim-v3.0-25pct.kexi.config.xml b/scenarios/v3.0/kelheim-v3.0-25pct.kexi.config.xml similarity index 100% rename from input/v3.0/kelheim-v3.0-25pct.kexi.config.xml rename to scenarios/v3.0/kelheim-v3.0-25pct.kexi.config.xml diff --git a/input/v3.0/kelheim-v3.0-config.xml b/scenarios/v3.0/kelheim-v3.0-config.xml similarity index 100% rename from input/v3.0/kelheim-v3.0-config.xml rename to scenarios/v3.0/kelheim-v3.0-config.xml diff --git a/input/v3.1/kelheim-v3.1-25pct.kexi-with-av-intermodal.config.xml b/scenarios/v3.1/kelheim-v3.1-25pct.kexi-with-av-intermodal.config.xml similarity index 100% rename from input/v3.1/kelheim-v3.1-25pct.kexi-with-av-intermodal.config.xml rename to scenarios/v3.1/kelheim-v3.1-25pct.kexi-with-av-intermodal.config.xml diff --git a/input/v3.1/kelheim-v3.1-25pct.kexi-with-av.config.xml b/scenarios/v3.1/kelheim-v3.1-25pct.kexi-with-av.config.xml similarity index 100% rename from input/v3.1/kelheim-v3.1-25pct.kexi-with-av.config.xml rename to scenarios/v3.1/kelheim-v3.1-25pct.kexi-with-av.config.xml diff --git a/input/v3.1/kelheim-v3.1-25pct.kexi.config.xml b/scenarios/v3.1/kelheim-v3.1-25pct.kexi.config.xml similarity index 100% rename from input/v3.1/kelheim-v3.1-25pct.kexi.config.xml rename to scenarios/v3.1/kelheim-v3.1-25pct.kexi.config.xml diff --git a/input/v3.1/kelheim-v3.1-config.xml b/scenarios/v3.1/kelheim-v3.1-config.xml similarity index 100% rename from input/v3.1/kelheim-v3.1-config.xml rename to scenarios/v3.1/kelheim-v3.1-config.xml diff --git a/src/main/R/srv.R b/src/main/R/srv.R index 9ff94757..af52b16e 100644 --- a/src/main/R/srv.R +++ b/src/main/R/srv.R @@ -16,7 +16,7 @@ theme_set(theme_Publication(18)) levels <- c("0 - 1000", "1000 - 2000", "2000 - 5000", "5000 - 10000", "10000 - 20000", "20000+") breaks <- c(0, 1000, 2000, 5000, 10000, 20000, Inf) -shape <- st_read("../../../input/shp/dilutionArea.shp", crs=25832) +shape <- st_read("../../../scenarios/shp/dilutionArea.shp", crs=25832) ######### # Read simulation data diff --git a/src/main/java/org/matsim/run/RunKelheimScenario.java b/src/main/java/org/matsim/run/RunKelheimScenario.java index 7c89df3d..57c84d84 100644 --- a/src/main/java/org/matsim/run/RunKelheimScenario.java +++ b/src/main/java/org/matsim/run/RunKelheimScenario.java @@ -136,7 +136,7 @@ public RunKelheimScenario(@Nullable Config config) { } public RunKelheimScenario() { - super(String.format("input/v%s/kelheim-v%s-config.xml", VERSION, VERSION)); + super(String.format("scenarios/v%s/kelheim-v%s-config.xml", VERSION, VERSION)); } public static void main(String[] args) { diff --git a/src/main/python/calibrate.py b/src/main/python/calibrate.py index 871be716..e7ddf710 100755 --- a/src/main/python/calibrate.py +++ b/src/main/python/calibrate.py @@ -29,8 +29,8 @@ "ride": 0.17 } -city = gpd.read_file("../input/shp/dilutionArea.shp").set_crs("EPSG:25832") -homes = pd.read_csv("../input/v3.0/kelheim-v3.0-homes.csv", dtype={"person": "str"}) +city = gpd.read_file("../scenarios/shp/dilutionArea.shp").set_crs("EPSG:25832") +homes = pd.read_csv("../scenarios/v3.0/kelheim-v3.0-homes.csv", dtype={"person": "str"}) def f(persons): persons = pd.merge(persons, homes, how="inner", left_on="person", right_on="person") diff --git a/src/test/java/org/matsim/run/MeanNoiseDashboardTest.java b/src/test/java/org/matsim/run/MeanNoiseDashboardTest.java index e53ed822..97ed5baf 100644 --- a/src/test/java/org/matsim/run/MeanNoiseDashboardTest.java +++ b/src/test/java/org/matsim/run/MeanNoiseDashboardTest.java @@ -43,12 +43,12 @@ void runMeanNoiseDashboardTest() throws IOException { String networkPath = "https://svn.vsp.tu-berlin.de/repos/public-svn/matsim/scenarios/countries/de/kelheim/kelheim-v3.0/input/kelheim-v3.0-network.xml.gz"; String crs = "EPSG:25832"; - String path = utils.getInputDirectory(); + String outputpath = utils.getOutputDirectory(); NoiseAverageAnalysis analysis = new NoiseAverageAnalysis(); List foldersSeeded = new ArrayList<>(); - new CreateGeoJsonNetwork().execute(List.of("--network", networkPath, "--with-properties", "--shp", "./input/shp/dilutionArea.shp", "--output-network", path + "1seed/analysis/network/network.geojson", + new CreateGeoJsonNetwork().execute(List.of("--network", networkPath, "--with-properties", "--shp", "./scenarios/shp/dilutionArea.shp", "--output-network", outputpath + "1seed/analysis/network/network.geojson", "--input-crs", "EPSG:25832").toArray(new String[0])); // write dummy data @@ -67,7 +67,7 @@ void runMeanNoiseDashboardTest() throws IOException { data.put("imissions", List.of((float) i)); - String seedDir = path + i + "seed/"; + String seedDir = outputpath + i + "seed/"; foldersSeeded.add(seedDir); // write avro dummy files @@ -86,17 +86,17 @@ void runMeanNoiseDashboardTest() throws IOException { sw.getConfigGroup().defaultParams().mapCenter = "11.89,48.91"; sw.addDashboard(Dashboard.customize(new AverageKelheimNoiseDashboard(foldersSeeded, 3)).context("noise")); try { - sw.generate(Path.of(path), true); + sw.generate(Path.of(outputpath), true); } catch (IOException e) { throw new RuntimeException(e); } - sw.run(Path.of(path)); + sw.run(Path.of(outputpath)); // assert that: a) mean immission is 2.0 on daily and hourly data b) hourly data has timestamp 28800 c) mean emission is 2.0 List daily = new ArrayList<>(); List hourly = new ArrayList<>(); - analysis.readAvroFile(path + "analysis/postAnalysis-noise/mean_immission_per_day.avro", daily); - analysis.readAvroFile(path + "analysis/postAnalysis-noise/mean_immission_per_hour.avro", hourly); + analysis.readAvroFile(outputpath + "analysis/postAnalysis-noise/mean_immission_per_day.avro", daily); + analysis.readAvroFile(outputpath + "analysis/postAnalysis-noise/mean_immission_per_hour.avro", hourly); if (daily.getFirst().get(4) instanceof HashMap) { Map.Entry entry = ((HashMap) daily.getFirst().get(4)).entrySet().stream().toList().getFirst(); @@ -119,10 +119,10 @@ void runMeanNoiseDashboardTest() throws IOException { Assertions.assertEquals(28800, timeStamp); } - Table emissions = Table.read().csv(CsvReadOptions.builder(IOUtils.getBufferedReader(path + "analysis/postAnalysis-noise/mean_emission_per_day.csv")) + Table emissions = Table.read().csv(CsvReadOptions.builder(IOUtils.getBufferedReader(outputpath + "analysis/postAnalysis-noise/mean_emission_per_day.csv")) .columnTypesPartial(Map.of("Link Id", ColumnType.STRING, "value", ColumnType.DOUBLE)) .sample(false) - .separator(CsvOptions.detectDelimiter(path + "analysis/postAnalysis-noise/mean_emission_per_day.csv")).build()); + .separator(CsvOptions.detectDelimiter(outputpath + "analysis/postAnalysis-noise/mean_emission_per_day.csv")).build()); String linkId = emissions.row(0).getString("Link Id"); double emission = emissions.row(0).getDouble("value"); diff --git a/src/test/java/org/matsim/run/RunKelheimIntegrationTest.java b/src/test/java/org/matsim/run/RunKelheimIntegrationTest.java index f7584e80..05bd232f 100644 --- a/src/test/java/org/matsim/run/RunKelheimIntegrationTest.java +++ b/src/test/java/org/matsim/run/RunKelheimIntegrationTest.java @@ -15,7 +15,7 @@ public class RunKelheimIntegrationTest { @Test public final void runExamplePopulationTest() { - Config config = ConfigUtils.loadConfig("input/test.config.xml"); + Config config = ConfigUtils.loadConfig("scenarios/test/test.config.xml"); config.controller().setLastIteration(1); config.global().setNumberOfThreads(1); config.qsim().setNumberOfThreads(1); @@ -29,7 +29,7 @@ public final void runExamplePopulationTest() { @Test public final void runDrtExamplePopulationTest() { - Config config = ConfigUtils.loadConfig("input/test.with-drt.config.xml"); + Config config = ConfigUtils.loadConfig("scenarios/test/test.with-drt.config.xml"); config.controller().setLastIteration(1); config.controller().setOverwriteFileSetting(OutputDirectoryHierarchy.OverwriteFileSetting.deleteDirectoryIfExists);