com.anji.roshambo
Class AnjiNetScanningRoshamboPlayer

java.lang.Object
  extended by com.anji.roshambo.AnjiNetScanningRoshamboPlayer
All Implemented Interfaces:
RoshamboPlayer, IteratedPlayer, Player

public class AnjiNetScanningRoshamboPlayer
extends java.lang.Object
implements RoshamboPlayer

Author:
Philip Tucker

Field Summary
 
Fields inherited from interface com.anji.roshambo.RoshamboPlayer
DRAW, LOSS, PAPER, ROCK, SCISSORS, WIN
 
Constructor Summary
AnjiNetScanningRoshamboPlayer(AnjiNet aNet)
           
AnjiNetScanningRoshamboPlayer(AnjiNet aNet, int anActivationCycles)
           
AnjiNetScanningRoshamboPlayer(AnjiNet aNet, java.util.Random aRand)
           
AnjiNetScanningRoshamboPlayer(AnjiNet aNet, java.util.Random aRand, int anActivationCycles, int aHistorySize, int aScanningWindowSize)
          Must have at least 6 inputs.
 
Method Summary
 java.lang.String getAuthor()
           
 java.lang.String getPlayerId()
           
 int nextMove()
          Produce your next 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
 void reset(int aTrials)
          Initialize a new match against an unknown opponent.
 void storeMove(int aMove, int aScore)
          Store the opponent's choice and the outcome of the latest move.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnjiNetScanningRoshamboPlayer

public AnjiNetScanningRoshamboPlayer(AnjiNet aNet,
                                     java.util.Random aRand,
                                     int anActivationCycles,
                                     int aHistorySize,
                                     int aScanningWindowSize)
Must have at least 6 inputs. Inputs 0-2 correspond to rock, scissors, paper. Each move the network is activated with one of rock scissors or paer at 1.0 and the rest at 0.0. Input 3 corresponds to previous move results (WIN,LOSS, DRAW). Input 4 is hourglass, and input 5 is bias. Must have at least 3 outputs. Outputs 0-2 are rock, scissors, paper, values between 0 and 1 (inclusive) indicating affinity for each.

Parameters:
aNet -
aRand - if null, player deterministically chooses each move as the maximum output of the net; otherwise, each move is chosen as a weighted probability based on each output
anActivationCycles - number of cycles network is activated for each move
aHistorySize - number of previous moves to store
aScanningWindowSize - number of moves (from move history) input to net each cycle

AnjiNetScanningRoshamboPlayer

public AnjiNetScanningRoshamboPlayer(AnjiNet aNet)
Parameters:
aNet -
See Also:
AnjiNetScanningRoshamboPlayer(AnjiNet, int)

AnjiNetScanningRoshamboPlayer

public AnjiNetScanningRoshamboPlayer(AnjiNet aNet,
                                     java.util.Random aRand)
Parameters:
aNet -
aRand -
See Also:
AnjiNetScanningRoshamboPlayer(AnjiNet, Random, int, int, int)

AnjiNetScanningRoshamboPlayer

public AnjiNetScanningRoshamboPlayer(AnjiNet aNet,
                                     int anActivationCycles)
Parameters:
aNet -
anActivationCycles -
See Also:
AnjiNetScanningRoshamboPlayer(AnjiNet, Random, int, int, int)
Method Detail

reset

public void reset(int aTrials)
Description copied from interface: RoshamboPlayer
Initialize a new match against an unknown opponent. The length of the match is specified in the paramater "trials". This function is always called before any match is played.

Specified by:
reset in interface RoshamboPlayer
Specified by:
reset in interface IteratedPlayer
Parameters:
aTrials - number of iterations for current game; player will be reset again before playing another game
See Also:
RoshamboPlayer.reset(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()

storeMove

public void storeMove(int aMove,
                      int aScore)
Description copied from interface: RoshamboPlayer
Store the opponent's choice and the outcome of the latest move. This function is called after every move. move is one of ROCK, PAPER, SCISSORS. score is one of DRAW, WIN, LOSS.

Specified by:
storeMove in interface RoshamboPlayer
See Also:
RoshamboPlayer.storeMove(int, int)

nextMove

public int nextMove()
Description copied from interface: RoshamboPlayer
Produce your next move.

Specified by:
nextMove in interface RoshamboPlayer
Returns:
one of ROCK, PAPER, SISSORS
See Also:
RoshamboPlayer.nextMove()

getPlayerId

public java.lang.String getPlayerId()
Specified by:
getPlayerId in interface RoshamboPlayer
Specified by:
getPlayerId in interface Player
Returns:
the name (and version) of this subject.
See Also:
Player.getPlayerId()

toString

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

getAuthor

public java.lang.String getAuthor()
Specified by:
getAuthor in interface RoshamboPlayer
Returns:
the author's name of this subject.
See Also:
RoshamboPlayer.getAuthor()