Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] how to get and change tls phase duration?

I wish the codes below will help you.

#----------  x is duration array.

def set_sig(x):
    phases = []
    phases.append(traci.trafficlights.Phase(x[0], 0, 0, "GGrr"))
    phases.append(traci.trafficlights.Phase(3, 0, 0, "yyrr"))
    phases.append(traci.trafficlights.Phase(x[1], 0, 0, "rrGG"))
    phases.append(traci.trafficlights.Phase(3, 0, 0, "rryy"))
    logic = traci.trafficlights.Logic("new-program", 0, 0, 0, phases)
    traci.trafficlights.setCompleteRedYellowGreenDefinition("gneJ1", logic)



Hajar LAMGHARI <hajarlh.1993@xxxxxxxxx> 於 2019年1月10日 週四 19:45 寫道:
Hello,
I am using TraCI and I want to make Traffic light duration Dynamic. I found that to define new tlLogic with new durations and new states in real time, I have to use :
traci.trafficlights.getCompleteRedYellowGreenDefinition(tlsID) and,
traci.trafficlights.setCompleteRedYellowGreenDefinition(tlsID)
But it doesn't work for me!  I need just a tutorial to understand how to implement my dynamic solution using these functions (Such that I already saw the details in tools/ traci/ trafficlights.py). 
Than you in advance...

regards,

Garanti sans virus. www.avg.com
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top