|
|||||||||||
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.fuseki.simplefuseki.SimpleFuseki
This module implements the Fuseki interface. It is responsible for evaluating moves in the opening.
Field Summary | |
private static DebugType[] |
dt
The debug types that this module supports. |
private boolean |
isFusekiOver
If set, then no more work remains to be done by this module. |
private boolean |
isGenerated
This flag is used to determine when to clear variables set by generateMove(). |
private ModuleType[] |
mt
The modules that this module requires. |
private static HashMap |
points
The key is a Point object, and the value is an ArrayList containing Point objects. |
private RatedMove[] |
rm
The moves that were rated by this module. |
Fields inherited from class org.moyoman.module.Module |
|
Fields inherited from interface org.moyoman.module.fuseki.Fuseki |
CONFIDENCE |
Constructor Summary | |
SimpleFuseki(GameId id,
ModuleName name)
Create the SimpleFuseki object. |
Method Summary | |
private void |
addCornerMoves(short moveNumber,
Color color,
Point pt,
Set set)
Rate different corner moves in the empty corner. |
private static void |
addPoint(Point pt1,
Point pt2)
Add a pair of points into the points HashMap. |
Object |
clone()
Clone the module. |
void |
generateMove(Module[] modules)
Generate the move for this module. |
private HashSet |
getCornerMoves(short moveNumber,
Color color,
Geometry geo)
Get rated moves for all moves in empty corners. |
Debug[] |
getDebugInformation(DebugType[] types)
Return the debug information for this module. |
DebugType[] |
getDebugTypes()
Return the types of debug information that this module supports. |
RatedMove[] |
getMoves()
Return the moves generated by the module. |
private RatedMove |
getRatedMove(Point pt,
Board board)
Create a RatedMove object from a point. |
ModuleType[] |
getRequiredModuleList()
Return the modules that this module requires to perform its task. |
private void |
getShimaris(Board board,
Set moves)
Find any moves which would make shimaris, and rate them. |
private void |
getSideExtensions(Board board,
Geometry geo,
Set moves)
Find good points along the side, and add the rated moves to the set.. |
private boolean |
isEmpty(Board board,
int distance,
Point pt)
Determine if the specified corner is empty except for the single point. |
void |
makeMove(Move move,
Module[] modules)
Update the internal data structures of this module with the new move. |
private static void |
setPoints()
Read in the shimari combinations from the data file and set the points HashMap. |
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 DebugType[] dt
private static HashMap points
private ModuleType[] mt
private RatedMove[] rm
private boolean isGenerated
private boolean isFusekiOver
Constructor Detail |
public SimpleFuseki(GameId id, ModuleName name) throws InternalErrorException
id
- The id of the game.name
- The name of this module.
InternalErrorException
- Thrown if the operation fails for any reason.Method Detail |
private static void setPoints()
private static void addPoint(Point pt1, Point pt2)
pt1
- The keypt2
- The value, which is placed in an ArrayList.public void generateMove(Module[] modules)
generateMove
in class Module
modules
- An array of modules which this module needs
in order to perform its work. Those modules reflect the
current state of the board but are copies of the actual modules,
so this method is free to manipulate them.private void getShimaris(Board board, Set moves)
board
- The Board module.moves
- The new rated moves are added to this Set.private boolean isEmpty(Board board, int distance, Point pt)
board
- The Board module.distance
- The number of rows and columns to check out from the corner.pt
- The single point that is allowed to contain a stone.
private RatedMove getRatedMove(Point pt, Board board)
pt
- The point to be made into a rated move.board
- The Board module.
private void getSideExtensions(Board board, Geometry geo, Set moves)
board
- The Board module.geo
- The Geometry module.moves
- The Set to which the rated moves are to be added.private HashSet getCornerMoves(short moveNumber, Color color, Geometry geo)
moveNumber
- the number of the next move.color
- The color of the side to move next.geo
- The Geometry module.
private void addCornerMoves(short moveNumber, Color color, Point pt, Set set)
moveNumber
- The number of the next move.color
- The color of the next move.pt
- The corner pointset
- The set to which is to be added the RatedMove objects.public Debug[] getDebugInformation(DebugType[] types)
getDebugInformation
in class Module
types
- Only return a subset of the debug types in this array.
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 move that was just made.modules
- The modules that this method needs to perform its job.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 |