com.anji.ttt
Class TttRotatingNeuralNetPlayer

java.lang.Object
  extended by com.anji.ttt.TttRotatingNeuralNetPlayer
All Implemented Interfaces:
Player, BoardPlayer

public class TttRotatingNeuralNetPlayer
extends java.lang.Object
implements BoardPlayer

Tic-Tac-Toe subject whose moves are determined by a 10x9 neural network which is shown the board 4 times, once for each rotation in the 4 cardinal directions.

Author:
Derek James

Constructor Summary
TttRotatingNeuralNetPlayer(Activator anActivator)
          Create subject whose "brains" are anActivator, 10 inputs and 9 outputs.
 
Method Summary
 java.lang.String getPlayerId()
           
 int move(int[] boardState)
          Iteratively pass boardState rotated in each of the for cardinal directions, as input to activator and place token in empty space corresponding to strongest output.
 void reset()
          reset player state; after a call to reset, the player should be in the same state as it was when created; i.e., it has no memory of previous games played
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TttRotatingNeuralNetPlayer

public TttRotatingNeuralNetPlayer(Activator anActivator)
Create subject whose "brains" are anActivator, 10 inputs and 9 outputs.

Parameters:
anActivator -
Method Detail

getPlayerId

public java.lang.String getPlayerId()
Specified by:
getPlayerId in interface Player
Returns:
String unique ID
See Also:
Player.getPlayerId()

move

public int move(int[] boardState)
Iteratively pass boardState rotated in each of the for cardinal directions, as input to activator and place token in empty space corresponding to strongest output.

Specified by:
move in interface BoardPlayer
Parameters:
boardState -
Returns:
next move
See Also:
BoardPlayer.move(int[])

reset

public void reset()
Description copied from interface: Player
reset player state; after a call to reset, the player should be in the same state as it was when created; i.e., it has no memory of previous games played

Specified by:
reset in interface Player
See Also:
Player.reset()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()