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 ...@@ -166,7 +166,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
return _positons.get(pVehicleID).getPosition(); 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) { public Location getVehiclePosition(double pStep, String pVehicleID) {
if (pStep == _step) { if (pStep == _step) {
return getVehiclePosition(pVehicleID); return getVehiclePosition(pVehicleID);
...@@ -287,6 +295,15 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -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 @Override
public boolean nextStep() { public boolean nextStep() {
if (Simulator.getEndTime() == Simulator.getCurrentTime()) { if (Simulator.getEndTime() == Simulator.getCurrentTime()) {
......
...@@ -98,7 +98,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet ...@@ -98,7 +98,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return getVehiclePosition(_step, pVehicleID); 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); return _vehicleDataInformationHandler.getVehiclePositions().get(pVehicleID);
} }
...@@ -247,6 +252,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet ...@@ -247,6 +252,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
} }
@Override
public List<String> getLastStepVehicleIDs(String laneId) {
return null;
}
@Override @Override
public double getScenarioWidth() { public double getScenarioWidth() {
return -1; return -1;
......
...@@ -117,6 +117,26 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo ...@@ -117,6 +117,26 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
controller.getCompleteDefinition(trafficLightId); 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 @Override
public void initialize() { 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