com.anji.roshambo
Class RoshamboPlayerTranscriber

java.lang.Object
  extended bycom.anji.roshambo.RoshamboPlayerTranscriber
All Implemented Interfaces:
Configurable, PlayerTranscriber, Transcriber

public class RoshamboPlayerTranscriber
extends java.lang.Object
implements PlayerTranscriber, Configurable

Constructs RoshamboPlayer objects from AniNet objects transcribed from Chromosome objects.

Author:
Philip Tucker

Field Summary
static java.lang.String DETERMINISTIC_KEY
          public visibility for test
static java.lang.String HISTORY_SIZE_KEY
          public visibility for test
static java.lang.String SCANNING_WINDOW_SIZE_KEY
          public visibility for test
 
Constructor Summary
RoshamboPlayerTranscriber()
          default constructor - should be followed by call to init()
 
Method Summary
 java.lang.Class getPhenotypeClass()
           
 void init(Properties aProps)
           
 Player newPlayer(Chromosome genotype)
           
 RoshamboPlayer newRoshamboPlayer(Chromosome genotype)
          convenience method to return specific type
 java.lang.Object transcribe(Chromosome genotype)
          Sub-classes must implement this method to convert the genotype to a phenotype.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DETERMINISTIC_KEY

public static final java.lang.String DETERMINISTIC_KEY
public visibility for test

See Also:
Constant Field Values

HISTORY_SIZE_KEY

public static final java.lang.String HISTORY_SIZE_KEY
public visibility for test

See Also:
Constant Field Values

SCANNING_WINDOW_SIZE_KEY

public static final java.lang.String SCANNING_WINDOW_SIZE_KEY
public visibility for test

See Also:
Constant Field Values
Constructor Detail

RoshamboPlayerTranscriber

public RoshamboPlayerTranscriber()
default constructor - should be followed by call to init()

Method Detail

newRoshamboPlayer

public RoshamboPlayer newRoshamboPlayer(Chromosome genotype)
                                 throws TranscriberException
convenience method to return specific type

Parameters:
genotype -
Returns:
new RoshamboPlayer object
Throws:
TranscriberException

newPlayer

public Player newPlayer(Chromosome genotype)
                 throws TranscriberException
Specified by:
newPlayer in interface PlayerTranscriber
Parameters:
genotype - chromosome to transcribe
Returns:
Player phenotype
Throws:
TranscriberException
See Also:
PlayerTranscriber.newPlayer(org.jgap.Chromosome), newRoshamboPlayer(Chromosome)

transcribe

public java.lang.Object transcribe(Chromosome genotype)
                            throws TranscriberException
Description copied from interface: Transcriber
Sub-classes must implement this method to convert the genotype to a phenotype.

Specified by:
transcribe in interface Transcriber
Parameters:
genotype - chromosome to transcribe
Returns:
phenotype
Throws:
TranscriberException
See Also:
Transcriber.transcribe(org.jgap.Chromosome), newRoshamboPlayer(Chromosome)

getPhenotypeClass

public java.lang.Class getPhenotypeClass()
Specified by:
getPhenotypeClass in interface Transcriber
Returns:
class of phenotype returned by transcribe()
See Also:
Transcriber.getPhenotypeClass()

init

public void init(Properties aProps)
          throws java.lang.Exception
Specified by:
init in interface Configurable
Parameters:
aProps - configuration parameters
Throws:
java.lang.Exception
See Also:
Configurable.init(com.anji.util.Properties)