diff --git a/src/main/java/org/matsim/run/OpenBerlinScenario.java b/src/main/java/org/matsim/run/OpenBerlinScenario.java index 152a73df..ee1791d6 100644 --- a/src/main/java/org/matsim/run/OpenBerlinScenario.java +++ b/src/main/java/org/matsim/run/OpenBerlinScenario.java @@ -18,6 +18,7 @@ import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ReplanningConfigGroup; +import org.matsim.core.config.groups.VspExperimentalConfigGroup; import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule; @@ -120,6 +121,11 @@ protected Config prepareConfig(Config config) { .setSubpopulation("person") ); + // Need to switch to warning for best score + if (planSelector.equals(DefaultPlanStrategiesModule.DefaultSelector.BestScore)) { + config.vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn); + } + // Bicycle config must be present ConfigUtils.addOrGetModule(config, BicycleConfigGroup.class); diff --git a/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java b/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java index a120f192..9e7fc6eb 100644 --- a/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java +++ b/src/main/java/org/matsim/run/scoring/AdvancedScoringConfigGroup.java @@ -91,11 +91,7 @@ public enum LoadPreferences { * Variate values with random draw from specific distribution. */ public enum VariationType { - fixed, normal, truncatedNormal, gumbel, - /** - * Normal with mean at 0.5772 (Euler–Mascheroni constant). Can be used as coarse approximation to gumbel. - */ - eulerGammaNormal + fixed, normal, truncatedNormal, gumbel } /** diff --git a/src/main/java/org/matsim/run/scoring/PseudoRandomScorer.java b/src/main/java/org/matsim/run/scoring/PseudoRandomScorer.java index 23635b99..2257e746 100644 --- a/src/main/java/org/matsim/run/scoring/PseudoRandomScorer.java +++ b/src/main/java/org/matsim/run/scoring/PseudoRandomScorer.java @@ -63,7 +63,6 @@ public double scoreTrip(Id personId, String mainMode, TripStructureUtils return switch (distribution) { case gumbel -> sampleGumbel(rng, 0, scale); case normal -> sampleNormal(rng, 0, scale); - case eulerGammaNormal -> sampleNormal(rng, 0.5772156649015329, scale); default -> throw new IllegalStateException("Unsupported distribution: " + distribution); }; } diff --git a/src/main/python/choicemodels/estimate_biogeme_plan_choice.py b/src/main/python/choicemodels/estimate_biogeme_plan_choice.py index 76b4593b..c685fd7d 100644 --- a/src/main/python/choicemodels/estimate_biogeme_plan_choice.py +++ b/src/main/python/choicemodels/estimate_biogeme_plan_choice.py @@ -27,7 +27,8 @@ parser.add_argument("--exp-income", help="Exponent for income", type=float, default=1) parser.add_argument("--util-money", help="Utility of money", type=float, default=1) parser.add_argument("--est-util-money", help="Estimate utility of money", action="store_true") - parser.add_argument("--est-error-component", help="Add a normal error component to each trip choice", action="store_true") + parser.add_argument("--est-error-component", help="Add a normal error component to each trip choice", action="store_true") + parser.add_argument("--ec", help="Factor for error component", type=float, default=None) parser.add_argument("--est-price-perception-car", help="Estimate price perception", action="store_true") parser.add_argument("--est-price-perception-pt", help="Estimate price perception", action="store_true") parser.add_argument("--same-price-perception", help="Only estimate one fixed price perception factor", action="store_true") @@ -123,7 +124,10 @@ for j in range(7): EC[m].append(bioDraws(f"ec_{m}_{j}", "NORMAL_ANTI")) - EC_S = Beta("ec_s", 0.5, 0, None, ESTIMATE) + if args.ec is None: + EC_S = Beta("ec_s", 0.5, 0, None, ESTIMATE) + else: + EC_S = args.ec print("Using MXL modes", args.mxl_modes) U = {}