Skip to content

Commit

Permalink
update cadyts usage
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed May 26, 2024
1 parent d496bf7 commit de14e0a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/org/matsim/prepare/RunOpenBerlinCalibration.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ protected Config prepareConfig(Config config) {

// All car leads to much more congestion even if scaled up compared to a normal run
// therefore scaling is increased a bit more
double countScale = allCar ? CAR_FACTOR * 1.2 : 1;
double countScale = allCar ? CAR_FACTOR : 1;

config.qsim().setFlowCapFactor(sampleSize * countScale);
config.qsim().setStorageCapFactor(sampleSize * countScale);
Expand Down Expand Up @@ -238,16 +238,14 @@ protected Config prepareConfig(Config config) {
for (String subpopulation : List.of("person", "commercialPersonTraffic", "commercialPersonTraffic_service", "goodsTraffic")) {
config.replanning().addStrategySettings(new ReplanningConfigGroup.StrategySettings()
.setStrategyName(DefaultPlanStrategiesModule.DefaultStrategy.ReRoute)
.setWeight(weight)
.setWeight(weight / 8)
.setSubpopulation(subpopulation)
);
}

config.controller().setRunId("cadyts");
config.controller().setOutputDirectory("./output/cadyts-" + scaleFactor);

config.scoring().setFractionOfIterationsToStartScoreMSA(0.75);
config.replanning().setFractionOfIterationsToDisableInnovation(0.75);
// Need to store more plans because of plan types
config.replanning().setMaxAgentPlanMemorySize(8);

Expand Down Expand Up @@ -397,6 +395,14 @@ public ScoringFunction createNewScoringFunction(Person person) {
return sumScoringFunction;
}
});

controler.addOverridingModule(new AbstractModule() {
@Override
public void install() {
binder().bind(new TypeLiteral<StrategyChooser<Plan, Person>>() {}).toInstance(new ForceInnovationStrategyChooser<>((int) Math.ceil(1.0 / weight), ForceInnovationStrategyChooser.Permute.yes));
}
});

} else if (mode == CalibrationMode.routeChoice) {

controler.addOverridingModule(new AbstractModule() {
Expand Down

0 comments on commit de14e0a

Please sign in to comment.