Skip to content

Commit

Permalink
include AV speed limit
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Sep 23, 2024
1 parent 8d16a3e commit 1fdb144
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/org/matsim/run/DrtFleetSizing.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.dvrp.run.AbstractDvrpModeModule;
import org.matsim.contrib.dvrp.run.DvrpConfigGroup;
import org.matsim.contrib.dvrp.trafficmonitoring.DvrpModeLimitedMaxSpeedTravelTimeModule;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.controler.Controler;
Expand All @@ -29,6 +30,7 @@
import org.matsim.core.router.TripStructureUtils;
import org.matsim.core.utils.io.IOUtils;
import org.matsim.rebalancing.WaitingPointsBasedRebalancingModule;
import org.matsim.vehicles.VehicleType;
import picocli.CommandLine;

import java.nio.file.Files;
Expand Down Expand Up @@ -147,6 +149,16 @@ public Integer call() throws Exception {
MultiModeDrtConfigGroup multiModeDrtConfig = MultiModeDrtConfigGroup.get(config);
Controler controler = DrtControlerCreator.createControler(config, false);

// Add speed limit to av vehicle
double maxSpeed = controler.getScenario()
.getVehicles()
.getVehicleTypes()
.get(Id.create("autonomous_vehicle", VehicleType.class))
.getMaximumVelocity();
controler.addOverridingModule(
new DvrpModeLimitedMaxSpeedTravelTimeModule("av", config.qsim().getTimeStepSize(),
maxSpeed));

for (DrtConfigGroup drtCfg : multiModeDrtConfig.getModalElements()) {
if (drtCfg.getMode().equals("av")) {
drtCfg.transitStopFile = transitStopFilePath;
Expand Down

0 comments on commit 1fdb144

Please sign in to comment.