|
|||||||||||
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.shape.simpleshape.SimpleShape
This module implements the Shape interface. It is responsible for evaluating moves in the opening.
Field Summary | |
private RatedMove[] |
bosm
|
private RatedMove[] |
bsm
|
private static DebugType[] |
dt
The debug types that this module supports. |
private RatedMove[] |
gosm
|
private RatedMove[] |
gsm
|
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 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.shape.Shape |
CONFIDENCE |
Constructor Summary | |
SimpleShape(GameId id,
ModuleName name)
Create the SimpleShape object. |
Method Summary | |
private void |
addStoneIfInRange(ArrayList al,
Color color,
int x,
int y)
|
private boolean |
checkSpace(Board board,
Point pt1,
Point pt2,
boolean flag)
|
Object |
clone()
Clone the module. |
private RatedMove |
createRatedMove(Stone st,
Board board,
float rating)
|
private boolean |
evaluateSquare(Point pt1,
Point potential,
Color color,
Board board)
|
void |
generateMove(Module[] modules)
Generate the move for this module. |
RatedMove[] |
getBadShapeMoves()
|
Debug[] |
getDebugInformation(DebugType[] types)
Return the debug information for this module. |
DebugType[] |
getDebugTypes()
Return the types of debug information that this module supports. |
RatedMove[] |
getGoodShapeMoves()
|
RatedMove[] |
getMoves()
Return the moves generated by the module. |
private Stone[] |
getOffsetStones(Stone st,
int offset1,
int offset2)
Get all stones offset by the given amount from the given stone. |
RatedMove[] |
getOpponentsBadShapeMoves()
|
RatedMove[] |
getOpponentsGoodShapeMoves()
|
ModuleType[] |
getRequiredModuleList()
Return the modules that this module requires to perform its task. |
private boolean |
isAttachmentMatch(Stone st,
Board board)
|
private boolean |
isDiagonalMoveMatch(Stone st,
Board board)
|
private boolean |
isEmptyTriangleMatch(Stone st,
Board board)
|
private boolean |
isFieldMatch(Stone st,
Board board)
|
private boolean |
isKnightsMoveMatch(Stone st,
Board board)
|
private boolean |
isLargeKnightsMoveMatch(Stone st,
Board board)
|
private boolean |
isOneSpaceJumpMatch(Stone st,
Board board)
|
private boolean |
isTwoSpaceJumpMatch(Stone st,
Board board)
|
void |
makeMove(Move move,
Module[] modules)
Update the internal data structures of this module with the new move. |
private void |
setShapeMoves(Color color,
boolean isCurrentPlayer,
Board board)
Set the good and bad shape moves for the specified player. |
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 ModuleType[] mt
private RatedMove[] rm
private RatedMove[] gsm
private RatedMove[] bsm
private RatedMove[] gosm
private RatedMove[] bosm
private boolean isGenerated
Constructor Detail |
public SimpleShape(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 |
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 setShapeMoves(Color color, boolean isCurrentPlayer, Board board)
color
- The color of the player being analyzed.isCurrentPlayer
- If true, then the player to move, otherwise the opponent.board
- the Board module.private Stone[] getOffsetStones(Stone st, int offset1, int offset2)
st
- The stone in question.offset1
- The distance from the stone in one direction.offset2
- The distance from the stone in the other direction.
private void addStoneIfInRange(ArrayList al, Color color, int x, int y)
private boolean checkSpace(Board board, Point pt1, Point pt2, boolean flag)
private boolean isOneSpaceJumpMatch(Stone st, Board board)
private boolean isTwoSpaceJumpMatch(Stone st, Board board)
private boolean isDiagonalMoveMatch(Stone st, Board board)
private boolean isKnightsMoveMatch(Stone st, Board board)
private boolean isLargeKnightsMoveMatch(Stone st, Board board)
private boolean evaluateSquare(Point pt1, Point potential, Color color, Board board)
private boolean isEmptyTriangleMatch(Stone st, Board board)
private boolean isFieldMatch(Stone st, Board board)
private boolean isAttachmentMatch(Stone st, Board board)
private RatedMove createRatedMove(Stone st, Board board, float rating)
public RatedMove[] getGoodShapeMoves()
getGoodShapeMoves
in interface Shape
public RatedMove[] getBadShapeMoves()
getBadShapeMoves
in interface Shape
public RatedMove[] getOpponentsGoodShapeMoves()
getOpponentsGoodShapeMoves
in interface Shape
public RatedMove[] getOpponentsBadShapeMoves()
getOpponentsBadShapeMoves
in interface Shape
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 |