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