net.sourceforge.cilib.games.game.tictactoe
Class TTTStateInputStrategy
java.lang.Object
net.sourceforge.cilib.games.agent.neural.NeuralStateInputStrategy
net.sourceforge.cilib.games.game.tictactoe.TTTStateInputStrategy
public class TTTStateInputStrategy
- extends NeuralStateInputStrategy
This class is used to give a Neural Network a Tic Tac Toe game.
For this NeuralStateInputStrategy the Neural Network needs to have a number of inputs equals to the number of cells in the game.
Each input is then given to the network depending if the cell is occupied by the current player, the opponent player or if its empty.
- Author:
- leo
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TTTStateInputStrategy
public TTTStateInputStrategy()
amountInputs
public int amountInputs()
- get the amount of inputs that the Neural Network should have based on this input strategy
- Specified by:
amountInputs
in class NeuralStateInputStrategy
- Returns:
- the input count
getNeuralInputArray
public Vector getNeuralInputArray(NeuralAgent currentPlayer,
Game state)
- Get an input vector for the given game state
- Specified by:
getNeuralInputArray
in class NeuralStateInputStrategy
- Parameters:
currentPlayer
- the agent represented by the Neural Networkstate
- the current game state
- Returns:
- the input vector
Copyright © 2009 CIRG. All Rights Reserved.