[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[sumo-user] Cannot set trafficlights logic
|
/def set_sig(phase0_duration, phase2_duration):
phases = []
phases.append(traci.trafficlights.Phase(phase0_duration, 0, 0, "rG"))
phases.append(traci.trafficlights.Phase(3, 0, 0, "yy"))
phases.append(traci.trafficlights.Phase(phase2_duration, 0, 0, "Gr"))
phases.append(traci.trafficlights.Phase(3, 0, 0, "yy"))
logic = traci.trafficlights.Logic("new-program", 0, 0, 0, [phases])
traci.trafficlights.setCompleteRedYellowGreenDefinition("tl1", logic)/
Calling this function gives the following error script:
/ File "rl_test.py", line 96, in set_sig
traci.trafficlights.setCompleteRedYellowGreenDefinition("tl1", logic)
File "C:\Program Files (x86)\Eclipse\Sumo\tools\traci\_trafficlight.py",
line 256, in setCompleteRedYellowGreenDefinition
for p in tls.phases:
TypeError: 'int' object is not iterable
Error: tcpip::Socket::recvAndCheck @ recv: peer shutdown
Quitting (on error)./
How do I fix this, please?
--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/