Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sumo-user] Traci for signal's 'offset time

Hi,
(1) I know how to set signal's "offset time" as below:
<tlLogic id="…" type="static" programID="..." offset="0">

(2) I also know how to write simple codes with Traci as below:

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)

(3)However, if I want to set the offset time dynamically by Traci, how can I do?

Back to the top