diff --git a/Makefile b/Makefile index 0d7f5e5f..feb71b7b 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ JAR := matsim-berlin-*.jar -V := v6.2 +V := v6.3 CRS := EPSG:25832 p := input/$V diff --git a/pom.xml b/pom.xml index 33cc4cc4..ad41c4c8 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ 4.0.0 com.github.matsim-scenarios matsim-berlin - 6.2-SNAPSHOT + 6.3-SNAPSHOT MATSim Open Berlin scenario MATSim Open Berlin scenario diff --git a/src/main/java/org/matsim/run/OpenBerlinScenario.java b/src/main/java/org/matsim/run/OpenBerlinScenario.java index abaeb224..161472c5 100644 --- a/src/main/java/org/matsim/run/OpenBerlinScenario.java +++ b/src/main/java/org/matsim/run/OpenBerlinScenario.java @@ -30,7 +30,7 @@ public class OpenBerlinScenario extends MATSimApplication { private static final Logger log = LogManager.getLogger(RunOpenBerlinCalibration.class); - public static final String VERSION = "6.2"; + public static final String VERSION = "6.3"; public static final String CRS = "EPSG:25832"; @CommandLine.Mixin private final SampleOptions sample = new SampleOptions(10, 25, 3, 1); diff --git a/src/main/python/extract_income.py b/src/main/python/extract_income.py deleted file mode 100644 index 2a20ecac..00000000 --- a/src/main/python/extract_income.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import argparse -import numpy as np -import os -from matsim.scenariogen.data import read_all - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description="Converter for survey data") - - parser.add_argument("-d", "--directory", default=os.path.expanduser( - "~/Development/matsim-scenarios/shared-svn/projects/matsim-berlin/data/SrV/")) - - args = parser.parse_args() - - hh, persons, trips = read_all([args.directory + "Berlin+Umland", args.directory + "Brandenburg"]) - - hh = hh[hh.income >= 0] - - # Large households are underrepresented and capped (same operation as in input) - hh.n_persons = np.minimum(hh.n_persons, 5) - - groups = list(sorted(set(hh.income))) - - def calc(x): - counts = x.groupby("income").size() - prob = counts / sum(counts) - return prob.to_frame().transpose() - - - dist = hh.groupby(["economic_status"]).apply(calc).fillna(0).reset_index().drop(columns=["level_1"]) - - print("Income groups:", groups) - - for t in dist[["economic_status"] + groups].itertuples(): - print('"%s", new double[]{%s},' % (t.economic_status, ", ".join("%.3f" % x for x in t[2:]))) diff --git a/src/main/python/extract_trips.py b/src/main/python/extract_trips.py deleted file mode 100644 index 5ec0d123..00000000 --- a/src/main/python/extract_trips.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import numpy as np -from matsim.scenariogen.data import read_all - -from extract_ref_data import trip_filter - -if __name__ == "__main__": - hh, persons, trips = read_all("../../../../shared-svn/projects/matsim-berlin/data/SrV/Berlin+Umland") - - trips = trip_filter(trips) - trips = trips[trips.valid] - trips = trips[(~trips.from_zone.isna()) & (~trips.to_zone.isna())] - trips = trips[(~trips.from_location.isna()) & (~trips.to_location.isna())] - - trips_hh = trips.merge(hh, left_on="hh_id", right_index=True) - - trips = trips[trips_hh.location == "Berlin"] - - # Duplication factor - factor = 3 - - repeats = np.maximum(1, np.rint(trips.t_weight * factor)).to_numpy(int) - index = trips.index.repeat(repeats) - df = trips.loc[index] - - # Each sample has a unique sequence number - seq = np.zeros(len(df), dtype=int) - - i = 0 - for r in repeats: - for s in range(r): - seq[i] = s - i += 1 - - df["seq"] = seq - - df = df.drop(columns=["valid"]) - # Norm weight to 3 as well - df.t_weight = df.t_weight / 3 - - df_hh = df.merge(hh, left_on="hh_id", right_index=True) - df["hh_cars"] = df_hh["n_cars"] - - df = df.sort_values(["p_id", "seq", "n"]) - df.to_csv("trips-scaled.csv", index=False) - - persons.to_csv("persons-unscaled.csv", index=False)