Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Solving Edge Detection Error in TraCI

instead of hard-coding the lane index you put into setStop, you could use the current lane index of the vehicle (traci.vehicle.getLaneIndex())

Am Mi., 20. Okt. 2021 um 23:24 Uhr schrieb Ifezue Obiako <vincentobiako@xxxxxxxxx>:
Hello Everyone

I am in the process of developing a Python function in TraCI that is intended to reduce bus bunching from occurring by using a "Holding Strategy" where the buses are detecting their current edge and bus stop. If the following bus 3 catches up with bus 4, as seen in the image below, then bus 3 will stay at the stop that the two buses were bunched at for a specific amount of time.
image.png

My problem is that in my function I am trying to continuously detect edgeID that bus 3 is on by storing them in a variable and inputting that variable into the traci.vehicle.setStop() method. However, I keep getting an error when bus 3 goes over a junction where the number of lanes goe from 2 to 1 or 1 to 2 and the error message says: 'No lane with index '1' on edge ':4618683350_0'. Here is what it looks like in the command line:
image.png
And the function in my code looks like this:
image.png

Does anyone have any suggestions on what could be done to eradicate this lane error?

Thank you in advance
Ifezue
_______________________________________________
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