Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Simonstrator
PeerfactSim.KOM
Commits
c4a71167
Commit
c4a71167
authored
Jun 19, 2018
by
jimonreal
Committed by
Jose Ignacio Monreal Bailey
Aug 20, 2019
Browse files
Adding option tripinfo.
In next commit changing the name file
parent
290a11b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/traci/TraciSimulationController.java
View file @
c4a71167
...
...
@@ -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
)
{
...
...
src/de/tud/kom/p2psim/impl/topology/movement/vehicular/sumo/simulation/controller/xml/XMLSimulationController.java
View file @
c4a71167
...
...
@@ -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
)
{
...
...
src/de/tud/kom/p2psim/impl/vehicular/DefaultVehicleInformationComponent.java
View file @
c4a71167
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment