Skip to content

Commit

Permalink
fix: clean each drt network individually
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Feb 7, 2024
1 parent a1beb39 commit f30f222
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/matsim/run/prepare/PrepareNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.matsim.application.options.ShpOptions;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.network.algorithms.MultimodalNetworkCleaner;
import org.matsim.core.network.algorithms.NetworkCleaner;
import org.matsim.core.utils.geometry.geotools.MGC;
import org.matsim.core.utils.gis.ShapeFileReader;
import org.matsim.run.LeipzigUtils;
Expand Down Expand Up @@ -86,6 +87,12 @@ static void prepareDRT(Network network, ShpOptions shp) {
}
}

//we have to call the MultiModalNetworkCleaner for each mode individually, because otherwise the individual subnetworks might not get cleaned
MultimodalNetworkCleaner multimodalNetworkCleaner = new MultimodalNetworkCleaner(network);
for (String mode : modeGeoms.keySet()) {
multimodalNetworkCleaner.run(Set.of(mode));
}

log.log(Level.INFO, "The following modes have been added to the network: {}", modeGeoms.keySet());
}

Expand Down

0 comments on commit f30f222

Please sign in to comment.