org.moyoman.module.movegenerator.simplemovegenerator
Class SimpleMoveGenerator

java.lang.Object
  |
  +--org.moyoman.module.Module
        |
        +--org.moyoman.module.movegenerator.simplemovegenerator.SimpleMoveGenerator
All Implemented Interfaces:
Cloneable, Component, ModuleInterface, MoveGenerator, Serializable

public class SimpleMoveGenerator
extends Module
implements MoveGenerator

This module implements the MoveGenerator interface. It is responsible for taking the output of the other modules, and producing the next move.

See Also:
Serialized Form

Field Summary
private static DebugType[] dt
          The debug types that this module supports.
(package private)  boolean isGenerated
           
private static int MAX_MOVES
          The total number of rated moves that getMoves() will return.
private  MoveDescriptor move
          The move to be made.
private  ModuleType[] mt
          The modules that this module requires.
private  RatedMove[] ratedMoves
          The moves that are rated by this module.
 
Fields inherited from class org.moyoman.module.Module
 
Constructor Summary
SimpleMoveGenerator(GameId id, ModuleName name)
          Create the SimpleMoveGenerator object.
 
Method Summary
 Object clone()
          Override the Object.clone() method.
 void generateMove(Module[] modules)
          Generate the rated moves, and the next move.
 Debug[] getDebugInformation(DebugType[] types)
          Get the debug information for this module.
 DebugType[] getDebugTypes()
          Get the debug types that this module supports.
 MoveDescriptor getGeneratedMove()
          Get the generated move.
 RatedMove[] getMoves()
          Get the rated moves for this module.
 ModuleType[] getRequiredModuleList()
          Get the module types that this module requires.
 void makeMove(Move mv, Module[] modules)
          Make the move.
 
Methods inherited from class org.moyoman.module.Module
checkTime, create, createHelper, debug, error, error, fatal, fatal, getAllHelpers, getHelper, getId, getKomi, getModule, getModuleName, getScheduler, information, setTime, warning, warning
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.moyoman.module.ModuleInterface
getScheduler
 

Field Detail

MAX_MOVES

private static final int MAX_MOVES
The total number of rated moves that getMoves() will return.

See Also:
Constant Field Values

dt

private static DebugType[] dt
The debug types that this module supports.


mt

private ModuleType[] mt
The modules that this module requires.


move

private MoveDescriptor move
The move to be made.


ratedMoves

private RatedMove[] ratedMoves
The moves that are rated by this module.


isGenerated

boolean isGenerated
Constructor Detail

SimpleMoveGenerator

public SimpleMoveGenerator(GameId id,
                           ModuleName name)
                    throws InternalErrorException
Create the SimpleMoveGenerator object.

Parameters:
id - The id of the game.
name - The name of this module.
Throws:
InternalErrorException - Thrown if the operation fails for any reason.
Method Detail

getGeneratedMove

public MoveDescriptor getGeneratedMove()
Get the generated move.

Specified by:
getGeneratedMove in interface MoveGenerator
Returns:
A MoveDescriptor object.

generateMove

public void generateMove(Module[] modules)
Generate the rated moves, and the next move.

Specified by:
generateMove in class Module
Parameters:
modules - The modules that this module uses.

getDebugInformation

public Debug[] getDebugInformation(DebugType[] types)
Get the debug information for this module.

Specified by:
getDebugInformation in class Module
Parameters:
types - The debug types which the caller supports.
Returns:
An array of Debug objects.

getDebugTypes

public DebugType[] getDebugTypes()
Get the debug types that this module supports.

Specified by:
getDebugTypes in class Module
Returns:
An array of DebugType objects.

getMoves

public RatedMove[] getMoves()
Get the rated moves for this module.

Specified by:
getMoves in interface ModuleInterface
Specified by:
getMoves in class Module
Returns:
An array of RatedMove objects.

getRequiredModuleList

public ModuleType[] getRequiredModuleList()
Get the module types that this module requires.

Specified by:
getRequiredModuleList in class Module
Returns:
An array of ModuleType objects.

makeMove

public void makeMove(Move mv,
                     Module[] modules)
Make the move. No work needs to be done, just clear some variables set by generateMove().

Specified by:
makeMove in class Module
Parameters:
mv - The last move made.
modules - The modules that this module requires.

clone

public Object clone()
Override the Object.clone() method.

Specified by:
clone in interface ModuleInterface
Overrides:
clone in class Module
Returns:
A SimpleMoveGenerator object which is a clone of this one.