Migrate babysnake to retro_gamer's observation_function
BabySnake's tabular Q-learning exercise needs a small discrete state, not the flattened board encoding retro_gamer normally produces. Define get_state(game) in babysnake_env.py, returning a plain (agent_x, agent_y, food_x, food_y) tuple, and point babysnake's observation_function at it instead of declaring a character_set. Disable the on-screen state overlay so it doesn't clutter the terminal watch view.
This commit is contained in:
@@ -101,6 +101,7 @@ def create_game():
|
||||
},
|
||||
board_size=(bw, bh),
|
||||
framerate=6,
|
||||
show_state=False,
|
||||
)
|
||||
forager.position = (randint(0, bw - 1), randint(0, bh - 1))
|
||||
food.relocate(game)
|
||||
|
||||
Reference in New Issue
Block a user