Commit 9d3857c1 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 7ce68180
......@@ -272,14 +272,21 @@ public class TraciSimulationController implements VehicleController, SimulationS
}
@Override
public int getLastStepVehicleNumber(String edgeIdFrom) {
SumoCommand lastStepVehicleNumberCommand = Edge.getLastStepVehicleNumber(edgeIdFrom);
public int getLastStepVehicleNumber(String laneIdFrom) {
SumoCommand lastStepVehicleNumberCommand = Lane.getLastStepVehicleNumber(laneIdFrom);
Object lastStepVehicleNumberObject = requestObject(lastStepVehicleNumberCommand);
int lastStepVehicleNumber = ((Integer)lastStepVehicleNumberObject).intValue();
return lastStepVehicleNumber;
}
@Override
public void getCompleteDefinition(String trafficLightId) {
SumoCommand completeTrafficLightDefinitionCommand = Trafficlight.getCompleteRedYellowGreenDefinition(trafficLightId);
Object completeTrafficLightDefinitionObject = requestObject(completeTrafficLightDefinitionCommand);
}
@Override
public boolean nextStep() {
if (Simulator.getEndTime() == Simulator.getCurrentTime()) {
......
......@@ -242,6 +242,11 @@ public class XMLSimulationController implements VehicleController, SimulationSet
return 0;
}
@Override
public void getCompleteDefinition(String trafficLightId) {
}
@Override
public double getScenarioWidth() {
return -1;
......
......@@ -112,6 +112,11 @@ public class DefaultTrafficLightInformationComponent implements TrafficLightInfo
return controller.getLastStepVehicleNumber(edgeIdFrom);
}
@Override
public void getCompleteDefinition(String trafficLightId) {
controller.getCompleteDefinition(trafficLightId);
}
@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