JoserraLP / SmartTLC

1 stars 0 forks source link

Error executing Traffic Light Controller on "Master Thesis" Tag #1

Open JoserraLP opened 2 years ago

JoserraLP commented 2 years ago

Execution examples may fail because there does not exist a folder called "flows" inside the "net-files" in "traffic_light_controller".

The solution is very easy, you only need to create the folder and it will work again.

JoserraLP commented 2 years ago

Another mini-bug is that on the "traci_sim.py" the variable "data" uses a key that it is not created previously.

This happens because some files were not updated when created the tag, and these keys were fixed but not updated in the repository tag.

The solution is also very easy, in the mentioned file, it is required to create to fields "waiting_time_veh_n_s":0 and "waiting_time_veh_e_w":0, on both initialization and reset counters to zero on "data" variable.

# Initialize basic data schema
data = {"tl_id": "c1", "tl_program": self._tl_program, "passing_veh_n_s": 0, "passing_veh_e_w": 0, "waiting_time_veh_n_s":0, "waiting_time_veh_e_w": 0}
..............
# Reset counters
data['passing_veh_n_s'] = 0
data['passing_veh_e_w'] = 0
data['waiting_time_veh_n_s'] = 0
data['waiting_time_veh_e_w'] = 0
JoserraLP commented 2 years ago

Besides, the sleep time in the "main.py" is not enough to deploy all the architecture, it should be changed to 300 seconds, instead of the 120 seconds that are defined.