Code and Report at Github
Value Iteration, Policy Iteration, and Q-Learning agents that plan/learn to play 3x3 Tic-Tac-Toe game have been implemented that have been tested against each other and other rule-based agents given.
The other agents provided are named random,
aggressive, and defensive based on their behaviour.
Value Iteration: Value iteration is a technique that aids a learning agent in determining the optimal choices to be made by constantly revising its assessments of how good each state is based on the anticipated benefits of various actions.
Policy Iteration: In the policy iteration approach, a learning agent first assesses how effective its current strategy is, then improves the strategy by selectively choosing actions that provide greater predicted rewards. It repeats this process until it discovers the optimum strategy.
Q-learning: In this, an agent may discover the optimum course of action to follow in various circumstances by experimenting with many options, evaluating the rewards it obtains, and updating its understanding of the anticipated rewards of each action-state combination.
Results
Value Iteration Agent
| Agent | Wins | Losses | Draws |
| Random Agent | 50 | 0 | 0 |
| Aggressive Agent | 50 | 0 | 0 |
| Defensive Agent | 33 | 0 | 17 |
Policy Iteration Agent
| Agent | Wins | Losses | Draws |
| Random Agent | 50 | 0 | 0 |
| Aggressive Agent | 50 | 0 | 0 |
| Defensive Agent | 47 | 0 | 3 |
Q-Learning Agent
| Agent | Wins | Losses | Draws |
| Random Agent | 50 | 0 | 0 |
| Aggressive Agent | 50 | 0 | 0 |
| Defensive Agent | 38 | 0 | 12 |