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

Adding option tripinfo.

In next commit changing the name file
parent 290a11b9
...@@ -107,11 +107,15 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -107,11 +107,15 @@ public class TraciSimulationController implements VehicleController, SimulationS
// This will only work with the updated version of the TraaS API for sumo // This will only work with the updated version of the TraaS API for sumo
// It is available for download at https://dev.kom.e-technik.tu-darmstadt.de/gitlab/tobiasm/TraaS.git // It is available for download at https://dev.kom.e-technik.tu-darmstadt.de/gitlab/tobiasm/TraaS.git
_connection = new SumoTraciConnection(_sumoExe, _configFile, random.nextInt(), _tripOutputFile); int nextRandomInt = random.nextInt();
_connection = new SumoTraciConnection(_sumoExe, _configFile, nextRandomInt);
/* /*
* prevent vehicles form teleporting (http://sumo.dlr.de/wiki/Simulation/Why_Vehicles_are_teleporting) * prevent vehicles form teleporting (http://sumo.dlr.de/wiki/Simulation/Why_Vehicles_are_teleporting)
*/ */
_connection.addOption("time-to-teleport", Integer.toString(-1)); _connection.addOption("time-to-teleport", Integer.toString(-1));
_connection.addOption("tripinfo-output.write-unfinished", "t");
_connection.addOption("tripinfo-output", "sumoCfg/Networks/Simple/simple4/simple4-outputTrip-" + Integer.toString(nextRandomInt) + ".xml");
//_connection.addOption("tripinfo-output.write-unfinished", _tripOutputFile);
_connection.printSumoError(true); _connection.printSumoError(true);
try { try {
...@@ -133,6 +137,7 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -133,6 +137,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
/* /*
* This is called by the simulation scheduler once the simulation is * This is called by the simulation scheduler once the simulation is
* finished - it should be used to terminate the connection to SUMO. * finished - it should be used to terminate the connection to SUMO.
*
*/ */
if (_connection != null && !_connection.isClosed()) { if (_connection != null && !_connection.isClosed()) {
_connection.close(); _connection.close();
...@@ -314,6 +319,7 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -314,6 +319,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute(typeCommand); execute(typeCommand);
} }
/*
@Override @Override
public long getWaitingTime(String vehicleID) { public long getWaitingTime(String vehicleID) {
SumoCommand waitingTimeCommand = Vehicle.getWaitingTime(vehicleID); SumoCommand waitingTimeCommand = Vehicle.getWaitingTime(vehicleID);
...@@ -322,6 +328,7 @@ public class TraciSimulationController implements VehicleController, SimulationS ...@@ -322,6 +328,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
return Long.parseLong(waitingTime); return Long.parseLong(waitingTime);
} }
*/
@Override @Override
public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) { public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) {
......
...@@ -289,10 +289,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet ...@@ -289,10 +289,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet
_vehicleDataInformationHandler.getVehiclePositions().get(pVehicleID).setGap(gap); _vehicleDataInformationHandler.getVehiclePositions().get(pVehicleID).setGap(gap);
} }
/*
@Override @Override
public long getWaitingTime(String vehicleID) { public long getWaitingTime(String vehicleID) {
return 0; return 0;
} }
*/
@Override @Override
public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) { public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) {
......
...@@ -149,10 +149,12 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom ...@@ -149,10 +149,12 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
controller.setVehicleMaxSpeed(vehicleID, vehicleSpeed); controller.setVehicleMaxSpeed(vehicleID, vehicleSpeed);
} }
/*
@Override @Override
public long getWaitingTime() { public long getWaitingTime() {
return controller.getWaitingTime(vehicleID); return controller.getWaitingTime(vehicleID);
} }
*/
@Override @Override
public void resetVehicleID() { public void resetVehicleID() {
......
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