Closed ma-al closed 10 years ago
Hi, indeed, the value returned by getCurrentSimStep() comes from an internal counter, not from Sumo. And it always starts from zero. A possible fix would be in SumoTraciConnection.postConnect(), where currentSimStep is set to zero.
Hi mar-di, would you mind to checkout the "fix-begin-simtime" and check if that works for you?
Did a JUnit test by myself. Fixed in master too.
Hi egueli,
We tested the new code and it works. Starting simulation time is now set to whatever was specified in the sumo.cfg file.
Thanks for the replies and your efforts. Again, many thanks for allowing the use of TraCI4J.
Hi,
Currently, when starting a SUMO instance, the starting time reported by the API does not match the one specified in the
sumo.cfg
file. Instead, it always starts at zero.For example, you tell SUMO (via TraCI4J) to start with
example.sumo.cfg
that specifies:However, doing
conn.getCurrentSimStep()
returns time 0. Incrementing usingconn.nextSimStep();
only advances strictly by 1.For now, I'm externally finding the begin-time and brute-force incrementing the simulation time to the desired value. Just wondering if I've missed something obvious, or a more elegant way to "fast-forward" the simulation time.
Any advice would be much appreciated.
Many thanks for allowing the use of TraCI4J.