Skip to content

Commit

Permalink
remove car free multi modal link chooser and remove link ids of facil…
Browse files Browse the repository at this point in the history
…ties to get the same result
  • Loading branch information
GregorRyb committed Nov 3, 2023
1 parent 0c721c0 commit 6a7b539
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/org/matsim/run/RunLeipzigScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import org.matsim.core.router.MultimodalLinkChooser;
import org.matsim.core.router.TripStructureUtils;
import org.matsim.core.scoring.functions.ScoringParametersForPerson;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.facilities.Facility;
import org.matsim.run.prepare.*;
import org.matsim.simwrapper.SimWrapperConfigGroup;
import org.matsim.simwrapper.SimWrapperModule;
Expand Down Expand Up @@ -282,6 +284,13 @@ protected void prepareScenario(Scenario scenario) {
DrtCaseSetup.prepareScenario(scenario, drtCase, new ShpOptions(networkOpt.getDrtArea(), null, null), VERSION);
}

// alternative to model car free area, by removing the link id it is ensured the default multi modal link chooser functions as the car free one
if (networkOpt.hasCarFreeArea()) {
for (Facility fac : scenario.getActivityFacilities().getFacilities().values()) {
FacilitiesUtils.setLinkID(fac, null);
}
}


}

Expand Down Expand Up @@ -315,7 +324,7 @@ public void install() {
bind(PermissibleModesCalculator.class).to(PermissibleModesCalculatorImpl.class);

if (networkOpt.hasCarFreeArea()) {
bind(MultimodalLinkChooser.class).to(CarfreeMultimodalLinkChooser.class);
//bind(MultimodalLinkChooser.class).to(CarfreeMultimodalLinkChooser.class);
}

if (networkOpt.hasParkingCostArea()) {
Expand Down

0 comments on commit 6a7b539

Please sign in to comment.