I am modifying SimpleGridScenario class in ../flow/scenarios/grid.py and .../examples/rllib/green_wave.py so that I can turn my simple grid into a double lane per corridor scenario. I added them and I also set up new connections so that vehicles can turn right and left. This is shown in the attached image. For every approach, the first lane allows vehicles to turn left and go straight on and the second one allows vehicles to turn right and go straight on as well.
Unfortunately, every time I run a simulation I receive the following error:
Error: Mismatching phase size in tls 'center0', program 'online'. Quitting (on error).
Does anyone know why?
I've verified the phase size in sumo-gui and it is 16, what is correct since I have 4 possible movements per approach.
SimpleGridScenario > __init__()
phases = [{
"duration": "25",
"minDur": "8",
"maxDur": "45",
"state": "GGGgrrrrGGGgrrrr"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "yyygrrrryyygrrrr"
}, {
"duration": "6",
"minDur": "3",
"maxDur": "6",
"state": "rrrGrrrrrrrGrrrr"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrryrrrrrrryrrrr"
}, {
"duration": "25",
"minDur": "8",
"maxDur": "45",
"state": "rrrrGGGgrrrrGGGg"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrrryyygrrrryyyg"
}, {
"duration": "6",
"minDur": "3",
"maxDur": "6",
"state": "rrrrrrrGrrrrrrrG"
}, {
"duration": "7",
"minDur": "3",
"maxDur": "6",
"state": "rrrrrrryrrrrrrry"
}]
for i in range(self.row_num * self.col_num):
node_id = "center"+str(i)
traffic_lights.add(node_id, phases=phases, tls_type="actuated")
Files can be downloaded in the following link: Flow files
Do not forget to replace the __init__.py file by yours in the scenario directory!
UPDATE: It seems that there might be an online modification of the TLS, probably by Traci. For further details please check this (last comment): Click here