com.anji.gomoku
Class GomokuScanningNeuralNetPlayer

java.lang.Object
  extended bycom.anji.gomoku.GomokuScanningNeuralNetPlayer
All Implemented Interfaces:
BoardPlayer, Player

public class GomokuScanningNeuralNetPlayer
extends java.lang.Object
implements BoardPlayer

Gomoku subject whose moves are determined by a neural net. Neural net input is a 5x5 board grid plus bias clamped at 1. Output is 5x5 grid. Net is activated with all 5x5 grids on bard, and highest output of all activations corrsponding to a legal move is taken as the next move.

Author:
Derek James

Constructor Summary
GomokuScanningNeuralNetPlayer(Activator anActivator)
          Construct subject from neural net.
 
Method Summary
 java.lang.String getPlayerId()
           
 int move(int[] boardState)
          Feed board and bias to neural net, 1 5x5 grid at a time, get output, and translate it to a move.
 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

GomokuScanningNeuralNetPlayer

public GomokuScanningNeuralNetPlayer(Activator anActivator)
Construct subject from neural net.

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)
Feed board and bias to neural net, 1 5x5 grid at a time, get output, and translate it to a move.

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()
See Also:
Object.toString()