|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.moyoman.module.geometry.geometryimpl.NewGroupMoveGenerator
This class rates various moves that create a new group. Responsibilities of this class include determining whether new groups should be formed as well as which moves to make in creating new groups.
| Field Summary | |
private static short |
CENTER
Symbolic constant referring to the center. |
private static short |
CORNER
Symbolic constant referring to the corner. |
private GeometryMoveGenerator |
gmg
|
private static short |
SIDE
Symbolic constant referring to the side. |
| Constructor Summary | |
(package private) |
NewGroupMoveGenerator()
|
| Method Summary | |
private int |
computeDistance(Stone st,
SingleLooseGroup slg)
Find the square of the distance to the closest stone in the group from the given stone. |
protected RatedMove[] |
evaluate(Board b,
LooseGroups l,
GeometryImpl geo,
Stone[] stones)
Evaluate the possible moves. |
private Stone[] |
filter(Board b,
LooseGroups l,
Geometry geo)
Find possible moves which are not obviously bad. |
RatedMove[] |
getMoves(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg)
Get the rated moves. |
private short |
getStatus(Stone st,
int distance)
Determine whether the stone is closest to the corner, side or center. |
private boolean |
tooClose(Point pt1,
Point pt2)
Determine if the two points are less than a two space extension apart. |
private boolean |
wasOpponentWeakened(Geometry geo,
Stone st)
Determine if the given move weakens any opponents groups. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final short CORNER
private static final short SIDE
private static final short CENTER
private GeometryMoveGenerator gmg
| Constructor Detail |
NewGroupMoveGenerator()
| Method Detail |
public RatedMove[] getMoves(Board b,
LooseGroups l,
GeometryImpl geo,
GeometryMoveGenerator gmg)
getMoves in interface GeometryStrategyb - The Board module.l - The LooseGroups module.geo - The GeometryImpl module.
private Stone[] filter(Board b,
LooseGroups l,
Geometry geo)
b - The Board module.l - The LooseGroups module.geo - The Geometry module.
private boolean tooClose(Point pt1,
Point pt2)
pt1 - One of the points.pt2 - The other point.
protected RatedMove[] evaluate(Board b,
LooseGroups l,
GeometryImpl geo,
Stone[] stones)
b - The Board object.l - The LooseGroups object.geo - The Geometry object.stones - The possible moves to be evaluated.
private int computeDistance(Stone st,
SingleLooseGroup slg)
st - The stone in question.slg - The loose group in question.
private short getStatus(Stone st,
int distance)
st - The stone in question.distance - The distance to check for a side or corner.
private boolean wasOpponentWeakened(Geometry geo,
Stone st)
geo - The Geometry module.st - The stone in question.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||