Commit 669227fa authored by Jose Ignacio Monreal Bailey's avatar Jose Ignacio Monreal Bailey
Browse files

Setting structure for vehicles per second and vehicles moving on each lane.

I need to agregate lanes with same phase.
parent 016fedf3
...@@ -394,6 +394,20 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -394,6 +394,20 @@ public class TraciSimulationController implements VehicleController, SimulationS
} }
@Override
public List<String> getNextTLS(String vehicleId) {
SumoCommand nextTLSCommand = Vehicle.getNextTLS(vehicleId);
Object nextTLSObject = requestObject(nextTLSCommand);
SumoNextTLS sumoNextTLS = (SumoNextTLS) nextTLSObject;
List<String> nextTLSList = new LinkedList<>();
for (SumoNextTLS.NextTLS nextTLS : sumoNextTLS.ll) {
nextTLSList.add(nextTLS.tlsID);
}
return nextTLSList;
}
/* /*
@Override @Override
public long getWaitingTime(String vehicleID) { public long getWaitingTime(String vehicleID) {
......
...@@ -321,6 +321,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet ...@@ -321,6 +321,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return null; return null;
} }
@Override
public List<String> getNextTLS(String vehicleId) {
return null;
}
/* /*
@Override @Override
public long getWaitingTime(String vehicleID) { public long getWaitingTime(String vehicleID) {
......
...@@ -150,6 +150,11 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom ...@@ -150,6 +150,11 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
controller.setVehicleMaxSpeed(vehicleID, vehicleSpeed); controller.setVehicleMaxSpeed(vehicleID, vehicleSpeed);
} }
@Override
public List<String> getNextTLS(String vehicleId) {
return controller.getNextTLS(vehicleId);
}
/* /*
@Override @Override
public long getWaitingTime() { public long getWaitingTime() {
......
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