|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.module.Module | +--org.moyoman.module.random.randomimpl.RandomImpl
This module implements the Random interface. It rates all legal moves, as well as providing functionality for choosing 1 of N randomly.
Field Summary | |
private static float |
conf
The confidence in the ratings of this module. |
private static DebugType[] |
dt
The debug types that this module supports. |
private boolean |
isGenerated
|
private ModuleType[] |
mt
The modules that this module requires. |
private static Random |
rand
The Java Random class. |
private RatedMove[] |
ratedMoves
The rated moves for this module. |
private static ServerConfig |
sc
The ServerConfig singleton. |
Fields inherited from class org.moyoman.module.Module |
|
Fields inherited from interface org.moyoman.module.random.Random |
CONFIDENCE |
Constructor Summary | |
RandomImpl(GameId id,
ModuleName name)
Create the RandomImpl object. |
Method Summary | |
Object |
clone()
Override the Object.clone() method. |
void |
generateMove(Module[] modules)
Generate the rated moves. |
Debug[] |
getDebugInformation(DebugType[] types)
Get the debug information for this module. |
DebugType[] |
getDebugTypes()
Get the debug types that this module supports. |
RatedMove[] |
getMoves()
Get the rated moves for this module. |
short |
getRandomShort(short total)
This method returns a number between 0 and total - 1. |
ModuleType[] |
getRequiredModuleList()
Get the modules that this module requires. |
void |
makeMove(Move move,
Module[] modules)
Update this module with 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 |
private static Random rand
private static ServerConfig sc
private static float conf
private ModuleType[] mt
private RatedMove[] ratedMoves
private boolean isGenerated
private static DebugType[] dt
Constructor Detail |
public RandomImpl(GameId id, ModuleName name) throws InternalErrorException
id
- The game id.name
- The name of this module.
InternalErrorException
- Thrown if an error occurs for any reason.Method Detail |
public short getRandomShort(short total)
getRandomShort
in interface Random
total
- The number of choices.
public void generateMove(Module[] modules)
generateMove
in class Module
modules
- The modules that this method uses.public Debug[] getDebugInformation(DebugType[] types)
getDebugInformation
in class Module
types
- The debug types that the caller can use.
public DebugType[] getDebugTypes()
getDebugTypes
in class Module
public RatedMove[] getMoves()
getMoves
in interface ModuleInterface
getMoves
in class Module
public ModuleType[] getRequiredModuleList()
getRequiredModuleList
in class Module
public void makeMove(Move move, Module[] modules)
makeMove
in class Module
move
- The last move made.modules
- The modules that this module requires.public Object clone()
clone
in interface ModuleInterface
clone
in class Module
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |