|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.moyoman.module.geometry.geometryimpl.GeometryMoveGenerator
This class is responsible for generating moves based on the geometric analysis of the board.
Field Summary | |
protected float |
CONFIDENCE
|
private int |
friendlyGroupNum
The total number of friendly groups. |
protected static int |
MAX_GROUPS
The maximum number of groups of the same color that can safely live. |
protected short |
moveNumber
The number of the move to be made next. |
private boolean |
newFlag
Only call NewGroupMoveGenerator if flag is true. |
private int |
opponentGroupNum
The total number of opponents group. |
Constructor Summary | |
(package private) |
GeometryMoveGenerator()
|
Method Summary | |
private void |
addMoves(ArrayList al,
RatedMove[] rm)
Put the moves from the RatedMove array into the ArrayList. |
private int |
calculateTotalGroups(Color col,
LooseGroups lg,
GeometryImpl geo)
Get the total number of groups of a given color. |
private void |
combineMoves(ArrayList al)
Combine all of the ratings for a given move into one rating. |
protected Set |
getBorderPoints(Board b,
GeometryImpl geo,
LooseGroups lg,
Color color,
Point[] points)
Return a subset of the points which are on the border of two groups of opposite color. |
protected int |
getDistance(Point pt1,
Point pt2)
Return the square of the euclidean distance between the two points. |
protected RatedMove[] |
getMoves(Board b,
LooseGroups lg,
GeometryImpl geo)
Get the rated moves. |
protected Set |
getPointsInConvexHullWithEdgePoints(LooseGroups lg,
GeometryImpl geo)
Get the points inside of the convex hull with associated edge points. |
protected RatedMove |
getRatedMove(Stone st,
float val)
Create a RatedMove object from teh stone and rating. |
protected int |
getTotalFriendlyGroups()
Get the total number of groups of the color to move next. |
protected int |
getTotalOpponentGroups()
Get the total number of groups of the opponent of the player to move next. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int MAX_GROUPS
protected short moveNumber
private int friendlyGroupNum
private int opponentGroupNum
private boolean newFlag
protected final float CONFIDENCE
Constructor Detail |
GeometryMoveGenerator()
Method Detail |
protected RatedMove[] getMoves(Board b, LooseGroups lg, GeometryImpl geo)
b
- The Board module.lg
- The LooseGroups module.geo
- The GeometryImpl module.
private void addMoves(ArrayList al, RatedMove[] rm)
rm
- The array containing the rated moves.al
- The ArrayList to add the moves to.private void combineMoves(ArrayList al)
al
- An ArrayList containing RatedMove objects, some of
which might be for the same move.protected RatedMove getRatedMove(Stone st, float val)
st
- The Stone to be rated.val
- The rating of the move.
protected int getDistance(Point pt1, Point pt2)
pt1
- One of the points.pt2
- The other point.
protected Set getBorderPoints(Board b, GeometryImpl geo, LooseGroups lg, Color color, Point[] points)
b
- The Board module.geo
- The GeometryImpl module.lg
- The LooseGroups module.color
- The color of the player to move.points
- The points being considered.
protected Set getPointsInConvexHullWithEdgePoints(LooseGroups lg, GeometryImpl geo)
lg
- The LooseGroups module.geo
- The GeometryImpl module.
private int calculateTotalGroups(Color col, LooseGroups lg, GeometryImpl geo)
col
- The color of groups being counted.lg
- The LooseGroups module.geo
- The GeometryImpl module.
protected int getTotalFriendlyGroups()
protected int getTotalOpponentGroups()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |