CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

75 stars 40 forks source link

question about the invalid phase and the empty road warning. #18

Closed wangzelong0663 closed 3 years ago

wangzelong0663 commented 3 years ago

result = self.eng.set_ttl_phase(agent_id,phase) if(result == -1 and self.warning_enable): print('Warnning: at step {} , agent {} switch to phase {} . Maybe empty road'.format(self.now_step,agent_id,phase))

My question what situation will the cause result to be -1? Bacause each action/phase has two choices,such as the action 1 below, for the cars in the lane 1 or 7, they all can move. Is the lane 16-18 don't exist or the lane 22-24 don't exist will the 'result=-1'?(at lease one of them) Or only both the lane 16-18 and the lane 22-24 don't exist will the 'result=-1'?(both?) Hope you can understand what I mean, thanks.

image

zhyliu00 commented 3 years ago

Thanks for your comment.

  1. For the result of _set_ttlphase(),it depends on the existence of the source lane, not the destination lane.
  2. When at least one of the source lane is -1, result will be -1
wangzelong0663 commented 3 years ago

Thanks for you reply. That means if the lane 7 is not existence, if the action phase is 1 or 7, the result will be -1 ?

And I have one more question that I want to confirm that the something about the order of the obs:

the observations_for_agent[agent_id]['lane'] is 24 dims, which stands for the vehicle nums of each lane, and the order of the observations_for_agent[agent_id]['lane'] is same to the order of the lanes' num order in the image showed above (from lane 1 to lane 24)? And if the lane 7 don't exist, observations_for_agent[agent_id]['lane'][6] will be -1?

wangzelong0663 commented 3 years ago

Sorry, I have one more question about this topic. If the lanes 16-18 don't exist, how the vehicles in the lane 9, 11, 1 move? Or the vehicles cann't run into the lane 9, 11, 1, and the vehicle num of lane 9, 11, 1 will be zero if the lanes 16-18 don't exist?

zhyliu00 commented 3 years ago

The vehicles usually won't run on 9,11,1 lanes unless this road is the last road of its route. You could refer to https://github.com/CityBrainChallenge/KDDCup2021-CityBrainChallenge-starter-kit/issues/17 Q4

zhyliu00 commented 3 years ago

Thanks for you reply. That means if the lane 7 is not existence, if the action phase is 1 or 7, the result will be -1 ?

And I have one more question that I want to confirm that the something about the order of the obs:

the observations_for_agent[agent_id]['lane'] is 24 dims, which stands for the vehicle nums of each lane, and the order of the observations_for_agent[agent_id]['lane'] is same to the order of the lanes' num order in the image showed above (from lane 1 to lane 24)? And if the lane 7 don't exist, observations_for_agent[agent_id]['lane'][6] will be -1?

  1. Yes
  2. Yes. But the observation_features doesn't contain 'lane'. Do you refer to 'lane_speed' or 'lane_vehicle_num'?
  3. observations_for_agent[agent_id]['lane_vehicle_num'][7] will be -1 because observations_for_agent[agent_id]['lane_vehicle_num'][0] is current step.
wangzelong0663 commented 3 years ago

I mean lane_vehicle_num and thanks for reply,