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
// 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
_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)
*/
_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);
try {
......@@ -133,6 +137,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
/*
* This is called by the simulation scheduler once the simulation is
* finished - it should be used to terminate the connection to SUMO.
*
*/
if (_connection != null && !_connection.isClosed()) {
_connection.close();
......@@ -314,6 +319,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
execute(typeCommand);
}
/*
@Override
public long getWaitingTime(String vehicleID) {
SumoCommand waitingTimeCommand = Vehicle.getWaitingTime(vehicleID);
......@@ -322,6 +328,7 @@ public class TraciSimulationController implements VehicleController, SimulationS
return Long.parseLong(waitingTime);
}
*/
@Override
public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) {
......
......@@ -289,10 +289,12 @@ public class XMLSimulationController implements VehicleController, SimulationSet
_vehicleDataInformationHandler.getVehiclePositions().get(pVehicleID).setGap(gap);
}
/*
@Override
public long getWaitingTime(String vehicleID) {
return 0;
}
*/
@Override
public void setVehicleMaxSpeed(String pVehicleID, double pVehicleSpeed) {
......
......@@ -149,10 +149,12 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
controller.setVehicleMaxSpeed(vehicleID, vehicleSpeed);
}
/*
@Override
public long getWaitingTime() {
return controller.getWaitingTime(vehicleID);
}
*/
@Override
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