net.sourceforge.cilib.games.game.tictactoe
Class TTTStateInputStrategy

java.lang.Object
  extended by net.sourceforge.cilib.games.agent.neural.NeuralStateInputStrategy
      extended by 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

Constructor Summary
TTTStateInputStrategy()
           
 
Method Summary
 int amountInputs()
          get the amount of inputs that the Neural Network should have based on this input strategy
 Vector getNeuralInputArray(NeuralAgent currentPlayer, Game state)
          Get an input vector for the given game state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TTTStateInputStrategy

public TTTStateInputStrategy()
Method Detail

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 Network
state - the current game state
Returns:
the input vector


Copyright © 2009 CIRG. All Rights Reserved.