flow-project / flow

Computational framework for reinforcement learning in traffic control
MIT License
1.04k stars 369 forks source link

Defining traffic light logic with TrafficLightParams does not write to .xml for SUMO #1038

Open habibi1195 opened 3 years ago

habibi1195 commented 3 years ago

Bug Description:

As stated in the title, defining traffic light logic with TrafficLightParams from flow.core.params does not create the appropriate output in the .net.xml file for SUMO to read.

After defining phases and using the TrafficLightParams.add(node_id, programID = , phases=), I can see that they are correctly accepted when checking TrafficLightParams.get_properties().

However, I noticed that in the SUMO GUI, the traffic lights were exhibiting default behavior (with parameter value for "programID" as "0"). Upon checking the .net.xml file lines associated with the traffic lights, the tlLogic program id is indeed 0, and the phases are all default values.