diff --git a/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java b/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java index a7b4a35e..0170cb49 100644 --- a/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java +++ b/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java @@ -13,40 +13,34 @@ public final class AdvancedScoringConfigGroup extends ReflectiveConfigGroup { private static final String GROUP_NAME = "advancedScoring"; - private final List scoringParameters = new ArrayList<>(); - /** - * Different options for income dependent scoring. - */ - public enum IncomeDependentScoring { - none, - avg_by_personal_income - } - @Parameter @Comment("The distance groups if marginal utility of distance is adjusted. In meters.") public List distGroups; @Parameter @Comment("Enable income dependent marginal utility of money.") - public IncomeDependentScoring incomeDependent = IncomeDependentScoring.avg_by_personal_income; - + public IncomeDependentScoring incomeDependent = IncomeDependentScoring.avgByPersonalIncome; - // TODO: maybe option to re-assign variations or use them from attributes - // TODO: could load the random variations from a file, helper function to only generate the variations + @Parameter + @Comment("Define how to load existing preferences.") + public LoadPreferences loadPreferences = LoadPreferences.none; public AdvancedScoringConfigGroup() { super(GROUP_NAME); } /** - * Return the defined scoring parameters. + * Return the defined scoring parameters. */ public List getScoringParameters() { return Collections.unmodifiableList(scoringParameters); } + // TODO: maybe option to re-assign variations or use them from attributes + // TODO: could load the random variations from a file, helper function to only generate the variations + @Override public ConfigGroup createParameterSet(String type) { if (type.equals(ScoringParameters.GROUP_NAME)) { @@ -66,6 +60,30 @@ public void addParameterSet(ConfigGroup set) { } } + /** + * Different options for income dependent scoring. + */ + public enum IncomeDependentScoring { + none, + avgByPersonalIncome + } + + /** + * Define how existing preferences are loaded. + */ + public enum LoadPreferences { + none, + requireAttribute, + skipRefPersons + } + + /** + * Variate values with random draw from specific distribution. + */ + public enum VariationType { + fixed, normal, truncatedNormal + } + /** * Scoring parameters for a specific group of agents. * This group allows arbitrary attributes to be defined, which are matched against person attributes. @@ -175,11 +193,4 @@ public ModeParams() { super(GROUP_NAME); } } - - /** - * Variate values with random draw from specific distribution. - */ - public enum VariationType { - fixed, normal, truncatedNormal - } } diff --git a/src/main/python/extract_ref_data.py b/src/main/python/extract_ref_data.py index 34a6e7f0..434a4deb 100644 --- a/src/main/python/extract_ref_data.py +++ b/src/main/python/extract_ref_data.py @@ -11,9 +11,10 @@ def person_filter(df): df = df[df.reporting_day <= 4] df = df[df.location == "Berlin"] - df["age"] = preparation.cut(df.age, [0, 18, 66, np.inf]) + df["age"] = preparation.cut(df.age, [0, 12, 18, 25, 35, 66, np.inf]) preparation.fill(df, "economic_status", EconomicStatus.UNKNOWN) + preparation.fill(df, "income", -1) return df @@ -35,7 +36,7 @@ def trip_filter(df): d + "Berlin+Umland", person_filter, trip_filter, run_create_ref_data.InvalidHandling.REMOVE_TRIPS, - ref_groups=["age", "economic_status"] + ref_groups=["age", "income", "economic_status", "employment", "car_avail", "bike_avail", "pt_abo_avail"] ) print(result.share)