CityBrainChallenge / KDDCup2021-CityBrainChallenge-starter-kit

75 stars 40 forks source link

question about the observation #46

Closed KK666-AI closed 3 years ago

KK666-AI commented 3 years ago

Dear author,

I notice that the observation contains two types of features: lane_speed and lane_vehicle_num for each agent. Each feature has 24 numerical values. The demo code of DQN extracts state using the following code:

def extract_state(obs_n, ob_length):
    state = {}
    for key, val in obs_n.items():
        agent_id = int(key.split('_')[0])  # e.g., key=0_lane_speed
        feature = key.split('_')[1]  # todo
        if agent_id not in state.keys():
            state[agent_id] = {}
        val = val[1:]
        while len(val) < ob_length:
            val.append(0)
        state[agent_id][feature] = val

    return state

I think there is a bug here. Specifically, only one type of features is used.

Kuangqi927 commented 3 years ago

I don't think that is a bug. Anyone could design their own state and reward

KK666-AI commented 3 years ago

ok, i see. this explanation also make sense.