Skip to content

Commit

Permalink
update matsim-libs, compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vsp-gleich committed May 17, 2024
1 parent a68c05c commit ffefeec
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- <matsim.version>13.0-2020w51-SNAPSHOT</matsim.version> -->

<!-- PR release -->
<matsim.version>15.0-PR2431</matsim.version>
<matsim.version>2025.0-PR3278</matsim.version>

<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down
24 changes: 12 additions & 12 deletions src/main/java/org/matsim/run/RunMetropoleRuhrScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ChangeModeConfigGroup;
import org.matsim.core.config.groups.PlanCalcScoreConfigGroup;
import org.matsim.core.config.groups.ScoringConfigGroup;
import org.matsim.core.config.groups.SubtourModeChoiceConfigGroup;
import org.matsim.core.controler.AbstractModule;
import org.matsim.core.controler.Controler;
Expand Down Expand Up @@ -73,7 +73,7 @@
import java.util.function.Consumer;
import java.util.function.Supplier;

import static org.matsim.core.config.groups.PlansCalcRouteConfigGroup.AccessEgressType.accessEgressModeToLinkPlusTimeConstant;
import static org.matsim.core.config.groups.RoutingConfigGroup.AccessEgressType.accessEgressModeToLinkPlusTimeConstant;


@CommandLine.Command(header = ":: Open Metropole Ruhr Scenario ::", version = RunMetropoleRuhrScenario.VERSION, showDefaultValues = true)
Expand Down Expand Up @@ -199,14 +199,14 @@ protected Config prepareConfig(Config config) {

//config.plansCalcRoute().setAccessEgressType(AccessEgressType.accessEgressModeToLink);
log.info("using accessEgressModeToLinkPlusTimeConstant");
config.plansCalcRoute().setAccessEgressType(accessEgressModeToLinkPlusTimeConstant);
config.routing().setAccessEgressType(accessEgressModeToLinkPlusTimeConstant);
config.qsim().setUsingTravelTimeCheckInTeleportation(true);
config.qsim().setUsePersonIdForMissingVehicleId(false);
config.subtourModeChoice().setProbaForRandomSingleTripMode(0.5);

if (sample.isSet()) {
config.controler().setRunId(sample.adjustName(config.controler().getRunId()));
config.controler().setOutputDirectory(sample.adjustName(config.controler().getOutputDirectory()));
config.controller().setRunId(sample.adjustName(config.controller().getRunId()));
config.controller().setOutputDirectory(sample.adjustName(config.controller().getOutputDirectory()));
config.plans().setInputFile(sample.adjustName(config.plans().getInputFile()));

config.qsim().setFlowCapFactor(sample.getSize() / 100.0);
Expand All @@ -225,20 +225,20 @@ protected Config prepareConfig(Config config) {

for (String act : List.of("home", "restaurant", "other", "visit", "errands",
"educ_higher", "educ_secondary", "educ_primary", "educ_tertiary", "educ_kiga", "educ_other")) {
config.planCalcScore()
.addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams(act + "_" + ii).setTypicalDuration(ii));
config.scoring()
.addActivityParams(new ScoringConfigGroup.ActivityParams(act + "_" + ii).setTypicalDuration(ii));
}

config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("work_" + ii).setTypicalDuration(ii)
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("work_" + ii).setTypicalDuration(ii)
.setOpeningTime(6. * 3600.).setClosingTime(20. * 3600.));
config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("business_" + ii).setTypicalDuration(ii)
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("business_" + ii).setTypicalDuration(ii)
.setOpeningTime(6. * 3600.).setClosingTime(20. * 3600.));
config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("leisure_" + ii).setTypicalDuration(ii)
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("leisure_" + ii).setTypicalDuration(ii)
.setOpeningTime(9. * 3600.).setClosingTime(27. * 3600.));

config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("shop_daily_" + ii).setTypicalDuration(ii)
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("shop_daily_" + ii).setTypicalDuration(ii)
.setOpeningTime(8. * 3600.).setClosingTime(20. * 3600.));
config.planCalcScore().addActivityParams(new PlanCalcScoreConfigGroup.ActivityParams("shop_other_" + ii).setTypicalDuration(ii)
config.scoring().addActivityParams(new ScoringConfigGroup.ActivityParams("shop_other_" + ii).setTypicalDuration(ii)
.setOpeningTime(8. * 3600.).setClosingTime(20. * 3600.));
}

Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/matsim/run/StrategyWeightFadeout.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Plan;
import org.matsim.core.config.Config;
import org.matsim.core.config.groups.StrategyConfigGroup;
import org.matsim.core.config.groups.ReplanningConfigGroup;
import org.matsim.core.controler.events.IterationStartsEvent;
import org.matsim.core.controler.listener.IterationStartsListener;
import org.matsim.core.replanning.GenericPlanStrategy;
Expand All @@ -47,7 +47,7 @@ public final class StrategyWeightFadeout implements IterationStartsListener {
private final Logger log = LogManager.getLogger(StrategyWeightFadeout.class);

@Inject
private Map<StrategyConfigGroup.StrategySettings, PlanStrategy> planStrategies;
private Map<ReplanningConfigGroup.StrategySettings, PlanStrategy> planStrategies;

@Inject
private Config config;
Expand All @@ -63,9 +63,9 @@ public void notifyIterationStarts(IterationStartsEvent iterationStartsEvent) {

for (Schedule s : schedules) {

StrategyConfigGroup.StrategySettings settings = null;
ReplanningConfigGroup.StrategySettings settings = null;

for (StrategyConfigGroup.StrategySettings strategySettings : planStrategies.keySet()) {
for (ReplanningConfigGroup.StrategySettings strategySettings : planStrategies.keySet()) {
if (strategySettings.getStrategyName().equals(s.name) && strategySettings.getSubpopulation().equals(s.subpopulation)) {
settings = strategySettings;
break;
Expand All @@ -81,16 +81,16 @@ public void notifyIterationStarts(IterationStartsEvent iterationStartsEvent) {

if (Double.isNaN(s.initialWeight)) {
s.initialWeight = settings.getWeight();
s.startIteration = (int) (config.controler().getLastIteration() * s.startAt);
double disable = config.strategy().getFractionOfIterationsToDisableInnovation();
s.startIteration = (int) (config.controller().getLastIteration() * s.startAt);
double disable = config.replanning().getFractionOfIterationsToDisableInnovation();

// use disable after if it is set
if (!Double.isNaN(s.endAt))
s.endIteration = (int) (config.controler().getLastIteration() * s.endAt);
s.endIteration = (int) (config.controller().getLastIteration() * s.endAt);
else if (settings.getDisableAfter() > 0 && settings.getDisableAfter() < Integer.MAX_VALUE && settings.getDisableAfter() <= disable)
s.endIteration = settings.getDisableAfter();
else if (Double.isFinite(disable) && disable < Integer.MAX_VALUE)
s.endIteration = (int) (config.controler().getLastIteration() * disable);
s.endIteration = (int) (config.controller().getLastIteration() * disable);
else
s.endIteration = settings.getDisableAfter();

Expand Down

0 comments on commit ffefeec

Please sign in to comment.