CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

75 stars 40 forks source link

Some mistakes when loading my own flow txt data(ndexError: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)) #27

Open wangzelong0663 opened 3 years ago

wangzelong0663 commented 3 years ago

When I set the flow_1x1.txt only with the four lines data like what the image shows below: image Then the except from the CBEngine.py happend: /CBEngine/envs/CBEngine.py", line 168, in step self.eng.next_step() IndexError: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)

The image road of the map is below: image The 1 2 1just means the routes of the vehicle is from road 1 -->road 2 --> road 1

And when I set the flow_1x1.tx only with the text image below: image

It can run without all mistake, just add the 2 to 1 2 1 2 that means the routes of the vehicle is from road 1 -->road 2 --> road 1-->road2 What causes this except above?

And there is any suggestions or rules that I should obey when I want to generate my own flow data? Bacause the mistake /CBEngine/envs/CBEngine.py", line 168, in step self.eng.next_step() IndexError: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0) also happen when I load my own generating flow_round2.txt data.

zhyliu00 commented 3 years ago

Thanks for your comment. The problem in readme.md may be helpful.

wangzelong0663 commented 3 years ago

Thanks for your comment. The problem in readme.md may be helpful.

Thanks for your reply. I think the problem may be caused by my own flow.txt data, there must be some rule that I miss to produce my own data.Could you provide some python scripts or give me some suggestions to product the flow data?

And I still cann't understand why the flow_1x1.txt with the content below cause the except

CBEngine/envs/CBEngine.py", line 168, in step self.eng.next_step() IndexError: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)

image

while just change the content of the flow_1x1.txt to the image below, justing adding 2 to the fourth line and change the 3 to 4 on the third line,it can run without any mistake. So maybe there is some rule to product the routes that I miss image

gjzheng93 commented 3 years ago

can you please send the road file to us?

Kanstarry9T commented 3 years ago

About create your own flow.txt data, we will release a python script sooner for your convenience. Thanks for your comments.

wangzelong0663 commented 3 years ago

can you please send the road file to us?

The road file is the roadnet_1x1.txt.

Kanstarry9T commented 3 years ago

Please use the roadnet_round2.txt for the second round (qualification phase), the roadnet_1x1.txt is a different road network that is used for previous stage.