Commit 016fedf3 authored by jimonreal's avatar jimonreal Committed by Jose Ignacio Monreal Bailey
Browse files

Adding constraints names

parent 9d3857c1
......@@ -166,7 +166,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
return _positons.get(pVehicleID).getPosition();
}
@Override
@Override
public double getVehicleMaxSpeed(String vehicleId) {
SumoCommand speedCommand = Vehicle.getMaxSpeed(vehicleId);
Object object = requestObject(speedCommand);
return (Double)object;
}
@Override
public Location getVehiclePosition(double pStep, String pVehicleID) {
if (pStep == _step) {
return getVehiclePosition(pVehicleID);
......@@ -287,6 +295,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
}
@Override
public List<String> getLastStepVehicleIDs(String laneId) {
SumoCommand lastStepVehicleIDsCommand = Lane.getLastStepVehicleIDs(laneId);
Object lastStepVehicleIDsObject = requestObject(lastStepVehicleIDsCommand);
List<String> lastStepVehicleIDs = (List<String>) lastStepVehicleIDsObject;
return lastStepVehicleIDs;
}
@Override
public boolean nextStep() {
if (Simulator.getEndTime() == Simulator.getCurrentTime()) {
......
......@@ -98,7 +98,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return getVehiclePosition(_step, pVehicleID);
}
public VehicleInformationContainer requestVehicleInformation(String pVehicleID) {
@Override
public double getVehicleMaxSpeed(String vehicleId) {
return 0;
}
public VehicleInformationContainer requestVehicleInformation(String pVehicleID) {
return _vehicleDataInformationHandler.getVehiclePositions().get(pVehicleID);
}
......@@ -247,6 +252,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
}
@Override
public List<String> getLastStepVehicleIDs(String laneId) {
return null;
}
@Override
public double getScenarioWidth() {
return -1;
......
......@@ -117,6 +117,26 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
controller.getCompleteDefinition(trafficLightId);
}
@Override
public List<String> getLastStepVehicleIDs(String laneId) {
return controller.getLastStepVehicleIDs(laneId);
}
@Override
public double getVehicleSpeed(String vehicleId) {
return controller.getVehicleSpeed(vehicleId);
}
@Override
public Location getVehiclePosition(String vehicleId) {
return controller.getVehiclePosition(vehicleId);
}
@Override
public double getVehicleMaxSpeed(String vehicleId) {
return controller.getVehicleMaxSpeed(vehicleId);
}
@Override
public void initialize() {
......
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