Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/6.x' into 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Sep 2, 2024
2 parents b433c35 + fa77d7c commit d8e7806
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>matsim-all</artifactId>

<!-- PR-labelled release -->
<version>2025.0-PR3402</version>
<version>2025.0-PR3410</version>

<!-- snapshot == not recommended: rather use PR-labelled release!-->
<!-- <version>2025.0-SNAPSHOT</version>-->
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/org/matsim/run/OpenBerlinScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.google.inject.Key;
import com.google.inject.name.Names;
import org.matsim.analysis.personMoney.PersonMoneyEventsAnalysisModule;
import org.matsim.analysis.pt.stop2stop.PtStop2StopAnalysisModule;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.application.MATSimApplication;
import org.matsim.application.options.SampleOptions;
import org.matsim.contrib.vsp.scoring.RideScoringParamsFromCarParams;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ReplanningConfigGroup;
Expand All @@ -14,6 +17,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 @@ -59,6 +64,8 @@ protected Config prepareConfig(Config config) {
config.plans().setInputFile(sample.adjustName(config.plans().getInputFile()));
}

// overwrite ride scoring params with values derived from car
RideScoringParamsFromCarParams.setRideScoringParamsBasedOnCarParams(config.scoring(), 1.0);
Activities.addScoringParams(config, true);

// Required for all calibration strategies
Expand Down Expand Up @@ -109,7 +116,18 @@ 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();
}
});
}
controler.addOverridingModule(new PtStop2StopAnalysisModule());
controler.addOverridingModule(new PersonMoneyEventsAnalysisModule());
}

/**
Expand Down

0 comments on commit d8e7806

Please sign in to comment.