Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Request for Guidance with Integrating functions in TraCI

Dear Sir/Madam, I have a school project in which I need to run two simulations and output the total waiting time**. I am using both TraCI and SUMO's tools for this.
For the 1st simulation, the algorithm will need to:
1) Count the number of vehicles waiting at a junction.*
2) Select which lane has the highest number.
3) Allow the lane with the highest number of vehicles to move, along with the corresponding lane which can move at the same time (i.e. traffic flowing in opposite direction).

For the 2nd simulation, I need to:
1) Count the time elapsed since last green [lane.getWaitingTime?] for each lane.
2) If the 'max time since last green' is reached, to let that lane go next. [which function can get me this?]
3) If not, to count number of vehicles waiting in each lane.*
4) Sum the total number of vehicles in particular combinations of lanes that can move at the same time.
5) Let longest combination move.

I am lost at how to integrate all this together in the TraCI code to control which lanes gets the green light. What should the code look like? Would appreciate any and all help I can get on this!

*To get the count of the Vehicles, I am planning on using e1 detectors to get the [nVehEntered].

**I am planning on using one e3 detector over the whole map to get the total waiting time. Will that be accurate?

Kind Regards,
John Eapen

Back to the top