1

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 Answers4

0

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

0

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

Yashar
  • 46
  • 2
0

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

math.husky
  • 193
  • 1
  • 8
  • Yes! That's what I did and it seems to be 16, which is exactly the number of states defined in my String... I added a picture of the phases in the description [3] – Antonio Domínguez Jul 04 '19 at 17:18
  • Can you try to duplicate each state string three times? (ie they each will be of size 48) – math.husky Jul 04 '19 at 19:44
  • I just did it but I got the same error message. I also got a warning per intersection saying this: "Warning: Unused states in tlLogic 'center21', program '10' in phase 0 after tl-index 15", which confirms that the phase size is 16 (from 0 to 15). The number of characters in my String phase is also 16. This is why I don't understand... Everything seems to be right but it still doesn't work – Antonio Domínguez Jul 05 '19 at 14:25
  • Could you share your code so that I can try the example? – math.husky Jul 05 '19 at 17:38
  • Sorry for the late response. You can download it in the following link (see the updated description above): https://www.dropbox.com/sh/zpkb19wxaqmo1iw/AABFlREA4M3VTLc-uUH0VWk1a?dl=0 – Antonio Domínguez Aug 07 '19 at 18:28
0

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!