Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] discussion on using traci to compute throughput of intersections

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

 

traci.multientryexit.getLastStepVehicleNumber(‘detID’)

 

From: sumo-user-bounces@xxxxxxxxxxx [mailto:sumo-user-bounces@xxxxxxxxxxx] On Behalf Of Hao Zhou
Sent: Thursday, 21 November 2019 15:25
To: Sumo project User discussions <sumo-user@xxxxxxxxxxx>
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


Back to the top