강화 학습
-
1. Game ruleThere are 100 cardsTwo playersplayer-0 (AI), player-1 (human)Player-turn sequence: player0-player1-player0-player1- ….Each player will draw up to 3 cards in his turnThe player who draws the 100th card (the last card) wins! 2. Gameplay# of drawn cards = 0, Player-0 draws 3 cards# of drawn cards = 3, Player-1 draws 1 card# of drawn cards = 4, Player-0 draws 1 card# of drawn cards = 5, ..
Last Card Game1. Game ruleThere are 100 cardsTwo playersplayer-0 (AI), player-1 (human)Player-turn sequence: player0-player1-player0-player1- ….Each player will draw up to 3 cards in his turnThe player who draws the 100th card (the last card) wins! 2. Gameplay# of drawn cards = 0, Player-0 draws 3 cards# of drawn cards = 3, Player-1 draws 1 card# of drawn cards = 4, Player-0 draws 1 card# of drawn cards = 5, ..
2024.09.10 -
1. DP using greedyfrom pyamaze import maze, agentimport numpy as np# Load the Mazesize = 5m=maze(size,size)m.CreateMaze(loadMaze="maze.csv")# create the environment modelstates = list(m.maze_map.keys())actions = ['E','N', 'W', 'S']# define how an action changes a statedef step(state, action): x, y = state if action=='E': y += 1 elif action=='W': y -= 1 elif action=='N':..
Solving Maze using Reinforcement Learning1. DP using greedyfrom pyamaze import maze, agentimport numpy as np# Load the Mazesize = 5m=maze(size,size)m.CreateMaze(loadMaze="maze.csv")# create the environment modelstates = list(m.maze_map.keys())actions = ['E','N', 'W', 'S']# define how an action changes a statedef step(state, action): x, y = state if action=='E': y += 1 elif action=='W': y -= 1 elif action=='N':..
2024.09.10