Hey there still a relatively new user. I am writing a program that sends
out an emergency vehicle to a crash site where certain driving policy
changes are made on the emergency vehicles' route. One of these is to set
al traffic lights it reaches green.

At first I attempted to change it using the get/setPhase() methods which
proved unsuccessful:

def setNextLight(ambulanceID) :
tral = getNextLight(ambulanceID)
if tral:
print "Next light is : ", tral
if traci.trafficlights.getPhase(tral)!=4 :
traci.trafficlights.setPhase(tral, 4) #if not green set green
print "traffic light set to green"

I can't remember why I thought setting it to 4 would make it green I wrote
this in my first two weeks of using Sumo, I tried to fix it by using the
setRedYellowGreenState() method instead but this caused invalid phase
length exceptions (I assume because it interrupted a current phase to make
the change).

So my question is how do I make this function work (getNextLight() is a
 function I wrote myself, it seems to work fine).

Thank you!

Nick
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to