|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.moyoman.module.geometry.geometryimpl.ExpandGroupMoveGenerator
This class rates various moves which expand existing groups. It is responsible for determining whether to expand existing groups as well as which rating particular moves.
| Field Summary | |
private static int |
MAX_HOLES
|
| Constructor Summary | |
(package private) |
ExpandGroupMoveGenerator()
|
| Method Summary | |
private boolean |
boundingBoxClear(Board b,
Stone st1,
Stone st2)
Check the rectangular box formed by the two stones for opponents stones. |
private boolean |
closeEnough(Point pt1,
Point pt2,
GeometryImpl geo,
int totalNum,
int oppNum,
int maxGroups)
Determine if the two points are close enough. |
protected RatedMove[] |
evaluate(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg,
Stone[] stones)
Rate the possible moves. |
private Stone[] |
filter(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg)
Find possible good moves to evaluate. |
private void |
getAllGroupPoints(Board b,
ArrayList closestal,
SingleLooseGroup slg,
Point pt,
Set points,
Set holes)
Find all empty points which are holes in the wall of stones around an area. |
RatedMove[] |
getMoves(Board board,
LooseGroups lg,
GeometryImpl geo,
GeometryMoveGenerator gmg)
Get the rated moves for expanding groups. |
private short |
getNewPointTotal(Stone st,
Board b,
GeometryImpl geo)
Find the total number of empty points closest to this stone which were closest to the opponent. |
private void |
plugHoles(Board b,
Geometry geo,
LooseGroups l,
HashMap moves)
Find groups that are almost surrounding an area, and rate moves that close them off. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final int MAX_HOLES
| Constructor Detail |
ExpandGroupMoveGenerator()
| Method Detail |
public RatedMove[] getMoves(Board board,
LooseGroups lg,
GeometryImpl geo,
GeometryMoveGenerator gmg)
getMoves in interface GeometryStrategyboard - The Board module.lg - The LooseGroups module.geo - The GeometryImpl module.gmg - The GeometryMoveGenerator object.
private Stone[] filter(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg)
l - The LooseGroups module.geo - The GeometryImpl module.gmg - The GeometryMoveGenerator object.
protected RatedMove[] evaluate(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg,
Stone[] stones)
b - The Board module.l - The LooseGroups module.geo - The GeometryImpl module.stones - The possible moves to evaluate.
private void plugHoles(Board b,
Geometry geo,
LooseGroups l,
HashMap moves)
b - The Board module.geo - The GeometryImpl module.l - The LooseGroups module.moves - The key is a Stone, and the value is a RatedMove object.
private void getAllGroupPoints(Board b,
ArrayList closestal,
SingleLooseGroup slg,
Point pt,
Set points,
Set holes)
b - The Board module.closestal - An ArrayList, each member of which is a Point object.slg - The loose group in question.pt - The point currently being examined.points - Each member of this set is a point which has already been examined.holes - Each member of this set is a Point which is a hole that has been found.
private short getNewPointTotal(Stone st,
Board b,
GeometryImpl geo)
st - The stone in question.b - The Board module.geo - The GeometryImpl module.
private boolean closeEnough(Point pt1,
Point pt2,
GeometryImpl geo,
int totalNum,
int oppNum,
int maxGroups)
pt1 - One of the points.pt2 - The other point.geo - The GeometryImpl module.totalNum - The number of friendly loose groups.oppNum - The number of opponents loose groups.maxGroups - The maximum number of groups that are safe.
private boolean boundingBoxClear(Board b,
Stone st1,
Stone st2)
b - The Board module.st1 - One of the stones.st2 - The other stone.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||