CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

75 stars 40 forks source link

How to judge whether a car is in the road network? #36

Closed remember08 closed 3 years ago

remember08 commented 3 years ago

In info_step xxx.log file, if a car drived out of the roadnet, "step" will describe the moment it left. Without "step", we don't know the precise time the car left. In fact, agent.py indeed don't know the time. CBEngine passed in obs['info'] to agent.py but without "step"? image A car leaved the roadnet for a very long time, its obs['info']: {'distance': [537.2222222222224], 'drivable': [374202.0], 'road': [3742.0], 'route': [3742.0], 'speed': [13.88888888888889], 'start_time': [0.0], 't_ff': [1638.1470000000002]} By the information above, How to judge whether the car is in the road network?

john9636 commented 3 years ago

Same for me.

Enoch2090 commented 3 years ago

Same, this is necessary

zhyliu00 commented 3 years ago

Thanks for your comment.

  1. The 'step' in log file "info_step *.json" is used to calculate the delay index. We check the vehicle information every 10 seconds. It means the last step the vehicle was last seen
  2. For agent.py , the "info" from env.step() is the current vehicles in roadnet. you can maintain your own data structure of the last step of vehicles.
zhyliu00 commented 3 years ago

For the granularity of 10 seconds, you can modify it in "report_log_rate" in simulator.cfg. But it will slow down the simulator.

remember08 commented 3 years ago

Thanks!