Commit 3e8abc02 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Added funtionlity to stop vehicle

parent 834e9eca
......@@ -35,4 +35,6 @@ public interface VehicleController {
double getStart();
void init();
void stopVehicle(String pVehicle);
}
......@@ -518,6 +518,12 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute(Vehicle.setRoute(pVehicle, routeEdges));
}
@Override
public void stopVehicle(String pVehicle) {
SumoCommand stopCommand = Vehicle.setSpeed(pVehicle, 0);
execute(stopCommand);
}
public void obtainRoadNetwork() {
if (_roadNetwork == null) {
SumoCommand laneIDCommand = Lane.getIDList();
......
......@@ -199,4 +199,9 @@ public class XMLSimulationController implements VehicleController, SimulationSet
throw new UnsupportedOperationException("This method is not supported for " + getClass().getSimpleName());
}
@Override
public void stopVehicle(String pVehicle) {
throw new UnsupportedOperationException("This method is not supported for " + getClass().getSimpleName());
}
}
......@@ -105,4 +105,9 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
}
}
@Override
public void stopVehicle() {
controller.stopVehicle(vehicleID);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment