diff --git a/src/main/java/org/matsim/run/RunOpenBerlinScenarioWithBikeOnNetwork.java b/src/main/java/org/matsim/run/RunOpenBerlinScenarioWithBikeOnNetwork.java index 2f84049d..627bcd2d 100644 --- a/src/main/java/org/matsim/run/RunOpenBerlinScenarioWithBikeOnNetwork.java +++ b/src/main/java/org/matsim/run/RunOpenBerlinScenarioWithBikeOnNetwork.java @@ -3,6 +3,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.matsim.api.core.v01.Scenario; +import org.matsim.api.core.v01.population.Activity; +import org.matsim.api.core.v01.population.PlanElement; import org.matsim.application.MATSimApplication; import org.matsim.core.config.Config; import org.matsim.core.config.groups.ReplanningConfigGroup; @@ -93,7 +95,6 @@ protected Config prepareConfig(Config config) { } case bikeTeleportedStandardMatsim -> { log.info("Simulating assuming bikes are teleported, this is the default in the input config"); - } default -> throw new IllegalStateException("Unexpected value: " + bike); @@ -109,6 +110,16 @@ protected void prepareScenario(Scenario scenario) { if (bike == BicycleHandling.onNetworkWithStandardMatsim || bike == BicycleHandling.onNetworkWithBicycleContrib) { for (Person person: scenario.getPopulation().getPersons().values()) { PopulationUtils.resetRoutes(person.getSelectedPlan()); + + for (PlanElement planElement:person.getSelectedPlan().getPlanElements()) { + if (planElement instanceof Activity activity) { + activity.setLinkId(null); + activity.setFacilityId(null); + + } + } + + } }