mardi 25 juillet 2023

mountain car with random agent

I am evaluating 'env = gym.make('MountainCar-v0', render_mode='rgb_array')' on random agent and getting 100% success rate that is weired can you please guide me on this.

Means always get car position greater than 0.5 which is the goal.

Code:

env = gym.make('MountainCar-v0', render_mode='rgb_array')
state, _ = env.reset()
max_position = -99
done = False
while not done:
    action = env.action_space.sample()
    next_state, reward, done, trun, info = env.step(action)
    
    if next_state[0] > max_position:
        max_position = next_state[0]
         
print(next_state[0], max_position)

0.50212365 0.50212365

I compared with other problems they are getting 0% success rate with random agent




Aucun commentaire:

Enregistrer un commentaire