|
|||||||||||
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.tactics.simpletactics.SimpleTactics
This module implements the Endgame interface. It is responsible for finding sequences of moves at the end of the game.
Field Summary | |
private Color |
currentColor
|
private static DebugType[] |
dt
The debug types that this module supports. |
private boolean |
isGenerated
This flag is used to determine when to clear variables set by generateMove(). |
private Board |
lastBoard
The last board obtained from generateMove(). |
private Groups |
lastGroups
The last groups obtained from generateMove(). |
private MoveDescriptorForest |
mdf
The MoveDescriptorForest object containing sequences of moves. |
private ModuleType[] |
mt
The modules that this module requires. |
private RatedMove[] |
rm
The moves that were rated by this module. |
private boolean |
sequenceFlag
This flag is used to determine if a call to getSequences() is valid. |
Fields inherited from class org.moyoman.module.Module |
|
Fields inherited from interface org.moyoman.module.tactics.Tactics |
CONFIDENCE |
Constructor Summary | |
SimpleTactics(GameId id,
ModuleName name)
Create the SimpleTactics object. |
Method Summary | |
Object |
clone()
Clone the module. |
private void |
generateMDF()
Generate the MoveDescriptorForest object describing sequences of moves. |
void |
generateMove(Module[] modules)
Generate the move for this module. |
private void |
generateRatedMoves(Board board,
Groups groups)
Generate moves based on liberties. |
MoveDescriptorForest |
getCurrentPlayerKoThreats()
Get sequences of moves where the current player makes the first two moves. |
MoveDescriptorForest |
getCurrentPlayerSequences()
Get sequences of tactical moves for the current player. |
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. |
MoveDescriptorForest |
getOpponentPlayerKoThreats()
Get sequences of moves where the opponent player makes the first two moves. |
MoveDescriptorForest |
getOpponentPlayerSequences()
Get sequences of tactical moves if the opponent plays first. |
ModuleType[] |
getRequiredModuleList()
Return the modules that this module requires to perform its task. |
boolean |
isMoveUrgent(SingleGroup sg)
Determine if the group is stable, or if another move is required. |
boolean |
isMoveUrgent(SingleLooseGroup slg)
Determine if the loose group is stable, or if another move is required. |
void |
makeMove(Move move,
Module[] modules)
Update the internal data structures of this module with the new move. |
void |
setImportantStones(Stone[] stones)
Currently, SimpleTactics does nothing with this information. |
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 Board lastBoard
private Groups lastGroups
private MoveDescriptorForest mdf
private boolean isGenerated
private boolean sequenceFlag
private Color currentColor
Constructor Detail |
public SimpleTactics(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 generateRatedMoves(Board board, Groups groups)
board
- The Board module.groups
- The Groups module.private void generateMDF()
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 MoveDescriptorForest getCurrentPlayerSequences() throws NoSuchDataException
getCurrentPlayerSequences
in interface Tactics
NoSuchDataException
- Thrown if the information is not available.public MoveDescriptorForest getCurrentPlayerKoThreats() throws NoSuchDataException
Tactics
getCurrentPlayerKoThreats
in interface Tactics
NoSuchDataException
public MoveDescriptorForest getOpponentPlayerKoThreats() throws NoSuchDataException
Tactics
getOpponentPlayerKoThreats
in interface Tactics
NoSuchDataException
public MoveDescriptorForest getOpponentPlayerSequences() throws NoSuchDataException
getOpponentPlayerSequences
in interface Tactics
NoSuchDataException
- Thrown if the information is not available.public void setImportantStones(Stone[] stones)
setImportantStones
in interface Tactics
stones
- The stones which are important.public boolean isMoveUrgent(SingleGroup sg)
Tactics
isMoveUrgent
in interface Tactics
sg
- The group in question.
public boolean isMoveUrgent(SingleLooseGroup slg)
Tactics
isMoveUrgent
in interface Tactics
slg
- The loose group in question.
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 |