Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Count elapsed time of a phase via TraCI

Hi Mirko,
Thank you for your reply! That's exactly my current implementation. Thanks anyway.

Sincerely,
Shuyi

On Wed, Jul 25, 2018 at 2:06 AM m.barthauer@xxxxxxxxxxx <m.barthauer@xxxxxxxxxxx> wrote:

There is no TraCI helper function for that, but all you need to calculate it is available...

 

If you check the phase ID at every second anyway, you can also keep track of the elapsed time per traffic light/phase in your script. Just make some counter which is reset to 0 when the current phase differs from the previous time step.

 

Regards

Mirko

 

 

 

-----Original-Nachricht-----

Betreff: [sumo-user] Count elapsed time of a phase via TraCI

Datum: 2018-07-25T09:25:14+0200

Von: "Shuyi Yin" <shuyi.yin1@xxxxxxxxx>

An: "sumo-user@xxxxxxxxxxx" <sumo-user@xxxxxxxxxxx>

 

 

 

Hi SUMO community,
 
I'm controlling traffic lights via TraCI, and want to know at every second what is my current phase and elapsed time of the phase.
 
For the current phase, it is easy to use getPhase(juntion), but what about the elapsed time, i.e. the number of seconds this current phase has been in effect?
 
Thanks,
Shuyi

_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/sumo-user

Back to the top