From 0a26134fdafdf3355b46ab40494e43d2cc2b0d9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Mon, 30 Sep 2024 22:32:47 +0200 Subject: [PATCH 01/15] add motorbikes --- analysis/marginals.py | 24 ++++++++------ analysis/reference/hts/mode_distances.py | 2 +- analysis/synthesis/mode_distances.py | 2 +- data/census/cleaned.py | 13 ++++---- data/hts/edgt_44/cleaned.py | 11 ++++--- data/hts/edgt_lyon/cleaned_adisp.py | 11 ++++--- data/hts/edgt_lyon/cleaned_cerema.py | 11 ++++--- data/hts/edgt_lyon/raw_adisp.py | 2 +- data/hts/egt/cleaned.py | 10 +++--- data/hts/entd/cleaned.py | 16 +++++----- data/hts/hts.py | 2 +- data/od/cleaned.py | 4 +-- documentation/plots/secondary_locations.py | 5 ++- .../plots/sociodemographics/general.py | 13 +++++--- documentation/plotting.py | 3 +- matsim/scenario/households.py | 5 +-- matsim/scenario/population.py | 5 +-- synthesis/output.py | 4 +-- synthesis/population/enriched.py | 31 +++++++++++++------ synthesis/population/matched.py | 4 +-- .../population/spatial/secondary/locations.py | 4 +-- synthesis/vehicles/motorbikes/default.py | 31 +++++++++++++++++++ synthesis/vehicles/vehicles.py | 6 ++-- 23 files changed, 141 insertions(+), 78 deletions(-) create mode 100644 synthesis/vehicles/motorbikes/default.py diff --git a/analysis/marginals.py b/analysis/marginals.py index 98baf359..011c9f91 100644 --- a/analysis/marginals.py +++ b/analysis/marginals.py @@ -8,14 +8,17 @@ HOUSEHOLD_SIZE_BOUNDS = [1, 3, np.inf] HOUSEHOLD_SIZE_LABELS = ["1", "2-3", "4+"] -NUMBER_OF_VEHICLES_BOUNDS = [0, 1, 2, np.inf] -NUMBER_OF_VEHICLES_LABELS = ["0", "1", "2", "3+"] +NUMBER_OF_CARS_BOUNDS = [0, 1, 2, np.inf] +NUMBER_OF_CARS_LABELS = ["0", "1", "2", "3+"] -NUMBER_OF_BIKES_BOUNDS = [0, 1, 2, np.inf] -NUMBER_OF_BIKES_LABELS = ["0", "1", "2", "3+"] +NUMBER_OF_BICYCLES_BOUNDS = [0, 1, 2, np.inf] +NUMBER_OF_BICYCLES_LABELS = ["0", "1", "2", "3+"] + +NUMBER_OF_MOTORBIKES_BOUNDS = [0, 1, 2, np.inf] +NUMBER_OF_MOTORBIKES_LABELS = ["0", "1", "2", "3+"] GENERAL_PERSON_MARGINALS = [("age_class",), ("sex",), ("employed",), ("studies",)] -GENERAL_HOUSEHOLD_MARGINALS = [("household_size_class",), ("number_of_vehicles_class",)] +GENERAL_HOUSEHOLD_MARGINALS = [("household_size_class",), ("number_of_cars_class",)] CENSUS_PERSON_MARGINALS = GENERAL_PERSON_MARGINALS + [("socioprofessional_class",)] CENSUS_HOUSEHOLD_MARGINALS = GENERAL_HOUSEHOLD_MARGINALS @@ -34,11 +37,14 @@ def prepare_classes(df): if "household_size" in df: df["household_size_class"] = np.digitize(df["household_size"], HOUSEHOLD_SIZE_BOUNDS, right = True) - if "number_of_vehicles" in df: - df["number_of_vehicles_class"] = np.digitize(df["number_of_vehicles"], NUMBER_OF_VEHICLES_BOUNDS, right = True) + if "number_of_cars" in df: + df["number_of_cars_class"] = np.digitize(df["number_of_cars"], NUMBER_OF_CARS_BOUNDS, right = True) + + if "number_of_bicycles" in df: + df["number_of_bicycles_class"] = np.digitize(df["number_of_bicycles"], NUMBER_OF_BICYCLES_BOUNDS, right = True) - if "number_of_bikes" in df: - df["number_of_bikes_class"] = np.digitize(df["number_of_bikes"], NUMBER_OF_BIKES_BOUNDS, right = True) + if "number_of_motorbikes" in df: + df["number_of_motorbikes_class"] = np.digitize(df["number_of_motorbikes"], NUMBER_OF_MOTORBIKES_BOUNDS, right = True) def cross(*marginals): result = [] diff --git a/analysis/reference/hts/mode_distances.py b/analysis/reference/hts/mode_distances.py index 6b556bd5..733d64b8 100644 --- a/analysis/reference/hts/mode_distances.py +++ b/analysis/reference/hts/mode_distances.py @@ -20,7 +20,7 @@ def execute(context): data = dict() - for mode in ["car", "car_passenger", "pt", "bike", "walk"]: + for mode in ["car", "car_passenger", "pt", "bicycle", "motorbike", "walk"]: f = df["mode"] == mode if np.count_nonzero(f) > 0: diff --git a/analysis/synthesis/mode_distances.py b/analysis/synthesis/mode_distances.py index eea6b36d..96a87923 100644 --- a/analysis/synthesis/mode_distances.py +++ b/analysis/synthesis/mode_distances.py @@ -15,7 +15,7 @@ def execute(context): acquisition_sample_size = context.config("acquisition_sample_size") probabilities = np.linspace(0.0, 1.0, 20) - modes = ["car", "car_passenger", "pt", "bike", "walk"] + modes = ["car", "car_passenger", "pt", "bicycle", "motorbike", "walk"] quantiles = { mode : [] for mode in modes } diff --git a/data/census/cleaned.py b/data/census/cleaned.py index 789d0adb..8e4548e3 100644 --- a/data/census/cleaned.py +++ b/data/census/cleaned.py @@ -60,9 +60,10 @@ def execute(context): # Clean TRANS df.loc[df["TRANS"] == "1", "commute_mode"] = np.nan df.loc[df["TRANS"] == "2", "commute_mode"] = "walk" - df.loc[df["TRANS"] == "3", "commute_mode"] = "bike" - df.loc[df["TRANS"] == "4", "commute_mode"] = "car" - df.loc[df["TRANS"] == "5", "commute_mode"] = "pt" + df.loc[df["TRANS"] == "3", "commute_mode"] = "bicycle" + df.loc[df["TRANS"] == "4", "commute_mode"] = "motorbike" + df.loc[df["TRANS"] == "5", "commute_mode"] = "car" + df.loc[df["TRANS"] == "6", "commute_mode"] = "pt" df.loc[df["TRANS"] == "Z", "commute_mode"] = np.nan df["commute_mode"] = df["commute_mode"].astype("category") @@ -81,11 +82,11 @@ def execute(context): df["studies"] = df["ETUD"] == "1" # Number of vehicles - df["number_of_vehicles"] = df["VOIT"].apply( + df["number_of_cars"] = df["VOIT"].apply( lambda x: str(x).replace("Z", "0").replace("X", "0") ).astype(int) - df["number_of_vehicles"] += df["DEROU"].apply( + df["number_of_motorbikes"] += df["DEROU"].apply( lambda x: str(x).replace("U", "0").replace("Z", "0").replace("X", "0") ).astype(int) @@ -104,7 +105,7 @@ def execute(context): "iris_id", "commune_id", "departement_id", "age", "sex", "couple", "commute_mode", "employed", - "studies", "number_of_vehicles", "household_size", + "studies", "number_of_cars", "number_of_motorbikes", "household_size", "consumption_units", "socioprofessional_class" ]] diff --git a/data/hts/edgt_44/cleaned.py b/data/hts/edgt_44/cleaned.py index 1fa9b526..9665c651 100644 --- a/data/hts/edgt_44/cleaned.py +++ b/data/hts/edgt_44/cleaned.py @@ -19,10 +19,11 @@ def configure(context): } MODES_MAP = { - "car": [13, 15, 21, 81], + "car": [21, 81], "car_passenger": [14, 16, 22, 82], "pt": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 72, 73, 91, 92, 94, 95], - "bike": [11, 17, 12, 18, 93, 19], + "bicycle": [11, 17, 12, 18, 93, 19], + "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -90,9 +91,9 @@ def execute(context): df_persons["studies"] = df_persons["P7"].isin(["3", "4", "5"]) # Number of vehicles - df_households["number_of_vehicles"] = df_households["M6"] + df_households["M5"] - df_households["number_of_vehicles"] = df_households["number_of_vehicles"].astype(int) - df_households["number_of_bikes"] = df_households["M7"].astype(int) + df_households["number_of_cars"] = df_households["M6"].astype(int) + df_households["number_of_motorbikes"] = df_households["M5"].astype(int) + df_households["number_of_bicycles"] = df_households["M7"].astype(int) # License df_persons["has_license"] = df_persons["P5"] == "1" diff --git a/data/hts/edgt_lyon/cleaned_adisp.py b/data/hts/edgt_lyon/cleaned_adisp.py index 30a4dfcd..dcc57f76 100644 --- a/data/hts/edgt_lyon/cleaned_adisp.py +++ b/data/hts/edgt_lyon/cleaned_adisp.py @@ -20,10 +20,11 @@ def configure(context): } MODES_MAP = { - "car": [13, 15, 21, 81], + "car": [21, 81], "car_passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], - "bike": [11, 17, 12, 18, 93], + "bicycle": [11, 17, 12, 18, 93], + "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -106,9 +107,9 @@ def execute(context): df_persons["studies"] = df_persons["P9"].isin(["3", "4", "5"]) # Number of vehicles - df_households["number_of_vehicles"] = df_households["M6"] + df_households["M14"] - df_households["number_of_vehicles"] = df_households["number_of_vehicles"].astype(int) - df_households["number_of_bikes"] = df_households["M21"].astype(int) + df_households["number_of_cars"] = df_households["M6"].astype(int) + df_households["number_of_bicycles"] = df_households["M21"].astype(int) + df_households["number_of_motorbikes"] = df_households["M14"].astype(int) # License df_persons["has_license"] = df_persons["P7"] == "1" diff --git a/data/hts/edgt_lyon/cleaned_cerema.py b/data/hts/edgt_lyon/cleaned_cerema.py index d452820b..87907620 100644 --- a/data/hts/edgt_lyon/cleaned_cerema.py +++ b/data/hts/edgt_lyon/cleaned_cerema.py @@ -19,10 +19,11 @@ def configure(context): } MODES_MAP = { - "car": [13, 15, 21, 81], + "car": [21, 81], "car_passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], - "bike": [11, 17, 12, 18, 93], + "bicycle": [11, 17, 12, 18, 93], + "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -105,9 +106,9 @@ def execute(context): df_persons["studies"] = df_persons["P7"].isin(["3", "4", "5"]) # Number of vehicles - df_households["number_of_vehicles"] = df_households["M6"] + df_households["M5"] - df_households["number_of_vehicles"] = df_households["number_of_vehicles"].astype(int) - df_households["number_of_bikes"] = df_households["M7"].astype(int) + df_households["number_of_cars"] = df_households["M6"].astype(int) + df_households["number_of_bicycles"] = df_households["M7"].astype(int) + df_households["number_of_motorbikes"] = df_households["M5"].astype(int) # License df_persons["has_license"] = df_persons["P5"] == "1" diff --git a/data/hts/edgt_lyon/raw_adisp.py b/data/hts/edgt_lyon/raw_adisp.py index 5ec5f111..b69c6ce7 100644 --- a/data/hts/edgt_lyon/raw_adisp.py +++ b/data/hts/edgt_lyon/raw_adisp.py @@ -15,7 +15,7 @@ def configure(context): HOUSEHOLD_COLUMNS = { "ECH": str, "ZFM": str, # id - "M6": int, "M21": int, "M14": int, # number_of_cars, number_of_bikes, number_of_motorbikes + "M6": int, "M21": int, "M14": int, # number_of_cars, number_of_bicycles, number_of_motorbikes "COE0": float # weights } diff --git a/data/hts/egt/cleaned.py b/data/hts/egt/cleaned.py index 197da72b..3b5fb0f6 100644 --- a/data/hts/egt/cleaned.py +++ b/data/hts/egt/cleaned.py @@ -31,8 +31,8 @@ def configure(context): 1 : "pt", 2 : "car", 3 : "car_passenger", - 4 : "car", - 5 : "bike", + 4 : "motorbike", + 5 : "bicycle", #6 : "pt", # default (other) 7 : "walk" } @@ -99,9 +99,9 @@ def execute(context): df_persons["studies"] = df_persons["OCCP"].isin([3.0, 4.0, 5.0]) # Number of vehicles - df_households["number_of_vehicles"] = df_households["NB_2RM"] + df_households["NB_VD"] - df_households["number_of_vehicles"] = df_households["number_of_vehicles"].astype(int) - df_households["number_of_bikes"] = df_households["NB_VELO"].astype(int) + df_households["number_of_cars"] = df_households["NB_VD"].astype(int) + df_households["number_of_bicycles"] = df_households["NB_VELO"].astype(int) + df_households["number_of_motorbikes"] = df_households["NB_2RM"].astype(int) # License df_persons["has_license"] = (df_persons["PERMVP"] == 1) | (df_persons["PERM2RM"] == 1) diff --git a/data/hts/entd/cleaned.py b/data/hts/entd/cleaned.py index 51bfd966..4a9a9fc7 100644 --- a/data/hts/entd/cleaned.py +++ b/data/hts/entd/cleaned.py @@ -28,7 +28,7 @@ def configure(context): MODES_MAP = [ ("1", "walk"), ("2", "car"), # - ("2.20", "bike"), # bike + ("2.20", "bicycle"), # bike ("2.23", "car_passenger"), # motorcycle passenger ("2.25", "car_passenger"), # same ("3", "car"), @@ -135,13 +135,15 @@ def execute(context): df_persons.loc[df_persons["age"] < 5, "studies"] = False # Number of vehicles - df_households["number_of_vehicles"] = 0 - df_households["number_of_vehicles"] += df_households["V1_JNBVEH"].fillna(0) - df_households["number_of_vehicles"] += df_households["V1_JNBMOTO"].fillna(0) - df_households["number_of_vehicles"] += df_households["V1_JNBCYCLO"].fillna(0) - df_households["number_of_vehicles"] = df_households["number_of_vehicles"].astype(int) + df_households["number_of_cars"] = df_households["V1_JNBVEH"].fillna(0) + df_households["number_of_cars"] = df_households["number_of_cars"].astype(int) - df_households["number_of_bikes"] = df_households["V1_JNBVELOADT"].fillna(0).astype(int) + df_households["number_of_motorbikes"] = 0 + df_households["number_of_motorbikes"] += df_households["V1_JNBMOTO"].fillna(0) + df_households["number_of_motorbikes"] += df_households["V1_JNBCYCLO"].fillna(0) + df_households["number_of_motorbikes"] = df_households["number_of_motorbikes"].astype(int) + + df_households["number_of_bicycles"] = df_households["V1_JNBVELOADT"].fillna(0).astype(int) # License df_persons["has_license"] = (df_persons["V1_GPERMIS"] == 1) | (df_persons["V1_GPERMIS2R"] == 1) diff --git a/data/hts/hts.py b/data/hts/hts.py index 86bc0365..d65b253b 100644 --- a/data/hts/hts.py +++ b/data/hts/hts.py @@ -222,7 +222,7 @@ def calculate_consumption_units(df_persons): HOUSEHOLD_COLUMNS = [ "household_id", "household_weight", "household_size", - "number_of_vehicles", "number_of_bikes", "departement_id", + "number_of_cars", "number_of_bicycles", "number_of_bikes", "departement_id", "consumption_units", # "income_class" ] diff --git a/data/od/cleaned.py b/data/od/cleaned.py index e13348f1..dc619be0 100644 --- a/data/od/cleaned.py +++ b/data/od/cleaned.py @@ -50,8 +50,8 @@ def execute(context): df_work["commute_mode"] = np.nan df_work.loc[df_work["TRANS"] == 1, "commute_mode"] = "no transport" df_work.loc[df_work["TRANS"] == 2, "commute_mode"] = "walk" - df_work.loc[df_work["TRANS"] == 3, "commute_mode"] = "bike" - df_work.loc[df_work["TRANS"] == 4, "commute_mode"] = "car" + df_work.loc[df_work["TRANS"] == 3, "commute_mode"] = "bicycle" + df_work.loc[df_work["TRANS"] == 4, "commute_mode"] = "motorbike" df_work.loc[df_work["TRANS"] == 5, "commute_mode"] = "car" df_work.loc[df_work["TRANS"] == 6, "commute_mode"] = "pt" df_work["commute_mode"] = df_work["commute_mode"].astype("category") diff --git a/documentation/plots/secondary_locations.py b/documentation/plots/secondary_locations.py index 296fb335..761aacaf 100644 --- a/documentation/plots/secondary_locations.py +++ b/documentation/plots/secondary_locations.py @@ -21,7 +21,6 @@ def execute(context): plt.figure() modes = list(context.stage("analysis.reference.hts.mode_distances").keys()) - #modes = ["car", "car_passenger", "pt", "bike", "walk"] for index, mode in enumerate(modes): mode_distribution = distributions[mode] @@ -71,10 +70,10 @@ def execute(context): limits = dict( car = 20 * 1e3, car_passenger = 20 * 1e3, pt = 20 * 1e3, - bike = 6 * 1e3, walk = 1 * 1e3 + bicycle = 6 * 1e3, walk = 1 * 1e3 ) - modes = ["car", "bike" if "bike" in modes else "walk" ] + modes = ["car", "bicycle" if "bicycle" in modes else "walk" ] for index, mode in enumerate(modes): plt.subplot(1, 2, index + 1) diff --git a/documentation/plots/sociodemographics/general.py b/documentation/plots/sociodemographics/general.py index 869f0604..90e84e5f 100644 --- a/documentation/plots/sociodemographics/general.py +++ b/documentation/plots/sociodemographics/general.py @@ -79,11 +79,14 @@ def label(row): elif row["attribute"] == "household_size_class": return "Household size %s" % analysis.marginals.HOUSEHOLD_SIZE_LABELS[row["value"]] - elif row["attribute"] == "number_of_vehicles_class": - return "No. vehicles %s" % analysis.marginals.NUMBER_OF_VEHICLES_LABELS[row["value"]] + elif row["attribute"] == "number_of_cars_class": + return "No. vehicles %s" % analysis.marginals.NUMBER_OF_CARS_LABELS[row["value"]] - elif row["attribute"] == "number_of_bikes_class": - return "No. bicycles %s" % analysis.marginals.NUMBER_OF_BIKES_LABELS[row["value"]] + elif row["attribute"] == "number_of_bicycles_class": + return "No. bicycles %s" % analysis.marginals.NUMBER_OF_BICYCLES_LABELS[row["value"]] + + elif row["attribute"] == "number_of_motorbikes_class": + return "No. motorbikes %s" % analysis.marginals.NUMBER_OF_MOTORBIKES_LABELS[row["value"]] def add_labels(df_figure): df_figure["label"] = df_figure.apply(label, axis = 1, raw = False) @@ -115,7 +118,7 @@ def execute(context): ), dict( level = "household", label = "Number of households", size = plotting.WIDE_FIGSIZE, - marginals = ["household_size_class", "number_of_vehicles_class", "number_of_bikes_class"] + marginals = ["household_size_class", "number_of_cars_class", "number_of_bikes_class"] ) ] diff --git a/documentation/plotting.py b/documentation/plotting.py index 7900d8de..b64c2542 100644 --- a/documentation/plotting.py +++ b/documentation/plotting.py @@ -23,7 +23,8 @@ car = "Car driver", car_passenger = "Car passenger", pt = "Public transport", - bike = "Bicycle", + bicycle = "Bicycle", + motorbike = "Motorbike", walk = "Walking" ) diff --git a/matsim/scenario/households.py b/matsim/scenario/households.py index 2f47cfee..25bba8e4 100644 --- a/matsim/scenario/households.py +++ b/matsim/scenario/households.py @@ -8,7 +8,7 @@ def configure(context): context.stage("synthesis.population.enriched") -FIELDS = ["household_id", "person_id", "household_income", "car_availability", "bike_availability", "census_household_id"] +FIELDS = ["household_id", "person_id", "household_income", "car_availability", "motorbike_availability", "bicycle_availability", "census_household_id"] def add_household(writer, household, member_ids): writer.start_household(household[FIELDS.index("household_id")]) @@ -16,7 +16,8 @@ def add_household(writer, household, member_ids): writer.start_attributes() writer.add_attribute("carAvailability", "java.lang.String", household[FIELDS.index("car_availability")]) - writer.add_attribute("bikeAvailability", "java.lang.String", household[FIELDS.index("bike_availability")]) + writer.add_attribute("motorbikeAvailability", "java.lang.String", household[FIELDS.index("motorbike_availability")]) + writer.add_attribute("bicycleAvailability", "java.lang.String", household[FIELDS.index("bicycle_availability")]) writer.add_attribute("household_income", "java.lang.Double", household[FIELDS.index("household_income")]) writer.add_attribute("censusId", "java.lang.Long", household[FIELDS.index("census_household_id")]) writer.end_attributes() diff --git a/matsim/scenario/population.py b/matsim/scenario/population.py index 2fc0fa4d..55e9d052 100644 --- a/matsim/scenario/population.py +++ b/matsim/scenario/population.py @@ -17,7 +17,7 @@ def configure(context): context.stage("synthesis.vehicles.vehicles") PERSON_FIELDS = [ - "person_id", "household_income", "car_availability", "bike_availability", + "person_id", "household_income", "car_availability", "bicycle_availability", "motorbike_availability", "census_household_id", "census_person_id", "household_id", "has_license", "has_pt_subscription", "is_passenger", "hts_id", "hts_household_id", @@ -44,7 +44,8 @@ def add_person(writer, person, activities, trips, vehicles): writer.add_attribute("householdIncome", "java.lang.Double", person[PERSON_FIELDS.index("household_income")]) writer.add_attribute("carAvailability", "java.lang.String", person[PERSON_FIELDS.index("car_availability")]) - writer.add_attribute("bikeAvailability", "java.lang.String", person[PERSON_FIELDS.index("bike_availability")]) + writer.add_attribute("motorbikeAvailability", "java.lang.String", person[PERSON_FIELDS.index("motorbike_availability")]) + writer.add_attribute("bicycleAvailability", "java.lang.String", person[PERSON_FIELDS.index("bicycle_availability")]) writer.add_attribute("censusHouseholdId", "java.lang.Long", person[PERSON_FIELDS.index("census_household_id")]) writer.add_attribute("censusPersonId", "java.lang.Long", person[PERSON_FIELDS.index("census_person_id")]) diff --git a/synthesis/output.py b/synthesis/output.py index 84c52a36..21bdb006 100644 --- a/synthesis/output.py +++ b/synthesis/output.py @@ -131,8 +131,8 @@ def execute(context): "iris_id", "commune_id","departement_id","region_id"]].drop_duplicates("household_id"),how="left") df_households = df_households[[ "household_id","iris_id", "commune_id", "departement_id","region_id", - "car_availability", "bike_availability", - "number_of_vehicles", "number_of_bikes", + "car_availability", "motorbike_availability," "bicycle_availability", + "number_of_cars", "number_of_motorbikes", "number_of_bicycles", "income", "census_household_id" ]] diff --git a/synthesis/population/enriched.py b/synthesis/population/enriched.py index 15fc5649..04e97a75 100644 --- a/synthesis/population/enriched.py +++ b/synthesis/population/enriched.py @@ -27,7 +27,8 @@ def execute(context): "person_id", "household_id", "census_person_id", "census_household_id", "age", "sex", "employed", "studies", - "number_of_vehicles", "household_size", "consumption_units", + "number_of_cars", "number_of_motorbikes", + "household_size", "consumption_units", "socioprofessional_class" ]] @@ -68,22 +69,34 @@ def execute(context): assert initial_household_ids == final_household_ids # Add car availability - df_number_of_cars = df_population[["household_id", "number_of_vehicles"]].drop_duplicates("household_id") + df_number_of_cars = df_population[["household_id", "number_of_cars"]].drop_duplicates("household_id") df_number_of_licenses = df_population[["household_id", "has_license"]].groupby("household_id").sum().reset_index().rename(columns = { "has_license": "number_of_licenses" }) df_car_availability = pd.merge(df_number_of_cars, df_number_of_licenses) df_car_availability["car_availability"] = "all" - df_car_availability.loc[df_car_availability["number_of_vehicles"] < df_car_availability["number_of_licenses"], "car_availability"] = "some" - df_car_availability.loc[df_car_availability["number_of_vehicles"] == 0, "car_availability"] = "none" + df_car_availability.loc[df_car_availability["number_of_cars"] < df_car_availability["number_of_licenses"], "car_availability"] = "some" + df_car_availability.loc[df_car_availability["number_of_cars"] == 0, "car_availability"] = "none" df_car_availability["car_availability"] = df_car_availability["car_availability"].astype("category") df_population = pd.merge(df_population, df_car_availability[["household_id", "car_availability"]]) - # Add bike availability - df_population["bike_availability"] = "all" - df_population.loc[df_population["number_of_bikes"] < df_population["household_size"], "bike_availability"] = "some" - df_population.loc[df_population["number_of_bikes"] == 0, "bike_availability"] = "none" - df_population["bike_availability"] = df_population["bike_availability"].astype("category") + # Add motorbike availability + df_number_of_motorbikes = df_population[["household_id", "number_of_motorbikes"]].drop_duplicates("household_id") + df_number_of_licenses = df_population[["household_id", "has_license"]].groupby("household_id").sum().reset_index().rename(columns = { "has_license": "number_of_licenses" }) + df_motorbike_availability = pd.merge(df_number_of_motorbikes, df_number_of_licenses) + + df_motorbike_availability["motorbike_availability"] = "all" + df_motorbike_availability.loc[df_motorbike_availability["number_of_motorbikes"] < df_motorbike_availability["number_of_licenses"], "motorbike_availability"] = "some" + df_motorbike_availability.loc[df_motorbike_availability["number_of_motorbikes"] == 0, "motorbike_availability"] = "none" + df_motorbike_availability["motorbike_availability"] = df_motorbike_availability["motorbike_availability"].astype("category") + + df_population = pd.merge(df_population, df_motorbike_availability[["household_id", "motorbike_availability"]]) + + # Add bicycle availability + df_population["bicycle_availability"] = "all" + df_population.loc[df_population["number_of_bicycles"] < df_population["household_size"], "bicycle_availability"] = "some" + df_population.loc[df_population["number_of_bicycles"] == 0, "bicycle_availability"] = "none" + df_population["bicycle_availability"] = df_population["bicycle_availability"].astype("category") # Add age range for education df_population["age_range"] = "higher_education" diff --git a/synthesis/population/matched.py b/synthesis/population/matched.py index 5ab5bed0..fac9667f 100644 --- a/synthesis/population/matched.py +++ b/synthesis/population/matched.py @@ -195,8 +195,8 @@ def execute(context): df_target["income_class"] = INCOME_CLASS[hts](df_target) if "any_cars" in columns: - df_target["any_cars"] = df_target["number_of_vehicles"] > 0 - df_source["any_cars"] = df_source["number_of_vehicles"] > 0 + df_target["any_cars"] = df_target["number_of_cars"] > 0 + df_source["any_cars"] = df_source["number_of_cars"] > 0 # Perform statistical matching df_source = df_source.rename(columns = { "person_id": "hts_id" }) diff --git a/synthesis/population/spatial/secondary/locations.py b/synthesis/population/spatial/secondary/locations.py index b36fb214..7af1538e 100644 --- a/synthesis/population/spatial/secondary/locations.py +++ b/synthesis/population/spatial/secondary/locations.py @@ -85,7 +85,7 @@ def execute(context): # Resampling for calibration resample_distributions(distance_distributions, dict( - car = 0.0, car_passenger = 0.1, pt = 0.5, bike = 0.0, walk = -0.5 + car = 0.0, car_passenger = 0.1, pt = 0.5, bicycle = 0.0, motorbike = 0.0, walk = -0.5 )) # Segment into subsamples @@ -160,7 +160,7 @@ def process(context, arguments): # Set up assignment solver thresholds = dict( car = 200.0, car_passenger = 200.0, pt = 200.0, - bike = 100.0, walk = 100.0 + bicycle = 100.0, motorbike = 100.0, walk = 100.0 ) assignment_objective = DiscretizationErrorObjective(thresholds = thresholds) diff --git a/synthesis/vehicles/motorbikes/default.py b/synthesis/vehicles/motorbikes/default.py new file mode 100644 index 00000000..d0a75bd2 --- /dev/null +++ b/synthesis/vehicles/motorbikes/default.py @@ -0,0 +1,31 @@ +import re +import pandas as pd + +""" +Creates a vehicle fleet based on a default vehicle type for the dummy passenger mode +""" + +def configure(context): + context.stage("synthesis.population.enriched") + +def execute(context): + df_persons = context.stage("synthesis.population.enriched") + + df_vehicle_types = pd.DataFrame.from_records([{ + "type_id": "default_motorbike", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "motorbike", + "hbefa_cat": "PASSENGER_CAR", "hbefa_tech": "average", "hbefa_size": "average", "hbefa_emission": "average", + }]) + + df_vehicles = df_persons[["person_id"]].copy() + df_vehicles = df_vehicles.rename(columns = { "person_id": "owner_id" }) + + df_vehicles["mode"] = "motorbike" + + df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":motorbike" + df_vehicles["type_id"] = "default_motorbike" + df_vehicles["critair"] = "Crit'air 1" + df_vehicles["technology"] = "Gazole" + df_vehicles["age"] = 0 + df_vehicles["euro"] = 6 + + return df_vehicle_types, df_vehicles \ No newline at end of file diff --git a/synthesis/vehicles/vehicles.py b/synthesis/vehicles/vehicles.py index 922cd36c..4210bebd 100644 --- a/synthesis/vehicles/vehicles.py +++ b/synthesis/vehicles/vehicles.py @@ -11,12 +11,14 @@ def configure(context): raise RuntimeError("Unknown vehicles generation method : %s" % method) context.stage("synthesis.vehicles.passengers.default") + context.stage("synthesis.vehicles.motorbikes.default") def execute(context): df_car_types, df_cars = context.stage("cars") df_passenger_types, df_passengers = context.stage("synthesis.vehicles.passengers.default") + df_motorbike_types, df_motorbikes = context.stage("synthesis.vehicles.motorbikes.default") - df_vehicles = pd.concat([df_cars, df_passengers]) - df_types = pd.concat([df_car_types, df_passenger_types]) + df_vehicles = pd.concat([df_cars, df_passengers, df_motorbikes]) + df_types = pd.concat([df_car_types, df_passenger_types, df_motorbike_types]) return df_types, df_vehicles From 0a73a2740d143c73dc6ac7f5d7b1484d927282e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 1 Oct 2024 15:50:30 +0200 Subject: [PATCH 02/15] passengers --- data/census/cleaned.py | 2 +- data/hts/edgt_44/cleaned.py | 4 ++-- data/hts/edgt_lyon/cleaned_adisp.py | 4 ++-- data/hts/edgt_lyon/cleaned_cerema.py | 4 ++-- data/hts/egt/cleaned.py | 4 ++-- data/hts/entd/cleaned.py | 8 ++++---- data/hts/hts.py | 2 +- documentation/plots/secondary_locations.py | 2 +- documentation/plotting.py | 2 +- matsim/runtime/eqasim.py | 4 ++-- matsim/scenario/supply/osm.py | 13 ++++++++++++- matsim/scenario/supply/processed.py | 2 +- matsim/simulation/prepare.py | 18 +++--------------- synthesis/output.py | 2 +- synthesis/population/enriched.py | 2 +- .../population/spatial/secondary/locations.py | 4 ++-- synthesis/vehicles/passengers/default.py | 8 ++++---- tests/test_determinism.py | 18 +++++++++--------- 18 files changed, 51 insertions(+), 52 deletions(-) diff --git a/data/census/cleaned.py b/data/census/cleaned.py index 8e4548e3..dcddeee9 100644 --- a/data/census/cleaned.py +++ b/data/census/cleaned.py @@ -86,7 +86,7 @@ def execute(context): lambda x: str(x).replace("Z", "0").replace("X", "0") ).astype(int) - df["number_of_motorbikes"] += df["DEROU"].apply( + df["number_of_motorbikes"] = df["DEROU"].apply( lambda x: str(x).replace("U", "0").replace("Z", "0").replace("X", "0") ).astype(int) diff --git a/data/hts/edgt_44/cleaned.py b/data/hts/edgt_44/cleaned.py index 9665c651..f20a9662 100644 --- a/data/hts/edgt_44/cleaned.py +++ b/data/hts/edgt_44/cleaned.py @@ -20,7 +20,7 @@ def configure(context): MODES_MAP = { "car": [21, 81], - "car_passenger": [14, 16, 22, 82], + "passenger": [14, 16, 22, 82], "pt": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 72, 73, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93, 19], "motorbike": [13, 15], @@ -169,7 +169,7 @@ def execute(context): # Passenger attribute df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "car_passenger"]["person_id"].unique() + df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() ) # Calculate consumption units diff --git a/data/hts/edgt_lyon/cleaned_adisp.py b/data/hts/edgt_lyon/cleaned_adisp.py index dcc57f76..6d0c1043 100644 --- a/data/hts/edgt_lyon/cleaned_adisp.py +++ b/data/hts/edgt_lyon/cleaned_adisp.py @@ -21,7 +21,7 @@ def configure(context): MODES_MAP = { "car": [21, 81], - "car_passenger": [14, 16, 22, 82], + "passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93], "motorbike": [13, 15], @@ -182,7 +182,7 @@ def execute(context): # Passenger attribute df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "car_passenger"]["person_id"].unique() + df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() ) # Calculate consumption units diff --git a/data/hts/edgt_lyon/cleaned_cerema.py b/data/hts/edgt_lyon/cleaned_cerema.py index 87907620..14b07735 100644 --- a/data/hts/edgt_lyon/cleaned_cerema.py +++ b/data/hts/edgt_lyon/cleaned_cerema.py @@ -20,7 +20,7 @@ def configure(context): MODES_MAP = { "car": [21, 81], - "car_passenger": [14, 16, 22, 82], + "passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93], "motorbike": [13, 15], @@ -183,7 +183,7 @@ def execute(context): # Passenger attribute df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "car_passenger"]["person_id"].unique() + df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() ) # Calculate consumption units diff --git a/data/hts/egt/cleaned.py b/data/hts/egt/cleaned.py index 3b5fb0f6..f86a2d03 100644 --- a/data/hts/egt/cleaned.py +++ b/data/hts/egt/cleaned.py @@ -30,7 +30,7 @@ def configure(context): MODES_MAP = { 1 : "pt", 2 : "car", - 3 : "car_passenger", + 3 : "passenger", 4 : "motorbike", 5 : "bicycle", #6 : "pt", # default (other) @@ -174,7 +174,7 @@ def execute(context): # Passenger attribute df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "car_passenger"]["person_id"].unique() + df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() ) # Calculate consumption units diff --git a/data/hts/entd/cleaned.py b/data/hts/entd/cleaned.py index 4a9a9fc7..eec53779 100644 --- a/data/hts/entd/cleaned.py +++ b/data/hts/entd/cleaned.py @@ -29,10 +29,10 @@ def configure(context): ("1", "walk"), ("2", "car"), # ("2.20", "bicycle"), # bike - ("2.23", "car_passenger"), # motorcycle passenger - ("2.25", "car_passenger"), # same + ("2.23", "passenger"), # motorcycle passenger + ("2.25", "passenger"), # same ("3", "car"), - ("3.32", "car_passenger"), + ("3.32", "passenger"), ("4", "pt"), # taxi ("5", "pt"), ("6", "pt"), @@ -240,7 +240,7 @@ def execute(context): # Passenger attribute df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "car_passenger"]["person_id"].unique() + df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() ) # Calculate consumption units diff --git a/data/hts/hts.py b/data/hts/hts.py index d65b253b..3d561353 100644 --- a/data/hts/hts.py +++ b/data/hts/hts.py @@ -222,7 +222,7 @@ def calculate_consumption_units(df_persons): HOUSEHOLD_COLUMNS = [ "household_id", "household_weight", "household_size", - "number_of_cars", "number_of_bicycles", "number_of_bikes", "departement_id", + "number_of_cars", "number_of_bicycles", "number_of_motorbikes", "departement_id", "consumption_units", # "income_class" ] diff --git a/documentation/plots/secondary_locations.py b/documentation/plots/secondary_locations.py index 761aacaf..887e9018 100644 --- a/documentation/plots/secondary_locations.py +++ b/documentation/plots/secondary_locations.py @@ -69,7 +69,7 @@ def execute(context): plt.figure(figsize = (6.0, 2.5), dpi = 100) # 2.5 * 2.5 limits = dict( - car = 20 * 1e3, car_passenger = 20 * 1e3, pt = 20 * 1e3, + car = 20 * 1e3, passenger = 20 * 1e3, pt = 20 * 1e3, bicycle = 6 * 1e3, walk = 1 * 1e3 ) diff --git a/documentation/plotting.py b/documentation/plotting.py index b64c2542..2e8344a2 100644 --- a/documentation/plotting.py +++ b/documentation/plotting.py @@ -21,7 +21,7 @@ MODE_LABELS = dict( car = "Car driver", - car_passenger = "Car passenger", + passenger = "Passenger", pt = "Public transport", bicycle = "Bicycle", motorbike = "Motorbike", diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index 72e4846e..35a2b8fb 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -6,8 +6,8 @@ import matsim.runtime.maven as maven DEFAULT_EQASIM_VERSION = "1.5.0" -DEFAULT_EQASIM_BRANCH = "develop" -DEFAULT_EQASIM_COMMIT = "ece4932" +DEFAULT_EQASIM_BRANCH = "feat/model-2024" +DEFAULT_EQASIM_COMMIT = "757ea13" def configure(context): context.stage("matsim.runtime.git") diff --git a/matsim/scenario/supply/osm.py b/matsim/scenario/supply/osm.py index b9e79d3a..6f7b52eb 100644 --- a/matsim/scenario/supply/osm.py +++ b/matsim/scenario/supply/osm.py @@ -47,7 +47,18 @@ def execute(context): """ - + + + + """ + ) + + content = content.replace( + '', + """ + + + """ diff --git a/matsim/scenario/supply/processed.py b/matsim/scenario/supply/processed.py index f75fc130..3ba686bb 100644 --- a/matsim/scenario/supply/processed.py +++ b/matsim/scenario/supply/processed.py @@ -58,7 +58,7 @@ def execute(context): ) content = content.replace( '', - '' + '' ) with open("%s/config.xml" % context.path(), "w+") as f_write: diff --git a/matsim/simulation/prepare.py b/matsim/simulation/prepare.py index 7a73e6d8..96c8da16 100644 --- a/matsim/simulation/prepare.py +++ b/matsim/simulation/prepare.py @@ -114,25 +114,13 @@ def execute(context): df_shape.to_file("%s/departments.shp" % context.path()) eqasim.run(context, "org.eqasim.core.scenario.spatial.RunImputeSpatialAttribute", [ - "--input-population-path", "prepared_population.xml.gz", - "--output-population-path", "prepared_population.xml.gz", - "--input-network-path", "%snetwork.xml.gz" % context.config("output_prefix"), - "--output-network-path", "%snetwork.xml.gz" % context.config("output_prefix"), + "--input-schedule-path", "{}schedule.xml.gz".format(context.config("output_prefix")), + "--output-schedule-path", "{}schedule.xml.gz".format(context.config("output_prefix")), "--shape-path", "departments.shp", "--shape-attribute", "id", "--shape-value", "75", - "--attribute", "isUrban" + "--attribute", "isParis" ]) - - eqasim.run(context, "org.eqasim.core.scenario.spatial.RunAdjustCapacity", [ - "--input-path", "%snetwork.xml.gz" % context.config("output_prefix"), - "--output-path", "%snetwork.xml.gz" % context.config("output_prefix"), - "--shape-path", "departments.shp", - "--shape-attribute", "id", - "--shape-value", "75", - "--factor", str(0.8) - ]) - # Optionally, perform mode choice if context.config("mode_choice"): diff --git a/synthesis/output.py b/synthesis/output.py index 21bdb006..14330538 100644 --- a/synthesis/output.py +++ b/synthesis/output.py @@ -131,7 +131,7 @@ def execute(context): "iris_id", "commune_id","departement_id","region_id"]].drop_duplicates("household_id"),how="left") df_households = df_households[[ "household_id","iris_id", "commune_id", "departement_id","region_id", - "car_availability", "motorbike_availability," "bicycle_availability", + "car_availability", "motorbike_availability", "bicycle_availability", "number_of_cars", "number_of_motorbikes", "number_of_bicycles", "income", "census_household_id" diff --git a/synthesis/population/enriched.py b/synthesis/population/enriched.py index 04e97a75..14de3373 100644 --- a/synthesis/population/enriched.py +++ b/synthesis/population/enriched.py @@ -50,7 +50,7 @@ def execute(context): ]], on = "hts_id") df_population = pd.merge(df_population, df_hts_households[[ - "hts_household_id", "number_of_bikes" + "hts_household_id", "number_of_bicycles" ]], on = "hts_household_id") # Attach income diff --git a/synthesis/population/spatial/secondary/locations.py b/synthesis/population/spatial/secondary/locations.py index 7af1538e..4a7eb654 100644 --- a/synthesis/population/spatial/secondary/locations.py +++ b/synthesis/population/spatial/secondary/locations.py @@ -85,7 +85,7 @@ def execute(context): # Resampling for calibration resample_distributions(distance_distributions, dict( - car = 0.0, car_passenger = 0.1, pt = 0.5, bicycle = 0.0, motorbike = 0.0, walk = -0.5 + car = 0.0, passenger = 0.1, pt = 0.5, bicycle = 0.0, motorbike = 0.0, walk = -0.5 )) # Segment into subsamples @@ -159,7 +159,7 @@ def process(context, arguments): # Set up assignment solver thresholds = dict( - car = 200.0, car_passenger = 200.0, pt = 200.0, + car = 200.0, passenger = 200.0, pt = 200.0, bicycle = 100.0, motorbike = 100.0, walk = 100.0 ) diff --git a/synthesis/vehicles/passengers/default.py b/synthesis/vehicles/passengers/default.py index 6916f5bb..edaca552 100644 --- a/synthesis/vehicles/passengers/default.py +++ b/synthesis/vehicles/passengers/default.py @@ -12,17 +12,17 @@ def execute(context): df_persons = context.stage("synthesis.population.enriched") df_vehicle_types = pd.DataFrame.from_records([{ - "type_id": "default_car_passenger", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "car_passenger", + "type_id": "default_passenger", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "passenger", "hbefa_cat": "PASSENGER_CAR", "hbefa_tech": "average", "hbefa_size": "average", "hbefa_emission": "average", }]) df_vehicles = df_persons[["person_id"]].copy() df_vehicles = df_vehicles.rename(columns = { "person_id": "owner_id" }) - df_vehicles["mode"] = "car_passenger" + df_vehicles["mode"] = "passenger" - df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":car_passenger" - df_vehicles["type_id"] = "default_car_passenger" + df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":passenger" + df_vehicles["type_id"] = "default_passenger" df_vehicles["critair"] = "Crit'air 1" df_vehicles["technology"] = "Gazole" df_vehicles["age"] = 0 diff --git a/tests/test_determinism.py b/tests/test_determinism.py index e2755d7a..7277b8c2 100644 --- a/tests/test_determinism.py +++ b/tests/test_determinism.py @@ -68,19 +68,19 @@ def _test_determinism(index, data_path, tmpdir): synpp.run(stages, config, working_directory = cache_path) REFERENCE_CSV_HASHES = { - "ile_de_france_activities.csv": "53c44fb4026d2037729ee8ff1c8fb93f", - "ile_de_france_households.csv": "ca2a29ef13467326f937638f1ff8be1a", - "ile_de_france_persons.csv": "ddbe9b418c915b14e888b54efbdf9b1e", - "ile_de_france_trips.csv": "6c5f3427e41e683da768eeb53796a806", - "ile_de_france_vehicle_types.csv": "00bee1ea6d7bc9af43ae6c7101dd75da", - "ile_de_france_vehicles.csv": "3567b0f29e51d521b13d91c82c77cecb", + "ile_de_france_activities.csv": "fe44feaebf09a393a37cb7863d255623", + "ile_de_france_households.csv": "cbe8eeef0cde4787a1195849e6f31dbf", + "ile_de_france_persons.csv": "5ed3581460cfbb370c27f9aabaaa5c5e", + "ile_de_france_trips.csv": "036bdccff43e8fd0026e64b3826423f9", + "ile_de_france_vehicle_types.csv": "7ac638273f0c7bb108b5185393e9da2b", + "ile_de_france_vehicles.csv": "1af584c04278120d5821b6a889e8d378", } REFERENCE_GPKG_HASHES = { - "ile_de_france_activities.gpkg": "884eec1fd0c29904284eb4362ff89be1", - "ile_de_france_commutes.gpkg": "5a4180390a69349cc655c07c5671e8d3", + "ile_de_france_activities.gpkg": "c59d7bc7a5ca466d36d2e8e95ad6595a", + "ile_de_france_commutes.gpkg": "2dce5a1daba64f40da297f9da492b075", "ile_de_france_homes.gpkg": "a85e973f0e2f51031cd60170d351845e", - "ile_de_france_trips.gpkg": "d0aec4033cfc184bf1b91ae13a537ef8", + "ile_de_france_trips.gpkg": "606e2dfdede14715768e3b4458ff8930", } generated_csv_hashes = { From 14a3ada3e7a0d80843ee94b5ba5150aa6a1e6048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 1 Oct 2024 16:10:43 +0200 Subject: [PATCH 03/15] update model --- tests/test_determinism.py | 10 +++++----- tests/test_pipeline.py | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/test_determinism.py b/tests/test_determinism.py index 7277b8c2..593f64c7 100644 --- a/tests/test_determinism.py +++ b/tests/test_determinism.py @@ -72,8 +72,8 @@ def _test_determinism(index, data_path, tmpdir): "ile_de_france_households.csv": "cbe8eeef0cde4787a1195849e6f31dbf", "ile_de_france_persons.csv": "5ed3581460cfbb370c27f9aabaaa5c5e", "ile_de_france_trips.csv": "036bdccff43e8fd0026e64b3826423f9", - "ile_de_france_vehicle_types.csv": "7ac638273f0c7bb108b5185393e9da2b", - "ile_de_france_vehicles.csv": "1af584c04278120d5821b6a889e8d378", + "ile_de_france_vehicle_types.csv": "3023be875e29c70814e2bdcbf1d9298d", + "ile_de_france_vehicles.csv": "e1fad37d31ef7625c07de338a054827a", } REFERENCE_GPKG_HASHES = { @@ -133,10 +133,10 @@ def _test_determinism_matsim(index, data_path, tmpdir): REFERENCE_HASHES = { #"ile_de_france_population.xml.gz": "e1407f918cb92166ebf46ad769d8d085", #"ile_de_france_network.xml.gz": "5f10ec295b49d2bb768451c812955794", - "ile_de_france_households.xml.gz": "64a0c9fab72aad51bc6adb926a1c9d44", + "ile_de_france_households.xml.gz": "332a0c5891d0844d71f611887c58900a", #"ile_de_france_facilities.xml.gz": "5ad41afff9ae5c470082510b943e6778", - "ile_de_france_config.xml": "30871dfbbd2b5bf6922be1dfe20ffe73", - "ile_de_france_vehicles.xml.gz": "d7c8d0dba531a21dc83355b2f82778c2" + "ile_de_france_config.xml": "8a10c065eb7a674ac6018e62e86237a5", + "ile_de_france_vehicles.xml.gz": "5779b05f0703e0ad91852902fbaad502" } # activities.gpkg, trips.gpkg, meta.json, diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index d9856f52..812263dd 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -67,11 +67,11 @@ def run_population(tmpdir, hts, update = {}): assert 447 == len(pd.read_csv("%s/ile_de_france_persons.csv" % output_path, usecols = ["household_id"], sep = ";")) assert 149 == len(pd.read_csv("%s/ile_de_france_households.csv" % output_path, usecols = ["household_id"], sep = ";")) - assert 447 * 2 == len(pd.read_csv("%s/ile_de_france_vehicles.csv" % output_path, usecols = ["vehicle_id"], sep = ";")) + assert 447 * 3 == len(pd.read_csv("%s/ile_de_france_vehicles.csv" % output_path, usecols = ["vehicle_id"], sep = ";")) if "vehicles_method" in update and update["vehicles_method"] == "fleet_sample": - assert 17 + 1 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) + assert 17 + 2 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) else: - assert 2 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) + assert 3 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) def test_population_with_entd(tmpdir): run_population(tmpdir, "entd") From d1eb8bcc13233ec595907e07221c8fc60d11cb1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 1 Oct 2024 17:11:03 +0200 Subject: [PATCH 04/15] forgot to save two changes --- analysis/reference/hts/mode_distances.py | 2 +- analysis/synthesis/mode_distances.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/analysis/reference/hts/mode_distances.py b/analysis/reference/hts/mode_distances.py index 733d64b8..f2083958 100644 --- a/analysis/reference/hts/mode_distances.py +++ b/analysis/reference/hts/mode_distances.py @@ -20,7 +20,7 @@ def execute(context): data = dict() - for mode in ["car", "car_passenger", "pt", "bicycle", "motorbike", "walk"]: + for mode in ["car", "passenger", "pt", "bicycle", "motorbike", "walk"]: f = df["mode"] == mode if np.count_nonzero(f) > 0: diff --git a/analysis/synthesis/mode_distances.py b/analysis/synthesis/mode_distances.py index 96a87923..800fda4c 100644 --- a/analysis/synthesis/mode_distances.py +++ b/analysis/synthesis/mode_distances.py @@ -15,7 +15,7 @@ def execute(context): acquisition_sample_size = context.config("acquisition_sample_size") probabilities = np.linspace(0.0, 1.0, 20) - modes = ["car", "car_passenger", "pt", "bicycle", "motorbike", "walk"] + modes = ["car", "passenger", "pt", "bicycle", "motorbike", "walk"] quantiles = { mode : [] for mode in modes } From 492221eac49db29bdfa96981f10903f3b51fd289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Wed, 2 Oct 2024 09:02:54 +0200 Subject: [PATCH 05/15] fix paris attribute integration --- matsim/simulation/prepare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matsim/simulation/prepare.py b/matsim/simulation/prepare.py index 96c8da16..7f8bd835 100644 --- a/matsim/simulation/prepare.py +++ b/matsim/simulation/prepare.py @@ -114,8 +114,8 @@ def execute(context): df_shape.to_file("%s/departments.shp" % context.path()) eqasim.run(context, "org.eqasim.core.scenario.spatial.RunImputeSpatialAttribute", [ - "--input-schedule-path", "{}schedule.xml.gz".format(context.config("output_prefix")), - "--output-schedule-path", "{}schedule.xml.gz".format(context.config("output_prefix")), + "--input-schedule-path", "{}transit_schedule.xml.gz".format(context.config("output_prefix")), + "--output-schedule-path", "{}transit_schedule.xml.gz".format(context.config("output_prefix")), "--shape-path", "departments.shp", "--shape-attribute", "id", "--shape-value", "75", From c96419b4b7d9244834becaab28d87537b18b1138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Thu, 3 Oct 2024 15:00:01 +0200 Subject: [PATCH 06/15] remove is_passenger attribute --- data/hts/edgt_44/cleaned.py | 5 ----- data/hts/edgt_lyon/cleaned_adisp.py | 5 ----- data/hts/edgt_lyon/cleaned_cerema.py | 5 ----- data/hts/egt/cleaned.py | 5 ----- data/hts/entd/cleaned.py | 5 ----- matsim/scenario/population.py | 4 +--- synthesis/population/enriched.py | 2 +- 7 files changed, 2 insertions(+), 29 deletions(-) diff --git a/data/hts/edgt_44/cleaned.py b/data/hts/edgt_44/cleaned.py index f20a9662..36c7725c 100644 --- a/data/hts/edgt_44/cleaned.py +++ b/data/hts/edgt_44/cleaned.py @@ -167,11 +167,6 @@ def execute(context): # Nonrespondent of travel questionary section (number_of_trips = -1) df_persons["number_of_trips"] = df_persons["number_of_trips"].fillna(-1).astype(int) - # Passenger attribute - df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() - ) - # Calculate consumption units hts.check_household_size(df_households, df_persons) df_households = pd.merge(df_households, hts.calculate_consumption_units(df_persons), on = "household_id") diff --git a/data/hts/edgt_lyon/cleaned_adisp.py b/data/hts/edgt_lyon/cleaned_adisp.py index 6d0c1043..e99402de 100644 --- a/data/hts/edgt_lyon/cleaned_adisp.py +++ b/data/hts/edgt_lyon/cleaned_adisp.py @@ -180,11 +180,6 @@ def execute(context): # Nonrespondent of travel questionary section (number_of_trips = -1) df_persons["number_of_trips"] = df_persons["number_of_trips"].fillna(-1).astype(int) - # Passenger attribute - df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() - ) - # Calculate consumption units hts.check_household_size(df_households, df_persons) df_households = pd.merge(df_households, hts.calculate_consumption_units(df_persons), on = "household_id") diff --git a/data/hts/edgt_lyon/cleaned_cerema.py b/data/hts/edgt_lyon/cleaned_cerema.py index 14b07735..f5df8cd8 100644 --- a/data/hts/edgt_lyon/cleaned_cerema.py +++ b/data/hts/edgt_lyon/cleaned_cerema.py @@ -181,11 +181,6 @@ def execute(context): # Nonrespondent of travel questionary section (number_of_trips = -1) df_persons["number_of_trips"] = df_persons["number_of_trips"].fillna(-1).astype(int) - # Passenger attribute - df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() - ) - # Calculate consumption units hts.check_household_size(df_households, df_persons) df_households = pd.merge(df_households, hts.calculate_consumption_units(df_persons), on = "household_id") diff --git a/data/hts/egt/cleaned.py b/data/hts/egt/cleaned.py index f86a2d03..4a1b1376 100644 --- a/data/hts/egt/cleaned.py +++ b/data/hts/egt/cleaned.py @@ -172,11 +172,6 @@ def execute(context): # Chain length df_persons["number_of_trips"] = df_persons["NBDEPL"].fillna(0).astype(int) - # Passenger attribute - df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() - ) - # Calculate consumption units hts.check_household_size(df_households, df_persons) df_households = pd.merge(df_households, hts.calculate_consumption_units(df_persons), on = "household_id") diff --git a/data/hts/entd/cleaned.py b/data/hts/entd/cleaned.py index eec53779..4fc68801 100644 --- a/data/hts/entd/cleaned.py +++ b/data/hts/entd/cleaned.py @@ -238,11 +238,6 @@ def execute(context): df_persons["number_of_trips"] = df_persons["number_of_trips"].fillna(-1).astype(int) df_persons.loc[(df_persons["number_of_trips"] == -1) & df_persons["is_kish"], "number_of_trips"] = 0 - # Passenger attribute - df_persons["is_passenger"] = df_persons["person_id"].isin( - df_trips[df_trips["mode"] == "passenger"]["person_id"].unique() - ) - # Calculate consumption units hts.check_household_size(df_households, df_persons) df_households = pd.merge(df_households, hts.calculate_consumption_units(df_persons), on = "household_id") diff --git a/matsim/scenario/population.py b/matsim/scenario/population.py index 55e9d052..b3ff5a31 100644 --- a/matsim/scenario/population.py +++ b/matsim/scenario/population.py @@ -19,7 +19,7 @@ def configure(context): PERSON_FIELDS = [ "person_id", "household_income", "car_availability", "bicycle_availability", "motorbike_availability", "census_household_id", "census_person_id", "household_id", - "has_license", "has_pt_subscription", "is_passenger", + "has_license", "has_pt_subscription", "hts_id", "hts_household_id", "age", "employed", "sex" ] @@ -56,8 +56,6 @@ def add_person(writer, person, activities, trips, vehicles): writer.add_attribute("hasPtSubscription", "java.lang.Boolean", person[PERSON_FIELDS.index("has_pt_subscription")]) writer.add_attribute("hasLicense", "java.lang.String", writer.yes_no(person[PERSON_FIELDS.index("has_license")])) - writer.add_attribute("isPassenger", "java.lang.Boolean", person[PERSON_FIELDS.index("is_passenger")]) - writer.add_attribute("age", "java.lang.Integer", person[PERSON_FIELDS.index("age")]) writer.add_attribute("employed", "java.lang.String", person[PERSON_FIELDS.index("employed")]) writer.add_attribute("sex", "java.lang.String", person[PERSON_FIELDS.index("sex")][0]) diff --git a/synthesis/population/enriched.py b/synthesis/population/enriched.py index 14de3373..adb9038c 100644 --- a/synthesis/population/enriched.py +++ b/synthesis/population/enriched.py @@ -46,7 +46,7 @@ def execute(context): df_hts_households = df_hts_households.rename(columns = { "household_id": "hts_household_id" }) df_population = pd.merge(df_population, df_hts_persons[[ - "hts_id", "hts_household_id", "has_license", "has_pt_subscription", "is_passenger" + "hts_id", "hts_household_id", "has_license", "has_pt_subscription", ]], on = "hts_id") df_population = pd.merge(df_population, df_hts_households[[ From ac41a22c9816268db6139b5f84b9548795fcf5d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Thu, 3 Oct 2024 15:01:36 +0200 Subject: [PATCH 07/15] remove is_passenger attribute --- data/hts/hts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/hts/hts.py b/data/hts/hts.py index 3d561353..076d309a 100644 --- a/data/hts/hts.py +++ b/data/hts/hts.py @@ -231,7 +231,7 @@ def calculate_consumption_units(df_persons): "age", "sex", "employed", "studies", "has_license", "has_pt_subscription", "number_of_trips", "departement_id", "trip_weight", - "is_passenger", "socioprofessional_class" + "socioprofessional_class" ] TRIP_COLUMNS = [ From dd6313fa129495e4952e7185bf05ba2dc7ea4ae3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Thu, 3 Oct 2024 18:44:33 +0200 Subject: [PATCH 08/15] revert motorbikes --- analysis/marginals.py | 6 ---- analysis/reference/hts/mode_distances.py | 2 +- analysis/synthesis/mode_distances.py | 2 +- data/census/cleaned.py | 6 ++-- data/hts/edgt_44/cleaned.py | 8 ++--- data/hts/edgt_lyon/cleaned_adisp.py | 8 ++--- data/hts/edgt_lyon/cleaned_cerema.py | 8 ++--- data/hts/egt/cleaned.py | 6 ++-- data/hts/entd/cleaned.py | 13 +++----- data/hts/hts.py | 2 +- data/od/cleaned.py | 2 +- documentation/plots/secondary_locations.py | 2 +- .../plots/sociodemographics/general.py | 3 -- documentation/plotting.py | 3 +- matsim/runtime/eqasim.py | 2 +- matsim/scenario/households.py | 3 +- matsim/scenario/population.py | 3 +- matsim/scenario/supply/osm.py | 13 +------- matsim/scenario/supply/processed.py | 2 +- synthesis/output.py | 4 +-- synthesis/population/enriched.py | 14 +-------- .../population/spatial/secondary/locations.py | 6 ++-- synthesis/vehicles/motorbikes/default.py | 31 ------------------- synthesis/vehicles/passengers/default.py | 8 ++--- synthesis/vehicles/vehicles.py | 6 ++-- tests/test_determinism.py | 24 +++++++------- tests/test_pipeline.py | 6 ++-- 27 files changed, 61 insertions(+), 132 deletions(-) delete mode 100644 synthesis/vehicles/motorbikes/default.py diff --git a/analysis/marginals.py b/analysis/marginals.py index 011c9f91..72bfa9e7 100644 --- a/analysis/marginals.py +++ b/analysis/marginals.py @@ -14,9 +14,6 @@ NUMBER_OF_BICYCLES_BOUNDS = [0, 1, 2, np.inf] NUMBER_OF_BICYCLES_LABELS = ["0", "1", "2", "3+"] -NUMBER_OF_MOTORBIKES_BOUNDS = [0, 1, 2, np.inf] -NUMBER_OF_MOTORBIKES_LABELS = ["0", "1", "2", "3+"] - GENERAL_PERSON_MARGINALS = [("age_class",), ("sex",), ("employed",), ("studies",)] GENERAL_HOUSEHOLD_MARGINALS = [("household_size_class",), ("number_of_cars_class",)] @@ -43,9 +40,6 @@ def prepare_classes(df): if "number_of_bicycles" in df: df["number_of_bicycles_class"] = np.digitize(df["number_of_bicycles"], NUMBER_OF_BICYCLES_BOUNDS, right = True) - if "number_of_motorbikes" in df: - df["number_of_motorbikes_class"] = np.digitize(df["number_of_motorbikes"], NUMBER_OF_MOTORBIKES_BOUNDS, right = True) - def cross(*marginals): result = [] diff --git a/analysis/reference/hts/mode_distances.py b/analysis/reference/hts/mode_distances.py index f2083958..06f21fa0 100644 --- a/analysis/reference/hts/mode_distances.py +++ b/analysis/reference/hts/mode_distances.py @@ -20,7 +20,7 @@ def execute(context): data = dict() - for mode in ["car", "passenger", "pt", "bicycle", "motorbike", "walk"]: + for mode in ["car", "car_passenger", "pt", "bicycle", "walk"]: f = df["mode"] == mode if np.count_nonzero(f) > 0: diff --git a/analysis/synthesis/mode_distances.py b/analysis/synthesis/mode_distances.py index 800fda4c..fc673ae7 100644 --- a/analysis/synthesis/mode_distances.py +++ b/analysis/synthesis/mode_distances.py @@ -15,7 +15,7 @@ def execute(context): acquisition_sample_size = context.config("acquisition_sample_size") probabilities = np.linspace(0.0, 1.0, 20) - modes = ["car", "passenger", "pt", "bicycle", "motorbike", "walk"] + modes = ["car", "car_passenger", "pt", "bicycle", "walk"] quantiles = { mode : [] for mode in modes } diff --git a/data/census/cleaned.py b/data/census/cleaned.py index dcddeee9..60914413 100644 --- a/data/census/cleaned.py +++ b/data/census/cleaned.py @@ -61,7 +61,7 @@ def execute(context): df.loc[df["TRANS"] == "1", "commute_mode"] = np.nan df.loc[df["TRANS"] == "2", "commute_mode"] = "walk" df.loc[df["TRANS"] == "3", "commute_mode"] = "bicycle" - df.loc[df["TRANS"] == "4", "commute_mode"] = "motorbike" + df.loc[df["TRANS"] == "4", "commute_mode"] = "car" df.loc[df["TRANS"] == "5", "commute_mode"] = "car" df.loc[df["TRANS"] == "6", "commute_mode"] = "pt" df.loc[df["TRANS"] == "Z", "commute_mode"] = np.nan @@ -86,7 +86,7 @@ def execute(context): lambda x: str(x).replace("Z", "0").replace("X", "0") ).astype(int) - df["number_of_motorbikes"] = df["DEROU"].apply( + df["number_of_cars"] += df["DEROU"].apply( lambda x: str(x).replace("U", "0").replace("Z", "0").replace("X", "0") ).astype(int) @@ -105,7 +105,7 @@ def execute(context): "iris_id", "commune_id", "departement_id", "age", "sex", "couple", "commute_mode", "employed", - "studies", "number_of_cars", "number_of_motorbikes", "household_size", + "studies", "number_of_cars", "household_size", "consumption_units", "socioprofessional_class" ]] diff --git a/data/hts/edgt_44/cleaned.py b/data/hts/edgt_44/cleaned.py index 36c7725c..8f702b4f 100644 --- a/data/hts/edgt_44/cleaned.py +++ b/data/hts/edgt_44/cleaned.py @@ -19,11 +19,11 @@ def configure(context): } MODES_MAP = { - "car": [21, 81], - "passenger": [14, 16, 22, 82], + "car": [13, 15, 21, 81], + "car_passenger": [14, 16, 22, 82], "pt": [30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 72, 73, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93, 19], - "motorbike": [13, 15], + # "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -92,7 +92,7 @@ def execute(context): # Number of vehicles df_households["number_of_cars"] = df_households["M6"].astype(int) - df_households["number_of_motorbikes"] = df_households["M5"].astype(int) + df_households["number_of_cars"] += df_households["M5"].astype(int) # motorbikes df_households["number_of_bicycles"] = df_households["M7"].astype(int) # License diff --git a/data/hts/edgt_lyon/cleaned_adisp.py b/data/hts/edgt_lyon/cleaned_adisp.py index e99402de..8f17e259 100644 --- a/data/hts/edgt_lyon/cleaned_adisp.py +++ b/data/hts/edgt_lyon/cleaned_adisp.py @@ -20,11 +20,11 @@ def configure(context): } MODES_MAP = { - "car": [21, 81], - "passenger": [14, 16, 22, 82], + "car": [13, 15, 21, 81], + "car_passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93], - "motorbike": [13, 15], + # "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -108,8 +108,8 @@ def execute(context): # Number of vehicles df_households["number_of_cars"] = df_households["M6"].astype(int) + df_households["number_of_cars"] += df_households["M14"].astype(int) # motorbikes df_households["number_of_bicycles"] = df_households["M21"].astype(int) - df_households["number_of_motorbikes"] = df_households["M14"].astype(int) # License df_persons["has_license"] = df_persons["P7"] == "1" diff --git a/data/hts/edgt_lyon/cleaned_cerema.py b/data/hts/edgt_lyon/cleaned_cerema.py index f5df8cd8..385fa3ee 100644 --- a/data/hts/edgt_lyon/cleaned_cerema.py +++ b/data/hts/edgt_lyon/cleaned_cerema.py @@ -19,11 +19,11 @@ def configure(context): } MODES_MAP = { - "car": [21, 81], - "passenger": [14, 16, 22, 82], + "car": [13, 15, 21, 81], + "car_passenger": [14, 16, 22, 82], "pt": [31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 51, 52, 53, 61, 71, 91, 92, 94, 95], "bicycle": [11, 17, 12, 18, 93], - "motorbike": [13, 15], + # "motorbike": [13, 15], "walk": [1, 2] # Actually, 2 is not really explained, but we assume it is walk } @@ -107,8 +107,8 @@ def execute(context): # Number of vehicles df_households["number_of_cars"] = df_households["M6"].astype(int) + df_households["number_of_cars"] += df_households["M5"].astype(int) # motorbikes df_households["number_of_bicycles"] = df_households["M7"].astype(int) - df_households["number_of_motorbikes"] = df_households["M5"].astype(int) # License df_persons["has_license"] = df_persons["P5"] == "1" diff --git a/data/hts/egt/cleaned.py b/data/hts/egt/cleaned.py index 4a1b1376..cc7b706a 100644 --- a/data/hts/egt/cleaned.py +++ b/data/hts/egt/cleaned.py @@ -30,8 +30,8 @@ def configure(context): MODES_MAP = { 1 : "pt", 2 : "car", - 3 : "passenger", - 4 : "motorbike", + 3 : "car_passenger", + 4 : "car", # motorbike 5 : "bicycle", #6 : "pt", # default (other) 7 : "walk" @@ -100,8 +100,8 @@ def execute(context): # Number of vehicles df_households["number_of_cars"] = df_households["NB_VD"].astype(int) + df_households["number_of_cars"] += df_households["NB_2RM"].astype(int) # motorbikes df_households["number_of_bicycles"] = df_households["NB_VELO"].astype(int) - df_households["number_of_motorbikes"] = df_households["NB_2RM"].astype(int) # License df_persons["has_license"] = (df_persons["PERMVP"] == 1) | (df_persons["PERM2RM"] == 1) diff --git a/data/hts/entd/cleaned.py b/data/hts/entd/cleaned.py index 4fc68801..6f679105 100644 --- a/data/hts/entd/cleaned.py +++ b/data/hts/entd/cleaned.py @@ -29,10 +29,10 @@ def configure(context): ("1", "walk"), ("2", "car"), # ("2.20", "bicycle"), # bike - ("2.23", "passenger"), # motorcycle passenger - ("2.25", "passenger"), # same + ("2.23", "car_passenger"), # motorcycle passenger + ("2.25", "car_passenger"), # same ("3", "car"), - ("3.32", "passenger"), + ("3.32", "car_passenger"), ("4", "pt"), # taxi ("5", "pt"), ("6", "pt"), @@ -136,13 +136,10 @@ def execute(context): # Number of vehicles df_households["number_of_cars"] = df_households["V1_JNBVEH"].fillna(0) + df_households["number_of_cars"] += df_households["V1_JNBMOTO"].fillna(0) # motorbike + df_households["number_of_cars"] += df_households["V1_JNBCYCLO"].fillna(0) # motorbike df_households["number_of_cars"] = df_households["number_of_cars"].astype(int) - df_households["number_of_motorbikes"] = 0 - df_households["number_of_motorbikes"] += df_households["V1_JNBMOTO"].fillna(0) - df_households["number_of_motorbikes"] += df_households["V1_JNBCYCLO"].fillna(0) - df_households["number_of_motorbikes"] = df_households["number_of_motorbikes"].astype(int) - df_households["number_of_bicycles"] = df_households["V1_JNBVELOADT"].fillna(0).astype(int) # License diff --git a/data/hts/hts.py b/data/hts/hts.py index 076d309a..ca85beec 100644 --- a/data/hts/hts.py +++ b/data/hts/hts.py @@ -222,7 +222,7 @@ def calculate_consumption_units(df_persons): HOUSEHOLD_COLUMNS = [ "household_id", "household_weight", "household_size", - "number_of_cars", "number_of_bicycles", "number_of_motorbikes", "departement_id", + "number_of_cars", "number_of_bicycles", "departement_id", "consumption_units", # "income_class" ] diff --git a/data/od/cleaned.py b/data/od/cleaned.py index dc619be0..0765adfb 100644 --- a/data/od/cleaned.py +++ b/data/od/cleaned.py @@ -51,7 +51,7 @@ def execute(context): df_work.loc[df_work["TRANS"] == 1, "commute_mode"] = "no transport" df_work.loc[df_work["TRANS"] == 2, "commute_mode"] = "walk" df_work.loc[df_work["TRANS"] == 3, "commute_mode"] = "bicycle" - df_work.loc[df_work["TRANS"] == 4, "commute_mode"] = "motorbike" + df_work.loc[df_work["TRANS"] == 4, "commute_mode"] = "car" # motorbike df_work.loc[df_work["TRANS"] == 5, "commute_mode"] = "car" df_work.loc[df_work["TRANS"] == 6, "commute_mode"] = "pt" df_work["commute_mode"] = df_work["commute_mode"].astype("category") diff --git a/documentation/plots/secondary_locations.py b/documentation/plots/secondary_locations.py index 887e9018..761aacaf 100644 --- a/documentation/plots/secondary_locations.py +++ b/documentation/plots/secondary_locations.py @@ -69,7 +69,7 @@ def execute(context): plt.figure(figsize = (6.0, 2.5), dpi = 100) # 2.5 * 2.5 limits = dict( - car = 20 * 1e3, passenger = 20 * 1e3, pt = 20 * 1e3, + car = 20 * 1e3, car_passenger = 20 * 1e3, pt = 20 * 1e3, bicycle = 6 * 1e3, walk = 1 * 1e3 ) diff --git a/documentation/plots/sociodemographics/general.py b/documentation/plots/sociodemographics/general.py index 90e84e5f..81a055e6 100644 --- a/documentation/plots/sociodemographics/general.py +++ b/documentation/plots/sociodemographics/general.py @@ -85,9 +85,6 @@ def label(row): elif row["attribute"] == "number_of_bicycles_class": return "No. bicycles %s" % analysis.marginals.NUMBER_OF_BICYCLES_LABELS[row["value"]] - elif row["attribute"] == "number_of_motorbikes_class": - return "No. motorbikes %s" % analysis.marginals.NUMBER_OF_MOTORBIKES_LABELS[row["value"]] - def add_labels(df_figure): df_figure["label"] = df_figure.apply(label, axis = 1, raw = False) diff --git a/documentation/plotting.py b/documentation/plotting.py index 2e8344a2..23dd10c2 100644 --- a/documentation/plotting.py +++ b/documentation/plotting.py @@ -21,10 +21,9 @@ MODE_LABELS = dict( car = "Car driver", - passenger = "Passenger", + car_passenger = "Car passenger", pt = "Public transport", bicycle = "Bicycle", - motorbike = "Motorbike", walk = "Walking" ) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index 35a2b8fb..efaf6a3e 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "757ea13" +DEFAULT_EQASIM_COMMIT = "7c895345" def configure(context): context.stage("matsim.runtime.git") diff --git a/matsim/scenario/households.py b/matsim/scenario/households.py index 25bba8e4..027923ba 100644 --- a/matsim/scenario/households.py +++ b/matsim/scenario/households.py @@ -8,7 +8,7 @@ def configure(context): context.stage("synthesis.population.enriched") -FIELDS = ["household_id", "person_id", "household_income", "car_availability", "motorbike_availability", "bicycle_availability", "census_household_id"] +FIELDS = ["household_id", "person_id", "household_income", "car_availability", "bicycle_availability", "census_household_id"] def add_household(writer, household, member_ids): writer.start_household(household[FIELDS.index("household_id")]) @@ -16,7 +16,6 @@ def add_household(writer, household, member_ids): writer.start_attributes() writer.add_attribute("carAvailability", "java.lang.String", household[FIELDS.index("car_availability")]) - writer.add_attribute("motorbikeAvailability", "java.lang.String", household[FIELDS.index("motorbike_availability")]) writer.add_attribute("bicycleAvailability", "java.lang.String", household[FIELDS.index("bicycle_availability")]) writer.add_attribute("household_income", "java.lang.Double", household[FIELDS.index("household_income")]) writer.add_attribute("censusId", "java.lang.Long", household[FIELDS.index("census_household_id")]) diff --git a/matsim/scenario/population.py b/matsim/scenario/population.py index b3ff5a31..ab51013c 100644 --- a/matsim/scenario/population.py +++ b/matsim/scenario/population.py @@ -17,7 +17,7 @@ def configure(context): context.stage("synthesis.vehicles.vehicles") PERSON_FIELDS = [ - "person_id", "household_income", "car_availability", "bicycle_availability", "motorbike_availability", + "person_id", "household_income", "car_availability", "bicycle_availability", "census_household_id", "census_person_id", "household_id", "has_license", "has_pt_subscription", "hts_id", "hts_household_id", @@ -44,7 +44,6 @@ def add_person(writer, person, activities, trips, vehicles): writer.add_attribute("householdIncome", "java.lang.Double", person[PERSON_FIELDS.index("household_income")]) writer.add_attribute("carAvailability", "java.lang.String", person[PERSON_FIELDS.index("car_availability")]) - writer.add_attribute("motorbikeAvailability", "java.lang.String", person[PERSON_FIELDS.index("motorbike_availability")]) writer.add_attribute("bicycleAvailability", "java.lang.String", person[PERSON_FIELDS.index("bicycle_availability")]) writer.add_attribute("censusHouseholdId", "java.lang.Long", person[PERSON_FIELDS.index("census_household_id")]) diff --git a/matsim/scenario/supply/osm.py b/matsim/scenario/supply/osm.py index 6f7b52eb..b9e79d3a 100644 --- a/matsim/scenario/supply/osm.py +++ b/matsim/scenario/supply/osm.py @@ -47,18 +47,7 @@ def execute(context): """ - - - - """ - ) - - content = content.replace( - '', - """ - - - + """ diff --git a/matsim/scenario/supply/processed.py b/matsim/scenario/supply/processed.py index 3ba686bb..f75fc130 100644 --- a/matsim/scenario/supply/processed.py +++ b/matsim/scenario/supply/processed.py @@ -58,7 +58,7 @@ def execute(context): ) content = content.replace( '', - '' + '' ) with open("%s/config.xml" % context.path(), "w+") as f_write: diff --git a/synthesis/output.py b/synthesis/output.py index 14330538..f605b280 100644 --- a/synthesis/output.py +++ b/synthesis/output.py @@ -131,8 +131,8 @@ def execute(context): "iris_id", "commune_id","departement_id","region_id"]].drop_duplicates("household_id"),how="left") df_households = df_households[[ "household_id","iris_id", "commune_id", "departement_id","region_id", - "car_availability", "motorbike_availability", "bicycle_availability", - "number_of_cars", "number_of_motorbikes", "number_of_bicycles", + "car_availability", "bicycle_availability", + "number_of_cars", "number_of_bicycles", "income", "census_household_id" ]] diff --git a/synthesis/population/enriched.py b/synthesis/population/enriched.py index adb9038c..74ec99e1 100644 --- a/synthesis/population/enriched.py +++ b/synthesis/population/enriched.py @@ -27,7 +27,7 @@ def execute(context): "person_id", "household_id", "census_person_id", "census_household_id", "age", "sex", "employed", "studies", - "number_of_cars", "number_of_motorbikes", + "number_of_cars", "household_size", "consumption_units", "socioprofessional_class" ]] @@ -80,18 +80,6 @@ def execute(context): df_population = pd.merge(df_population, df_car_availability[["household_id", "car_availability"]]) - # Add motorbike availability - df_number_of_motorbikes = df_population[["household_id", "number_of_motorbikes"]].drop_duplicates("household_id") - df_number_of_licenses = df_population[["household_id", "has_license"]].groupby("household_id").sum().reset_index().rename(columns = { "has_license": "number_of_licenses" }) - df_motorbike_availability = pd.merge(df_number_of_motorbikes, df_number_of_licenses) - - df_motorbike_availability["motorbike_availability"] = "all" - df_motorbike_availability.loc[df_motorbike_availability["number_of_motorbikes"] < df_motorbike_availability["number_of_licenses"], "motorbike_availability"] = "some" - df_motorbike_availability.loc[df_motorbike_availability["number_of_motorbikes"] == 0, "motorbike_availability"] = "none" - df_motorbike_availability["motorbike_availability"] = df_motorbike_availability["motorbike_availability"].astype("category") - - df_population = pd.merge(df_population, df_motorbike_availability[["household_id", "motorbike_availability"]]) - # Add bicycle availability df_population["bicycle_availability"] = "all" df_population.loc[df_population["number_of_bicycles"] < df_population["household_size"], "bicycle_availability"] = "some" diff --git a/synthesis/population/spatial/secondary/locations.py b/synthesis/population/spatial/secondary/locations.py index 4a7eb654..8a6b96eb 100644 --- a/synthesis/population/spatial/secondary/locations.py +++ b/synthesis/population/spatial/secondary/locations.py @@ -85,7 +85,7 @@ def execute(context): # Resampling for calibration resample_distributions(distance_distributions, dict( - car = 0.0, passenger = 0.1, pt = 0.5, bicycle = 0.0, motorbike = 0.0, walk = -0.5 + car = 0.0, car_passenger = 0.1, pt = 0.5, bicycle = 0.0, walk = -0.5 )) # Segment into subsamples @@ -159,8 +159,8 @@ def process(context, arguments): # Set up assignment solver thresholds = dict( - car = 200.0, passenger = 200.0, pt = 200.0, - bicycle = 100.0, motorbike = 100.0, walk = 100.0 + car = 200.0, car_passenger = 200.0, pt = 200.0, + bicycle = 100.0, walk = 100.0 ) assignment_objective = DiscretizationErrorObjective(thresholds = thresholds) diff --git a/synthesis/vehicles/motorbikes/default.py b/synthesis/vehicles/motorbikes/default.py deleted file mode 100644 index d0a75bd2..00000000 --- a/synthesis/vehicles/motorbikes/default.py +++ /dev/null @@ -1,31 +0,0 @@ -import re -import pandas as pd - -""" -Creates a vehicle fleet based on a default vehicle type for the dummy passenger mode -""" - -def configure(context): - context.stage("synthesis.population.enriched") - -def execute(context): - df_persons = context.stage("synthesis.population.enriched") - - df_vehicle_types = pd.DataFrame.from_records([{ - "type_id": "default_motorbike", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "motorbike", - "hbefa_cat": "PASSENGER_CAR", "hbefa_tech": "average", "hbefa_size": "average", "hbefa_emission": "average", - }]) - - df_vehicles = df_persons[["person_id"]].copy() - df_vehicles = df_vehicles.rename(columns = { "person_id": "owner_id" }) - - df_vehicles["mode"] = "motorbike" - - df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":motorbike" - df_vehicles["type_id"] = "default_motorbike" - df_vehicles["critair"] = "Crit'air 1" - df_vehicles["technology"] = "Gazole" - df_vehicles["age"] = 0 - df_vehicles["euro"] = 6 - - return df_vehicle_types, df_vehicles \ No newline at end of file diff --git a/synthesis/vehicles/passengers/default.py b/synthesis/vehicles/passengers/default.py index edaca552..6916f5bb 100644 --- a/synthesis/vehicles/passengers/default.py +++ b/synthesis/vehicles/passengers/default.py @@ -12,17 +12,17 @@ def execute(context): df_persons = context.stage("synthesis.population.enriched") df_vehicle_types = pd.DataFrame.from_records([{ - "type_id": "default_passenger", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "passenger", + "type_id": "default_car_passenger", "nb_seats": 4, "length": 5.0, "width": 1.0, "pce": 1.0, "mode": "car_passenger", "hbefa_cat": "PASSENGER_CAR", "hbefa_tech": "average", "hbefa_size": "average", "hbefa_emission": "average", }]) df_vehicles = df_persons[["person_id"]].copy() df_vehicles = df_vehicles.rename(columns = { "person_id": "owner_id" }) - df_vehicles["mode"] = "passenger" + df_vehicles["mode"] = "car_passenger" - df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":passenger" - df_vehicles["type_id"] = "default_passenger" + df_vehicles["vehicle_id"] = df_vehicles["owner_id"].astype(str) + ":car_passenger" + df_vehicles["type_id"] = "default_car_passenger" df_vehicles["critair"] = "Crit'air 1" df_vehicles["technology"] = "Gazole" df_vehicles["age"] = 0 diff --git a/synthesis/vehicles/vehicles.py b/synthesis/vehicles/vehicles.py index 4210bebd..922cd36c 100644 --- a/synthesis/vehicles/vehicles.py +++ b/synthesis/vehicles/vehicles.py @@ -11,14 +11,12 @@ def configure(context): raise RuntimeError("Unknown vehicles generation method : %s" % method) context.stage("synthesis.vehicles.passengers.default") - context.stage("synthesis.vehicles.motorbikes.default") def execute(context): df_car_types, df_cars = context.stage("cars") df_passenger_types, df_passengers = context.stage("synthesis.vehicles.passengers.default") - df_motorbike_types, df_motorbikes = context.stage("synthesis.vehicles.motorbikes.default") - df_vehicles = pd.concat([df_cars, df_passengers, df_motorbikes]) - df_types = pd.concat([df_car_types, df_passenger_types, df_motorbike_types]) + df_vehicles = pd.concat([df_cars, df_passengers]) + df_types = pd.concat([df_car_types, df_passenger_types]) return df_types, df_vehicles diff --git a/tests/test_determinism.py b/tests/test_determinism.py index 593f64c7..92d80dcb 100644 --- a/tests/test_determinism.py +++ b/tests/test_determinism.py @@ -68,19 +68,19 @@ def _test_determinism(index, data_path, tmpdir): synpp.run(stages, config, working_directory = cache_path) REFERENCE_CSV_HASHES = { - "ile_de_france_activities.csv": "fe44feaebf09a393a37cb7863d255623", - "ile_de_france_households.csv": "cbe8eeef0cde4787a1195849e6f31dbf", - "ile_de_france_persons.csv": "5ed3581460cfbb370c27f9aabaaa5c5e", - "ile_de_france_trips.csv": "036bdccff43e8fd0026e64b3826423f9", - "ile_de_france_vehicle_types.csv": "3023be875e29c70814e2bdcbf1d9298d", - "ile_de_france_vehicles.csv": "e1fad37d31ef7625c07de338a054827a", + "ile_de_france_activities.csv": "53c44fb4026d2037729ee8ff1c8fb93f", + "ile_de_france_households.csv": "60c8aafadb084cc56dceed407eba4af0", + "ile_de_france_persons.csv": "ddbe9b418c915b14e888b54efbdf9b1e", + "ile_de_france_trips.csv": "6c5f3427e41e683da768eeb53796a806", + "ile_de_france_vehicle_types.csv": "00bee1ea6d7bc9af43ae6c7101dd75da", + "ile_de_france_vehicles.csv": "3567b0f29e51d521b13d91c82c77cecb", } REFERENCE_GPKG_HASHES = { - "ile_de_france_activities.gpkg": "c59d7bc7a5ca466d36d2e8e95ad6595a", - "ile_de_france_commutes.gpkg": "2dce5a1daba64f40da297f9da492b075", + "ile_de_france_activities.gpkg": "884eec1fd0c29904284eb4362ff89be1", + "ile_de_france_commutes.gpkg": "5a4180390a69349cc655c07c5671e8d3", "ile_de_france_homes.gpkg": "a85e973f0e2f51031cd60170d351845e", - "ile_de_france_trips.gpkg": "606e2dfdede14715768e3b4458ff8930", + "ile_de_france_trips.gpkg": "d0aec4033cfc184bf1b91ae13a537ef8", } generated_csv_hashes = { @@ -133,10 +133,10 @@ def _test_determinism_matsim(index, data_path, tmpdir): REFERENCE_HASHES = { #"ile_de_france_population.xml.gz": "e1407f918cb92166ebf46ad769d8d085", #"ile_de_france_network.xml.gz": "5f10ec295b49d2bb768451c812955794", - "ile_de_france_households.xml.gz": "332a0c5891d0844d71f611887c58900a", + "ile_de_france_households.xml.gz": "936dd42548b205b822099dfd9a20d075", #"ile_de_france_facilities.xml.gz": "5ad41afff9ae5c470082510b943e6778", - "ile_de_france_config.xml": "8a10c065eb7a674ac6018e62e86237a5", - "ile_de_france_vehicles.xml.gz": "5779b05f0703e0ad91852902fbaad502" + "ile_de_france_config.xml": "6c2adf49fd7c0f7b28fb1a09397ed2b0", + "ile_de_france_vehicles.xml.gz": "d7c8d0dba531a21dc83355b2f82778c2" } # activities.gpkg, trips.gpkg, meta.json, diff --git a/tests/test_pipeline.py b/tests/test_pipeline.py index 812263dd..d9856f52 100644 --- a/tests/test_pipeline.py +++ b/tests/test_pipeline.py @@ -67,11 +67,11 @@ def run_population(tmpdir, hts, update = {}): assert 447 == len(pd.read_csv("%s/ile_de_france_persons.csv" % output_path, usecols = ["household_id"], sep = ";")) assert 149 == len(pd.read_csv("%s/ile_de_france_households.csv" % output_path, usecols = ["household_id"], sep = ";")) - assert 447 * 3 == len(pd.read_csv("%s/ile_de_france_vehicles.csv" % output_path, usecols = ["vehicle_id"], sep = ";")) + assert 447 * 2 == len(pd.read_csv("%s/ile_de_france_vehicles.csv" % output_path, usecols = ["vehicle_id"], sep = ";")) if "vehicles_method" in update and update["vehicles_method"] == "fleet_sample": - assert 17 + 2 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) + assert 17 + 1 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) else: - assert 3 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) + assert 2 == len(pd.read_csv("%s/ile_de_france_vehicle_types.csv" % output_path, usecols = ["type_id"], sep = ";")) def test_population_with_entd(tmpdir): run_population(tmpdir, "entd") From c8b6738076b4055b7d6fcc8148902ad0f6eeafec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Mon, 7 Oct 2024 08:01:36 +0200 Subject: [PATCH 09/15] update commit --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index efaf6a3e..cc4aa9dc 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "7c895345" +DEFAULT_EQASIM_COMMIT = "8296a1c" def configure(context): context.stage("matsim.runtime.git") From ec3c75d5b123f0327c529400f21f0f3ddd445342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Mon, 7 Oct 2024 22:03:45 +0200 Subject: [PATCH 10/15] impute paris attribute for residents --- matsim/simulation/prepare.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matsim/simulation/prepare.py b/matsim/simulation/prepare.py index 7f8bd835..7c00b373 100644 --- a/matsim/simulation/prepare.py +++ b/matsim/simulation/prepare.py @@ -114,6 +114,8 @@ def execute(context): df_shape.to_file("%s/departments.shp" % context.path()) eqasim.run(context, "org.eqasim.core.scenario.spatial.RunImputeSpatialAttribute", [ + "--input-population-path", "prepared_population.xml.gz", + "--output-population-path", "prepared_population.xml.gz", "--input-schedule-path", "{}transit_schedule.xml.gz".format(context.config("output_prefix")), "--output-schedule-path", "{}transit_schedule.xml.gz".format(context.config("output_prefix")), "--shape-path", "departments.shp", From 54579a355ce385a0ac3c20270fe4180c0550f131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Mon, 7 Oct 2024 22:06:32 +0200 Subject: [PATCH 11/15] update hash --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index cc4aa9dc..c59a39dc 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "8296a1c" +DEFAULT_EQASIM_COMMIT = "65d1c101" def configure(context): context.stage("matsim.runtime.git") From 01576f1cec7e0c8dfd55a94b971dfb4687fdda9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 8 Oct 2024 08:10:19 +0200 Subject: [PATCH 12/15] update hash --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index c59a39dc..37b6415d 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "65d1c101" +DEFAULT_EQASIM_COMMIT = "ca57c264" def configure(context): context.stage("matsim.runtime.git") From 952f38ac258f10f014b51cad6af6956bb7e14eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Wed, 9 Oct 2024 11:37:58 +0200 Subject: [PATCH 13/15] update commit --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index 37b6415d..4c0f39a7 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "ca57c264" +DEFAULT_EQASIM_COMMIT = "c0645372" def configure(context): context.stage("matsim.runtime.git") From 42f579e6d1b8a111e9e9c3a0edb251915fe0d9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 14 Jan 2025 16:31:45 +0100 Subject: [PATCH 14/15] update hash --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index 4c0f39a7..977230ad 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "c0645372" +DEFAULT_EQASIM_COMMIT = "25d656b" def configure(context): context.stage("matsim.runtime.git") From 0010bc48833148fff34cbf6f017af575ba8d6984 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20H=C3=B6rl?= Date: Tue, 14 Jan 2025 17:25:10 +0100 Subject: [PATCH 15/15] update hash --- matsim/runtime/eqasim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matsim/runtime/eqasim.py b/matsim/runtime/eqasim.py index 977230ad..0d1ecd1b 100644 --- a/matsim/runtime/eqasim.py +++ b/matsim/runtime/eqasim.py @@ -7,7 +7,7 @@ DEFAULT_EQASIM_VERSION = "1.5.0" DEFAULT_EQASIM_BRANCH = "feat/model-2024" -DEFAULT_EQASIM_COMMIT = "25d656b" +DEFAULT_EQASIM_COMMIT = "7dae6d9" def configure(context): context.stage("matsim.runtime.git")