Skip to content

Commit

Permalink
fix config option in experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Jan 5, 2025
1 parent 82279d3 commit 9bc20e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public class OpenBerlinChoiceExperiment extends OpenBerlinScenario {
@CommandLine.Option(names = "--balanced-innovation", description = "Use balanced innovation selection", defaultValue = "false")
private boolean bi;

@CommandLine.Option(names = "--act-est", description = "Include estimation of activity utilities into score", defaultValue = "true")
@CommandLine.Option(names = "--no-act-est", description = "Include estimation of activity utilities into score", defaultValue = "true",
negatable = true)
private boolean actEst;

@CommandLine.Option(names = "--inv-beta", description = "Beta inv value for selection", defaultValue = "-1")
Expand Down Expand Up @@ -177,6 +178,8 @@ protected void prepareControler(Controler controler) {
if (actEst) {
log.info("Including activity estimation into score");
builder.withActivityEstimator(DefaultActivityEstimator.class);
} else {
log.info("No activity estimation for score");
}

if (ConfigUtils.hasModule(controler.getConfig(), AdvancedScoringConfigGroup.class)) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/python/choicemodels/estimate_biogeme_plan_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import argparse
import os

import numpy as np
import biogeme.biogeme as bio
import biogeme.database as db
import biogeme.models as models
Expand Down Expand Up @@ -62,6 +63,11 @@

effort = {x: float(y) for x, y in args.effort}
if effort:
# Nan values are estimated
for mode in effort:
if np.isnan(effort[mode]):
effort[mode] = Beta(f"BETA_DIST_{mode}", 0, None, None, ESTIMATE)

print("Using time effort", effort)

# Variables for constants
Expand Down

0 comments on commit 9bc20e9

Please sign in to comment.