cityflow-project / CityFlow

A Multi-Agent Reinforcement Learning Environment for Large Scale City Traffic Scenario
https://cityflow-project.github.io
Apache License 2.0
784 stars 171 forks source link

Manhattan data can't run in anon_env in the display code of the MPlight project #164

Closed WaterFountain-Jack closed 7 months ago

WaterFountain-Jack commented 1 year ago

Sorry to bother you again!

I met a problom is that when I run env.reset() after set the "roadnetFile": "manhattan.json" and "flowFile": "manhattan_7846.json" (It can run) ,but an error is reported : Traceback (most recent call last): File "/tmp/pycharm_project_764/test_script.py", line 71, in env.reset() File "/tmp/pycharm_project_764/anon_env.py", line 751, in reset self.traffic_light_node_dict = self._adjacency_extraction() File "/tmp/pycharm_project_764/anon_env.py", line 1440, in _adjacency_extraction if edge_id_dict[road_id]['to'] not in traffic_light_node_dict.keys(): KeyError: '100522479_0'

By the way I also found that I can't get some attributes like:NUM_ROW,NUM_COL from manhattan data.

Can u give my some suggestions to solve it,please? Maybe should I wirte a new anon_env.py or modify some original code or use the sumo enviorment?

Thank u very very much!!!!!

zhc134 commented 1 year ago

try to change the code in AnonEnv.reset, use CityFlow's reset API. also, the author of MPLight might be more familiar with the AnonEnv class, you can create a issue there

WaterFountain-Jack commented 1 year ago

Ok,thank you for your answer!!