Skip to content

Instantly share code, notes, and snippets.

@SamVanhoutte
SamVanhoutte / cliff-states.py
Created April 26, 2022 12:41
Reinforcement learning cliff-v0 states
# function that takes the action and outputs state + reward
def make_step(step, episode_reward, cliff):
new_state, reward, done, _ = cliff.step(step)
print(f'New state {new_state} with extra award {reward} to total {episode_reward}')
cliff.render()
return episode_reward + reward
# walk the entire grid
env = gym.make('cliff-v0')
state = env.reset()