Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Average Waiting Time within TraCI

tf = open('tripinfos.xml')
while traci.simulation.getMinExpectedNumber() > 0:
    traci.simulationStep()
    line = True
    while line:
        line = tf.readline()
        print(traci.simulation.getTime(), line)
tf.close()

Am Di., 24. Mai 2022 um 16:46 Uhr schrieb Nino Michniok <mixnox@xxxxxx>:
Hi Jakob,
 
thank you for replying.
Regarding the second approach: I had this idea before but I didn't know how to access these values within a running script. Could you maybe provide a code snippet/command?
 
 
Gesendet: Dienstag, 24. Mai 2022 um 16:35 Uhr
Von: "Jakob Erdmann" <namdre.sumo@xxxxxxxxx>
An: "Sumo project User discussions" <sumo-user@xxxxxxxxxxx>
Betreff: Re: [sumo-user] Average Waiting Time within TraCI
Either:
- record the desired values continuously as long as the vehicle is still part of the simulation
- let the simulation write --tripinfo-output and parse this from within your traci script while it's being written (the file contents are flushed/updated after every simulation step)
 
 
 
Am Di., 24. Mai 2022 um 15:46 Uhr schrieb Nino Michniok <mixnox@xxxxxx>:
Hi everybody,

I just got started with SUMO and TraCI stuff. I need the waiting time of vehicles similar to what “--duration-log.statistics” does but I need the values within the running script.
So I tried to calculate the waiting time of vehicles that just arrived at their destination but this does not work because these vehicles instantly vanish. Has anybody an idea of how to do this?

Cheers!
Nino M
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________ sumo-user mailing list sumo-user@xxxxxxxxxxx To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top