I think it’s best if you use E3 detectors to count how many vehicles pass an 
intersection:

traci.multientryexit.getLastStepVehicleNumber(‘detID’)

From: [email protected] [mailto:[email protected]] On 
Behalf Of Hao Zhou
Sent: Thursday, 21 November 2019 15:25
To: Sumo project User discussions <[email protected]>
Subject: [sumo-user] discussion on using traci to compute throughput of 
intersections

Hi all,

I noticed that the throughput flow of intersections can be accessed in the 
output file of loop detectors. But I am wondering can we use traci to get the 
real-time throughput between time [t-interval, t]?

# Loop[j] is the lsit for loop detector j
Loop = [[] for x in range(Num_detectors)]
Count = [[] for x in range(Num_detectors)]

Loop[j].append(traci.inductionloop.getLastStepVehicleIDs(str(j)))
if Loop[j][step] != Loop[j][step-1]:
Count[j].append(1)
else:
Count[j].append(0)

To get how many vehicles passed the intersection, I retrived the ID list on a 
loop detector and try to check whether it changed last time. Is it the correct 
way?

Thank you,
Hao
_______________________________________________
sumo-user mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Reply via email to