|
|||||||||||
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.fuseki.igofuseki.IgoFuseki
This module implements the Fuseki interface. It is responsible for evaluating moves in the opening.
Field Summary | |
private int |
absLine
value of the absolute lines on board. |
private int[] |
absTate
info of the absolute vertical line value. |
private int[] |
absYoko
info of the absolute horizontal line vlaue. |
private int[] |
absYokoTate
info of the absolute line value. |
private int |
actCnt
convinent variable. |
(package private) static int |
AKI
Value of the empty point. |
private int |
boardSize
Size of the board, the value maybe is always 19. |
private int[] |
col
Color info of the board (AKI/KURO/SIRO/EDGE). |
private boolean |
comKuro
True if com play at first. |
private int |
d1
variables to access neighbors. |
private int |
d11
variables to access neighbors. |
private int |
d111
variables to access neighbors. |
private int |
d117
variables to access neighbors. |
private int |
d118
variables to access neighbors. |
private int |
d17
variables to access neighbors. |
private int |
d18
variables to access neighbors. |
private int |
d2
variables to access neighbors. |
private int |
d22
variables to access neighbors. |
private int |
d222
variables to access neighbors. |
private int |
d225
variables to access neighbors. |
private int |
d226
variables to access neighbors. |
private int |
d25
variables to access neighbors. |
private int |
d26
variables to access neighbors. |
private int |
d3
variables to access neighbors. |
private int |
d33
variables to access neighbors. |
private int |
d333
variables to access neighbors. |
private int |
d336
variables to access neighbors. |
private int |
d338
variables to access neighbors. |
private int |
d36
variables to access neighbors. |
private int |
d38
variables to access neighbors. |
private int |
d4
variables to access neighbors. |
private int |
d44
variables to access neighbors. |
private int |
d444
variables to access neighbors. |
private int |
d445
variables to access neighbors. |
private int |
d447
variables to access neighbors. |
private int |
d45
variables to access neighbors. |
private int |
d47
variables to access neighbors. |
private int |
d5
variables to access neighbors. |
private int |
d55
variables to access neighbors. |
private int |
d555
variables to access neighbors. |
private int |
d6
variables to access neighbors. |
private int |
d66
variables to access neighbors. |
private int |
d666
variables to access neighbors. |
private int |
d7
variables to access neighbors. |
private int |
d77
variables to access neighbors. |
private int |
d777
variables to access neighbors. |
private int |
d8
variables to access neighbors. |
private int |
d88
variables to access neighbors. |
private int |
d888
variables to access neighbors. |
private int |
dFb
|
private int |
dHai
|
private static DebugType[] |
dt
The debug types that this module supports. |
private boolean[] |
ed
Array for proc. |
(package private) static int |
EDGE
Value of the boundary line. |
(package private) static int |
EDGE_M
Value of the boundary line for group. |
private int[][] |
gen
Index to access left-top corner. |
private int |
h1
|
private int |
h2
|
private int |
h3
|
private int |
h4
|
private int |
haiti
Count of stones put in advance. |
private int[][] |
his
Index to access left-bottom corner. |
(package private) static int |
IRO_KEI
Value of color exchange. |
private boolean |
isFusekiOver
If set, then no more work remains to be done by this module. |
private boolean |
isGenerated
This flag is used to determine when to clear variables set by generateMove(). |
private int[][][] |
jSeki
Array of JoSeki pattern data. |
private int |
kCnt
|
private int[] |
kd
info of the Stone's liberties. |
(package private) static int |
KURO
Value of the black stone. |
private boolean |
kuroSaki
True if the first move is black. |
private int[] |
md
info of the group. |
private int[][] |
mis
Index to access right-bottom coner. |
private int[][] |
miu
Index to access right-top corner. |
private int[] |
moves
Position of moves in the game. |
private ModuleType[] |
mt
The modules that this module requires. |
private int |
patCnt
|
private int |
pin
|
private int |
posLimit
index of the active limit. |
private int |
posStart
index of the first active point. |
private RatedMove[] |
rm
The moves that were rated by this module. |
(package private) static int |
SIRO
Value of the white stone. |
private int |
sizeBlk
convinent variable. |
private int |
sizeHan
convinent variable. |
private int |
sizeP1
convinent variable. |
private int |
tanMe
|
private int |
tanOp
|
private int[] |
tate
info of the vertical line value. |
private int[] |
td
info of the block. |
private int |
tekazu
Count of moves in the game. |
private int |
tenCnt
Total count of the points. |
private int[] |
yoko
info of the horizontal line value. |
private int[][][] |
ySumi
Array of AllBoard pattern data. |
Fields inherited from class org.moyoman.module.Module |
|
Fields inherited from interface org.moyoman.module.fuseki.Fuseki |
CONFIDENCE |
Constructor Summary | |
IgoFuseki(GameId id,
ModuleName name)
Create the IgoFuseki object. |
Method Summary | |
private void |
addCornerMoves(int pos,
VecInt vec)
add moves in the empty corner. |
private boolean |
addRated(short moveNumber,
Color color,
VecInt vec)
Return true if has moves to add to rm. |
private int |
arrIndex(String id)
Return the index of an array. |
private int |
ccTable(char c1,
char c2)
return positon from a move data. |
private int |
ccTable(String str)
return the positon of a move data. |
private void |
clearColor()
Clear color data. |
Object |
clone()
Clone the module. |
private void |
datMatch1(int[] arr,
VecInt vec)
Serach for pattern moves of 4 corner. |
private void |
dMatch2(int[] arr,
VecInt vec)
Search for pattern moves of corner. |
private boolean |
empty(int pos)
Return true if the position is empty. |
private boolean |
empty4(int pos)
Return true if the 4 neighbors are empty. |
private boolean |
empty8(int pos)
Return true if the 8 neighbors is empty. |
void |
generateMove(Module[] modules)
Generate the move for this module. |
private boolean |
getCornerMoves(short moveNumber,
Color color)
Get rated moves in empty corners. |
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. |
ModuleType[] |
getRequiredModuleList()
Return the modules that this module requires to perform its task. |
private void |
igoInit()
Initialize variables. |
private int |
igoPos(int moX,
int moY)
Return the position of Igo from Moyoman's (X,Y) coordinate. |
private boolean |
jMatch(short moveNumber,
Color color)
Get rated moves from JoSeki patterns. |
private void |
jMatch1(int[][] a,
VecInt vec)
Serach for moves of JoSeki pattern. |
private void |
loadPattern()
Load patterns |
private boolean |
lookAki(short moveNumber,
Color color)
Get rated moves from empty area. |
private void |
lookAki2(VecInt vec)
|
void |
makeMove(Move move,
Module[] modules)
Update the internal data structures of this module with the new move. |
private int |
moyaX(int pos)
Return the horizontal value from a position of Igo. |
private int |
moyaY(int pos)
Return the vertical value from a position of Igo. |
private void |
setBoardSize(int size)
set the size of board and related variables. |
private void |
setGameData(Board board)
Set the game's data. |
private void |
setHan(int s1,
int s2,
PatVec pt)
set boundary of the pattern. |
private void |
setJseki(String id,
String str)
set the data of JoSeki. |
private void |
setPatt(String id,
String str)
set the data of 4-corner patterns. |
private void |
setPattern(String str)
Set the patterns. |
private void |
setSub(int m,
boolean flag,
PatVec pt)
set sub array of the pattern. |
private boolean |
sumiMatch(short moveNumber,
Color color,
int index)
Get rated moves from 4-corner patterns. |
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 boolean isGenerated
private boolean isFusekiOver
static final int AKI
static final int KURO
static final int SIRO
static final int EDGE
static final int EDGE_M
static final int IRO_KEI
private int boardSize
private int[] col
private boolean[] ed
private int[] moves
private int tekazu
private int haiti
private boolean kuroSaki
private boolean comKuro
private int absLine
private int tenCnt
private int posStart
private int posLimit
private int d1
private int d2
private int d3
private int d4
private int d5
private int d6
private int d7
private int d8
private int d11
private int d22
private int d33
private int d44
private int d17
private int d18
private int d25
private int d26
private int d36
private int d38
private int d45
private int d47
private int d55
private int d66
private int d77
private int d88
private int d111
private int d222
private int d333
private int d444
private int d117
private int d118
private int d225
private int d226
private int d336
private int d338
private int d445
private int d447
private int d555
private int d666
private int d777
private int d888
private int[] kd
private int[] td
private int[] md
private int[] yoko
private int[] tate
private int[] absYoko
private int[] absTate
private int[] absYokoTate
private int sizeP1
private int sizeHan
private int sizeBlk
private int actCnt
private int[][] gen
private int[][] his
private int[][] miu
private int[][] mis
private int[][][] jSeki
private int[][][] ySumi
private int h1
private int h2
private int h3
private int h4
private int tanOp
private int tanMe
private int dFb
private int dHai
private int pin
private int patCnt
private int kCnt
Constructor Detail |
public IgoFuseki(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 boolean getCornerMoves(short moveNumber, Color color)
moveNumber
- the number of the next move.color
- The color of the side to move next.
private void addCornerMoves(int pos, VecInt vec)
pos
- Position of the corner star.vec
- Vector to store the moves.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
private void setGameData(Board board)
board
- The Board module.private void clearColor()
private void setBoardSize(int size)
size
- Size of the Board.private void igoInit()
private boolean empty(int pos)
pos
- Index of the position.private boolean empty4(int pos)
pos
- Index of the position.private boolean empty8(int pos)
pos
- Index of the Position.private int moyaX(int pos)
pos
- Index of the Position.private int moyaY(int pos)
pos
- Position of Igo.private int igoPos(int moX, int moY)
moX
- horizontal value of the Moyoman.moY
- vertical value of the Moyoman.private void loadPattern()
private void setPattern(String str)
str
- Pattern data.private void setJseki(String id, String str)
id
- ID of the patterns.str
- Data of the patterns.private void setPatt(String id, String str)
id
- ID of the patterns.str
- Data of the patterns.private int arrIndex(String id)
id
- ID of the pattern.private void setHan(int s1, int s2, PatVec pt)
s1
- one of the limit position.s2
- one of the limit position.pt
- pattern obj.private void setSub(int m, boolean flag, PatVec pt)
m
- Target position.flag
- Flag for pattenr type.pt
- Pattern obj.private int ccTable(char c1, char c2)
c1
- Char data of horizontal.c2
- Char data of vertical.private int ccTable(String str)
str
- data of the positionprivate boolean addRated(short moveNumber, Color color, VecInt vec)
moveNumber
- the number of the next move.color
- The color of the side to move next.vec
- Vector to store moves.private boolean jMatch(short moveNumber, Color color)
moveNumber
- the number of the next move.color
- The color of the side to move next.
private void jMatch1(int[][] a, VecInt vec)
a
- Array of pattern datavec
- Vector to store the matched moves.private void datMatch1(int[] arr, VecInt vec)
arr
- Array of pattern datavec
- Vector to store the matched moves.private boolean sumiMatch(short moveNumber, Color color, int index)
moveNumber
- the number of the next move.color
- The color of the side to move next.index
- Index of the pattern.
private void dMatch2(int[] arr, VecInt vec)
arr
- Array of pattern datavec
- Vector to store the matched moves.private boolean lookAki(short moveNumber, Color color)
moveNumber
- the number of the next move.color
- The color of the side to move next.
private void lookAki2(VecInt vec)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |