Skip to content

Commit

Permalink
allow for person specific asc, ensure income dependent scoring is act…
Browse files Browse the repository at this point in the history
…ive if AdvancedScoringConfigGroup is not present
  • Loading branch information
vsp-gleich committed Aug 24, 2024
1 parent 7ea07ac commit ee03358
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/org/matsim/run/OpenBerlinScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule;
import org.matsim.core.router.costcalculators.TravelDisutilityFactory;
import org.matsim.core.router.util.TravelTime;
import org.matsim.core.scoring.functions.PersonScoringParametersFromPersonAttributes;
import org.matsim.core.scoring.functions.ScoringParametersForPerson;
import org.matsim.run.scoring.AdvancedScoringConfigGroup;
import org.matsim.run.scoring.AdvancedScoringModule;
import org.matsim.simwrapper.SimWrapperConfigGroup;
Expand Down Expand Up @@ -112,6 +114,15 @@ protected void prepareControler(Controler controler) {
// AdvancedScoring is specific to matsim-berlin!
if (ConfigUtils.hasModule(controler.getConfig(), AdvancedScoringConfigGroup.class)) {
controler.addOverridingModule(new AdvancedScoringModule());
} else {
// if the above config group is not present we still need income dependent scoring
// this implementation also allows for person specific asc
controler.addOverridingModule(new AbstractModule() {
@Override
public void install() {
bind(ScoringParametersForPerson.class).to(PersonScoringParametersFromPersonAttributes.class).asEagerSingleton();
}
});
}
}

Expand Down

0 comments on commit ee03358

Please sign in to comment.