1
votes

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).

Sample node in the grid

connections in NETEDIT

Phases in SUMO

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

4

4 Answers

0
votes

would you be able to attach the image? This would help a lot in figuring this out.

0
votes

For some phases (like the last one) MaxDur is less than the duration. Try increasing MaxDur or reducing duration.

0
votes

You can right click in sumo on a traffic light (green or red bar) and "Show phases" to see how long the "state" string should be (as many as the number of rows in the window that opens).

0
votes

It turns out that the phase size was correct, but my flow environment ( green_wave_env.py ) was setting the traffic light state in the 'online' program with a bad phase size. It works now. Thank you!