RCS file: /home/arend/Go/gnugo-rsync/gnugo/doc/board.texi,v
retrieving revision 1.15
diff -u -p -r1.15 board.texi
|
|
|
|
| 71 | 71 | @group |
| 72 | 72 | |
| 73 | 73 | int board_size; |
| 74 | | Intersection board[MAXSIZE]; |
| | 74 | Intersection board[BOARDSIZE]; |
| 75 | 75 | int board_ko_pos; |
| 76 | 76 | |
| 77 | 77 | float komi; |
| 78 | 78 | int white_captured; |
| 79 | 79 | int black_captured; |
| 80 | 80 | |
| 81 | | Hash_data hashdata; |
| | 81 | Hash_data board_hash; |
| 82 | 82 | @end group |
| 83 | 83 | @end example |
| 84 | 84 | |
| 85 | | The description of the @code{Position} struct is applicable to these |
| | 85 | The description of the @code{board_state} struct is applicable to these |
| 86 | 86 | variables also, so we won't duplicate it here. All these variables are |
| 87 | 87 | globals for performance reasons. Behind these variables, there are a |
| 88 | 88 | number of other private data structures. These implement incremental |
| 89 | 89 | handling of strings, liberties and other properties |
| 90 | | (@pxref{Incremental Board}). The variable @code{hashdata} contains information |
| | 90 | (@pxref{Incremental Board}). The variable @code{board_hash} contains information |
| 91 | 91 | about the hash value for the current position (@pxref{Hashing}). |
| 92 | 92 | |
| 93 | 93 | These variables should never be manipulated directly, since they are |
| … |
… |
|
| 181 | 181 | #define NS (MAX_BOARD + 1) |
| 182 | 182 | #define WE 1 |
| 183 | 183 | #define SOUTH(pos) ((pos) + NS) |
| 184 | | #define WEST(pos) ((pos) - 1) |
| | 184 | #define WEST(pos) ((pos) - WE) |
| 185 | 185 | #define NORTH(pos) ((pos) - NS) |
| 186 | | #define EAST(pos) ((pos) + 1) |
| | 186 | #define EAST(pos) ((pos) + WE) |
| 187 | 187 | @end example |
| 188 | 188 | |
| 189 | 189 | There are also shorthand macros @code{SW}, @code{NW}, @code{NE}, |
| … |
… |
|
| 209 | 209 | often one computation is sufficient for 1D-coordinate where we would need |
| 210 | 210 | two with two 2D-coordinates: If we, for example, want to have the |
| 211 | 211 | coordinate of the upper right of @code{pos}, we can do this with |
| 212 | | @code{NORTH(EAST(pos))} instead of @code{(i+1, j-1)}. |
| | 212 | @code{NE(pos)} instead of @code{(i+1, j-1)}. |
| 213 | 213 | |
| 214 | 214 | @strong{Important}: The 2D coordinate @code{(-1,-1)}, which is used for |
| 215 | 215 | pass and sometimes to indicate no point, maps to the 1D coordinate |
| … |
… |
|
| 240 | 240 | a point on the board. |
| 241 | 241 | |
| 242 | 242 | Often one wants to traverse the board, carrying out some function |
| 243 | | at every vertex. Here are two possible ways of doing this: |
| 244 | | |
| 245 | | @example |
| 246 | | int m, n; |
| 247 | | for (m = 0; m < board_size; m++) |
| 248 | | for (n = 0; n < board_size; n++) @{ |
| 249 | | do_something(POS(m, n)); |
| 250 | | @} |
| 251 | | @end example |
| 252 | | |
| 253 | | Or: |
| | 243 | at every vertex. Here are the best way of doing this (other |
| | 244 | implemantations were tested and are slower on 19x19 board): |
| 254 | 245 | |
| 255 | 246 | @example |
| 256 | 247 | int pos; |
| … |
… |
|
| 273 | 264 | @item Number of stones in the string. |
| 274 | 265 | @item Origin of the string, i.e. a canonical reference point, defined |
| 275 | 266 | to be the stone with smallest 1D board coordinate. |
| 276 | | @item A list of the stones in the string. |
| | 267 | @item A list of the stones in the string (linked in a cycle). |
| 277 | 268 | @item Number of liberties. |
| 278 | 269 | @item A list of the liberties. If there are too many liberties the list is |
| 279 | 270 | truncated. |
| … |
… |
|
| 281 | 272 | @item A list of the neighbor strings. |
| 282 | 273 | @end itemize |
| 283 | 274 | |
| 284 | | The basic data structure is |
| | 275 | The basic data structures are |
| 285 | 276 | |
| 286 | 277 | @example |
| 287 | 278 | struct string_data @{ |
| … |
… |
|
| 290 | 281 | int origin; /* Coordinates of "origin", i.e. */ |
| 291 | 282 | /* "upper left" stone. */ |
| 292 | 283 | int liberties; /* Number of liberties. */ |
| 293 | | int libs[MAX_LIBERTIES]; /* Coordinates of liberties. */ |
| 294 | 284 | int neighbors; /* Number of neighbor strings */ |
| 295 | | int neighborlist[MAXCHAIN]; /* List of neighbor string numbers. */ |
| 296 | 285 | int mark; /* General purpose mark. */ |
| 297 | 286 | @}; |
| 298 | 287 | |
| 299 | | struct string_data string[MAX_STRINGS]; |
| | 288 | struct string_liberties_data @{ |
| | 289 | int list[MAX_LIBERTIES]; /* Coordinates of liberties. */ |
| | 290 | @}; |
| | 291 | |
| | 292 | struct string_neighbors_data @{ |
| | 293 | int list[MAXCHAIN]; /* List of neighbor string numbers. */ |
| | 294 | @}; |
| | 295 | |
| | 296 | static struct string_data string[MAX_STRINGS]; |
| | 297 | static struct string_liberties_data string_libs[MAX_STRINGS]; |
| | 298 | static struct string_neighbors_data string_neighbors[MAX_STRINGS]; |
| 300 | 299 | @end example |
| 301 | 300 | |
| 302 | | It should be clear that almost all information is stored in the |
| 303 | | @code{string} array. To get a mapping from the board coordinates to the |
| 304 | | @code{string} array we have |
| | 301 | It should be clear that almost all information is stored in these |
| | 302 | arrays. They are splitted because of caching purposes - if one doesn't |
| | 303 | need libs or neighbors, accessing string_data is faster, because @code{list} |
| | 304 | arrays are quite big. |
| | 305 | |
| | 306 | To get a mapping from the board coordinates to these arrays we have |
| 305 | 307 | |
| 306 | 308 | @example |
| 307 | 309 | static int string_number[BOARDMAX]; |
| 308 | 310 | @end example |
| 309 | 311 | |
| 310 | 312 | @noindent |
| 311 | | which contains indices into the @code{string} array. This information is only |
| | 313 | which contains indices into these arrays. This information is only |
| 312 | 314 | valid at nonempty vertices, however, so it is necessary to first |
| 313 | 315 | verify that @code{board[pos] != EMPTY}. |
| 314 | 316 | |
| 315 | | The @code{string_data} structure does not include an array of the stone |
| 316 | | coordinates. This information is stored in a separate array: |
| | 317 | A string stones coordinates are stored in a separate array: |
| 317 | 318 | |
| 318 | 319 | @example |
| 319 | 320 | static int next_stone[BOARDMAX]; |
| … |
… |
|
| 335 | 336 | static int liberty_mark; |
| 336 | 337 | static int string_mark; |
| 337 | 338 | static int next_string; |
| 338 | | static int strings_initialized = 0; |
| 339 | 339 | @end example |
| 340 | 340 | |
| 341 | 341 | The @code{ml} array and @code{liberty_mark} are used to "mark" liberties on |
| … |
… |
|
| 349 | 349 | individual strings. |
| 350 | 350 | |
| 351 | 351 | @code{next_string} gives the number of the next available entry in the |
| 352 | | @code{string} array. Then @code{strings_initialized} is set to one when |
| 353 | | all data structures are known to be up to date. Given an arbitrary board |
| 354 | | position in the @samp{board} array, this is done by calling |
| 355 | | @code{incremental_board_init()}. It is not necessary to call this |
| 356 | | function explicitly since any other function that needs the information |
| 357 | | does this if it has not been done. |
| | 352 | @code{string} array. |
| | 353 | |
| | 354 | To initialize all the structures of the incremental board one need to |
| | 355 | call @code{new_position} function, which builds all information based |
| | 356 | on the actual state of the board (in @code{board} variable). |
| 358 | 357 | |
| 359 | 358 | The interesting part of the code is the incremental update of the data |
| 360 | 359 | structures when a stone is played and subsequently removed. To |
| 361 | 360 | understand the strategies involved in adding a stone it is necessary |
| 362 | 361 | to first know how undoing a move works. The idea is that as soon as |
| 363 | | some piece of information is about to be changed, the old value is |
| 364 | | pushed onto a stack which stores the value and its address. The stack |
| 365 | | is built from the following structures: |
| | 362 | some piece of information is about to be changed, the old value (or |
| | 363 | an intersection state) is pushed onto a stack which stores the value |
| | 364 | and its address. The stack is built from the following structures (we |
| | 365 | have two stacks really, because Intersection can have different type |
| | 366 | than int): |
| 366 | 367 | |
| 367 | 368 | @example |
| 368 | 369 | struct change_stack_entry @{ |
| … |
… |
|
| 370 | 371 | int value; |
| 371 | 372 | @}; |
| 372 | 373 | |
| 373 | | struct change_stack_entry change_stack[STACK_SIZE]; |
| 374 | | int change_stack_index; |
| | 374 | struct vertex_stack_entry @{ |
| | 375 | Intersection *address; |
| | 376 | int value; |
| | 377 | @}; |
| | 378 | |
| | 379 | static struct change_stack_entry change_stack[STACK_SIZE]; |
| | 380 | static struct change_stack_entry *change_stack_pointer; |
| | 381 | |
| | 382 | static struct vertex_stack_entry vertex_stack[STACK_SIZE]; |
| | 383 | static struct vertex_stack_entry *vertex_stack_pointer; |
| 375 | 384 | @end example |
| 376 | 385 | |
| 377 | 386 | @noindent |
| 378 | 387 | and manipulated with the macros |
| 379 | 388 | |
| 380 | 389 | @example |
| | 390 | CLEAR_STACKS() |
| 381 | 391 | BEGIN_CHANGE_RECORD() |
| 382 | 392 | PUSH_VALUE(v) |
| | 393 | PUSH_VERTEX(v) |
| 383 | 394 | POP_MOVE() |
| 384 | 395 | @end example |
| 385 | 396 | |
| 386 | 397 | Calling @code{BEGIN_CHANGE_RECORD()} stores a null pointer in the address |
| 387 | 398 | field to indicate the start of changes for a new move. As mentioned |
| 388 | | earlier @code{PUSH_VALUE()} stores a value and its corresponding address. |
| | 399 | earlier @code{PUSH_VALUE()} and @code{PUSH_VERTEX()} stores a value and its |
| | 400 | corresponding address. |
| 389 | 401 | Assuming that all changed information has been duly pushed onto the |
| 390 | 402 | stack, undoing the move is only a matter of calling @code{POP_MOVE()}, |
| 391 | 403 | which simply assigns the values to the addresses in the reverse order |
| 392 | | until the null pointer is reached. This description is slightly |
| 393 | | simplified because this stack can only store 'int' values and we need |
| 394 | | to also store changes to the board. Thus we have two parallel stacks |
| 395 | | where one stores @code{int} values and the other one stores |
| 396 | | @code{Intersection} values. |
| | 404 | until the null pointer is reached. |
| 397 | 405 | |
| 398 | 406 | When a new stone is played on the board, first captured opponent |
| 399 | 407 | strings, if any, are removed. In this step we have to push the board |
| … |
… |
|
| 438 | 446 | The often used construction |
| 439 | 447 | |
| 440 | 448 | @example |
| 441 | | pos = FIRST_STONE(s); |
| | 449 | first_stone = FIRST_STONE(s); |
| | 450 | pos = first_stone; |
| 442 | 451 | do @{ |
| 443 | 452 | ... |
| 444 | 453 | pos = NEXT_STONE(pos); |
| 445 | | @} while (!BACK_TO_FIRST_STONE(s, pos)); |
| | 454 | @} while (pos != first_stone); |
| 446 | 455 | @end example |
| 447 | 456 | |
| 448 | 457 | @noindent |
| 449 | 458 | traverses the stones of the string with number @samp{s} exactly once, |
| 450 | 459 | with @code{pos} holding the coordinates. In general @code{pos} is |
| 451 | 460 | used as board coordinate and @samp{s} as an index into the |
| 452 | | @code{string} array or sometimes a pointer to an entry in the |
| 453 | | @code{string} array. |
| | 461 | @code{string}, @code{string_libs} or @code{string_neighbors} array. |
| 454 | 462 | |
| 455 | 463 | @node Some Board Functions |
| 456 | 464 | @section Some Board Functions |
| … |
… |
|
| 489 | 497 | the komaster scheme (@pxref{Ko}). |
| 490 | 498 | |
| 491 | 499 | @itemize @bullet |
| 492 | | @item @code{int trymove(int pos, int color, const char *message)} |
| | 500 | @item @code{int trymove(int pos, int color, const char *message, int str)} |
| 493 | 501 | @findex trymove |
| 494 | 502 | @quotation |
| 495 | 503 | Returns true if @code{(pos)} is a legal move for @code{color}. In that |
| … |
… |
|
| 498 | 506 | with @option{--decide-string} or with @option{-o}), the string |
| 499 | 507 | @code{*message} will be inserted in the SGF file as a comment. The |
| 500 | 508 | comment will also refer to the string at @code{str} if this is not |
| 501 | | @code{0}. The value of @code{str} can be NO_MOVE if it is not needed but |
| 502 | | otherwise the location of @code{str} is included in the comment. |
| | 509 | @code{NO_MOVE}. The value of @code{str} can be @code{NO_MOVE} if it is |
| | 510 | not needed but otherwise the location of @code{str} is included in the |
| | 511 | comment. @strong{NOTE}: including str in comment isn't implemented for |
| | 512 | now |
| 503 | 513 | @end quotation |
| 504 | 514 | @item @code{int tryko(int pos, int color, const char *message)} |
| 505 | 515 | @findex tryko |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/doc/dfa.texi,v
retrieving revision 1.7
diff -u -p -r1.7 dfa.texi
|
|
|
|
| 1 | 1 | In this chapter, we describe the principles of the GNU Go DFA |
| 2 | 2 | pattern matcher. The aim of this system is to permit a fast |
| 3 | | pattern matching when it becomes time critical like in owl |
| 4 | | module (@ref{The Owl Code}). Since GNU Go 3.2, this is enabled |
| | 3 | pattern matching. Since GNU Go 3.2, this is enabled |
| 5 | 4 | by default. You can still get back the traditional pattern matcher |
| 6 | 5 | by running @command{configure --disable-dfa} and then recompiling |
| 7 | 6 | GNU Go. |
RCS file: /home/arend/Go/gnugo-rsync/gnugo/doc/dragon.texi,v
retrieving revision 1.19
diff -u -p -r1.19 dragon.texi
|
|
|
|
| 17 | 17 | Later routines called by @code{genmove()} will then have access to this |
| 18 | 18 | information. This document attempts to explain the philosophy and |
| 19 | 19 | algorithms of this preliminary analysis, which is carried out by the |
| 20 | | two routines @code{make_worm()} and @code{make_dragon()} in |
| 21 | | @file{dragon.c}. |
| | 20 | two routines @code{make_worms()} (in @file{worm.c}) and |
| | 21 | @code{make_dragons()} (in @file{dragon.c}). |
| 22 | 22 | |
| 23 | 23 | @cindex dragon |
| 24 | 24 | @cindex worm |
| … |
… |
|
| 83 | 83 | int unconditional_status; |
| 84 | 84 | int attack_points[MAX_TACTICAL_POINTS]; |
| 85 | 85 | int attack_codes[MAX_TACTICAL_POINTS]; |
| | 86 | int discarded_attacks[MAX_TACTICAL_POINTS]; |
| 86 | 87 | int defense_points[MAX_TACTICAL_POINTS]; |
| 87 | 88 | int defend_codes[MAX_TACTICAL_POINTS]; |
| | 89 | int discarded_defenses[MAX_TACTICAL_POINTS]; |
| 88 | 90 | int attack_threat_points[MAX_TACTICAL_POINTS]; |
| 89 | | int attack_threat_codes[MAX_TACTICAL_POINTS]; |
| | 91 | int attack_threat_codes[MAX_TACTICAL_POINTS]; |
| | 92 | int discarded_att_threats[MAX_TACTICAL_POINTS]; |
| 90 | 93 | int defense_threat_points[MAX_TACTICAL_POINTS]; |
| 91 | 94 | int defense_threat_codes[MAX_TACTICAL_POINTS]; |
| | 95 | int discarded_def_threats[MAX_TACTICAL_POINTS]; |
| 92 | 96 | @}; |
| 93 | 97 | @end example |
| 94 | 98 | |
| … |
… |
|
| 109 | 113 | other worm. Intersections that are shared are counted with equal |
| 110 | 114 | fractional values for each worm. This measures the direct territorial |
| 111 | 115 | value of capturing a worm. @dfn{effective_size} is a floating point number. |
| 112 | | Only intersections at a distance of 4 or less are counted. |
| | 116 | Only intersections at a distance (empty vertices between a worm and an |
| | 117 | intersection) of 5 or less are counted. |
| 113 | 118 | @end quotation |
| 114 | 119 | @item @code{origin} |
| 115 | 120 | @quotation |
| … |
… |
|
| 220 | 225 | @end quotation |
| 221 | 226 | @item @code{cutstone2} |
| 222 | 227 | @quotation |
| 223 | | Cutting points are identified by the patterns in the connections |
| 224 | | database. Proper cuts are handled by the fact that attacking and |
| | 228 | Number of potential cuts involving the worm. Cutting points are |
| | 229 | identified by the patterns in the connections database. Proper |
| | 230 | cuts are handled by the fact that attacking and |
| 225 | 231 | defending moves also count as moves cutting or connecting the |
| 226 | 232 | surrounding dragons. The @code{cutstone2} field is set during |
| 227 | 233 | @code{find_cuts()}, called from @code{make_domains()}. |
| … |
… |
|
| 248 | 254 | opposite color can be killed. More precisely an |
| 249 | 255 | @dfn{inessential string} is a string S of genus zero, |
| 250 | 256 | not adjacent to any opponent string which can be easily |
| 251 | | captured, and which has no edge liberties or second |
| | 257 | captured, which is not cutstone, and which has up to |
| | 258 | 2 edge liberties and no second |
| 252 | 259 | order liberties, and which satisfies the following |
| 253 | 260 | further property: If the string is removed from the |
| 254 | 261 | board, then the remaining cavity only borders worms of the |
| … |
… |
|
| 266 | 273 | even if the opponent is allowed an arbitrary number of consecutive |
| 267 | 274 | moves. |
| 268 | 275 | @end quotation |
| 269 | | @item unconditional_status |
| | 276 | @item @code{unconditional_status} |
| 270 | 277 | @quotation |
| 271 | 278 | Unconditional status is also set by the function |
| 272 | 279 | @code{unconditional_life}. This is set @code{ALIVE} for stones which are |
| … |
… |
|
| 285 | 292 | transformed into an invincible group by some number of consecutive |
| 286 | 293 | moves. Well, this is not entirely true because there is a rare class of |
| 287 | 294 | seki groups not satisfying this condition. Exactly which these are is |
| 288 | | left as an exercise for the reader. Currently @code{unconditional_life}, |
| 289 | | which strictly follows the definitions above, calls such seki groups |
| 290 | | unconditionally dead, which of course is a misfeature. It is possible to |
| 291 | | avoid this problem by making the algorithm slightly more complex, but |
| 292 | | this is left for a later revision. |
| | 295 | shown in a comment in @file{unconditional.c}. |
| 293 | 296 | @end quotation |
| 294 | | @item @code{int attack_points[MAX_TACTICAL_POINTS]} |
| 295 | | @item @code{attack_codes[MAX_TACTICAL_POINTS]} |
| | 297 | @item @code{int attack_points[MAX_TACTICAL_POINTS];} |
| | 298 | @item @code{int attack_codes[MAX_TACTICAL_POINTS];} |
| 296 | 299 | @item @code{int defense_points[MAX_TACTICAL_POINTS];} |
| 297 | 300 | @item @code{int defend_codes[MAX_TACTICAL_POINTS];} |
| 298 | 301 | @quotation |
| … |
… |
|
| 310 | 313 | @quotation |
| 311 | 314 | These are points that threaten to attack or defend a worm. |
| 312 | 315 | @end quotation |
| | 316 | @item @code{int discarded_attacks[MAX_TACTICAL_POINTS];} |
| | 317 | @item @code{int discarded_defenses[MAX_TACTICAL_POINTS];} |
| | 318 | @item @code{int discarded_att_threats[MAX_TACTICAL_POINTS];} |
| | 319 | @item @code{int discarded_def_threats[MAX_TACTICAL_POINTS];} |
| | 320 | @quotation |
| | 321 | These are checked points that haven't led to any positive result. |
| | 322 | Used to not check the same point more than once. |
| | 323 | @end quotation |
| 313 | 324 | @end itemize |
| 314 | 325 | |
| 315 | 326 | The function @code{makeworms()} will generate data for all worms. |
| … |
… |
|
| 343 | 354 | XXX... |
| 344 | 355 | |
| 345 | 356 | @end example |
| 346 | | @findex dragon_eye |
| 347 | | |
| 348 | | The code for this type of amalgamation is in the routine |
| 349 | | @code{dragon_eye()}, discussed further in EYES. |
| 350 | 357 | |
| 351 | 358 | Next, we amalgamate strings which seem uncuttable. We amalgamate dragons |
| 352 | 359 | which either share two or more common liberties, or share one liberty |
| … |
… |
|
| 367 | 374 | @section Connection |
| 368 | 375 | @cindex connections |
| 369 | 376 | |
| 370 | | The fields @code{black_eye.cut} and @code{white_eye.cut} are set where the |
| | 377 | The fields in @code{cutting_points} are set where the |
| 371 | 378 | opponent can cut, and this is done by the B (break) class patterns in |
| 372 | | @file{conn.db}. There are two important uses for this field, which can be |
| | 379 | @file{conn.db}. There are two important uses for this table, which can be |
| 373 | 380 | accessed by the autohelper functions @code{xcut()} and @code{ocut()}. The |
| 374 | 381 | first use is to stop amalgamation in positions like |
| 375 | 382 | |
| … |
… |
|
| 534 | 541 | int safety; |
| 535 | 542 | float weakness; |
| 536 | 543 | float weakness_pre_owl; |
| | 544 | float strategic_size; |
| 537 | 545 | int escape_route; |
| 538 | 546 | struct eyevalue genus; |
| 539 | 547 | int heye; |
| … |
… |
|
| 541 | 549 | int surround_status; |
| 542 | 550 | int surround_size; |
| 543 | 551 | int semeais; |
| 544 | | int semeai_margin_of_safety; |
| | 552 | int semeai_defense_code; |
| 545 | 553 | int semeai_defense_point; |
| 546 | | int semeai_defense_certain; |
| | 554 | int semeai_defense_certain; |
| | 555 | int semeai_defense_target; |
| | 556 | int semeai_attack_code; |
| 547 | 557 | int semeai_attack_point; |
| 548 | 558 | int semeai_attack_certain; |
| | 559 | int semeai_attack_target; |
| 549 | 560 | int owl_threat_status; |
| 550 | 561 | int owl_status; |
| 551 | 562 | int owl_attack_point; |
| 552 | 563 | int owl_attack_code; |
| 553 | 564 | int owl_attack_certain; |
| | 565 | int owl_attack_node_count; |
| 554 | 566 | int owl_second_attack_point; |
| 555 | 567 | int owl_defense_point; |
| 556 | 568 | int owl_defense_code; |
| … |
… |
|
| 607 | 619 | @quotation |
| 608 | 620 | The dragon number, used as a key into the @code{dragon2} array. |
| 609 | 621 | @end quotation |
| 610 | | @item origin |
| | 622 | @item @code{origin} |
| 611 | 623 | @cindex dragon origin |
| 612 | 624 | @quotation |
| 613 | 625 | The origin of the dragon is a unique particular vertex |
| … |
… |
|
| 616 | 628 | copied to the dragon origins. Amalgamation of two dragons |
| 617 | 629 | amounts to changing the origin of one. |
| 618 | 630 | @end quotation |
| 619 | | @item size |
| | 631 | @item @code{size} |
| 620 | 632 | @cindex dragon size |
| 621 | 633 | @quotation |
| 622 | 634 | The number of stones in the dragon. |
| 623 | 635 | @end quotation |
| 624 | | @item effective size |
| | 636 | @item @code{effective size} |
| 625 | 637 | @cindex effective size |
| 626 | 638 | @quotation |
| 627 | 639 | The sum of the effective sizes of the constituent worms. |
| … |
… |
|
| 630 | 642 | cardinality of the dragon plus the number of empty vertices which are |
| 631 | 643 | nearer this dragon than any other. |
| 632 | 644 | @end quotation |
| 633 | | @item crude_status |
| | 645 | @item @code{crude_status} |
| 634 | 646 | @quotation |
| 635 | 647 | (ALIVE, DEAD, UNKNOWN, CRITICAL). An early measure of the life |
| 636 | 648 | potential of the dragon. It is computed before the owl code is |
| 637 | 649 | run and is superceded by the status as soon as that becomes |
| 638 | 650 | available. |
| 639 | 651 | @end quotation |
| 640 | | @item status |
| | 652 | @item @code{status} |
| 641 | 653 | @cindex dragon status |
| 642 | 654 | @quotation |
| 643 | 655 | The dragon status is the best measure of the dragon's health. |
| … |
… |
|
| 649 | 661 | Here are definitions of the fields in the @code{dragon2} array. |
| 650 | 662 | |
| 651 | 663 | @itemize @bullet |
| 652 | | @item origin |
| | 664 | @item @code{origin} |
| 653 | 665 | @quotation |
| 654 | 666 | The origin field is duplicated here. |
| 655 | 667 | @end quotation |
| 656 | | @item adjacent |
| 657 | 668 | @item @code{adjacent[MAX_NEIGHBOR_DRAGONS]} |
| 658 | | @cindex neighbor dragons |
| 659 | | @cindex adjacent dragons |
| 660 | | @findex find_neighbor_dragons |
| 661 | | @quotation |
| 662 | | Dragons of either color near the given one are called @dfn{neighbors}. |
| 663 | | They are computed by the function @code{find_neighbor_dragons()}. |
| 664 | | The @code{dragon2.adjacent} array gives the dragon numbers of |
| 665 | | these dragons. |
| 666 | | @end quotation |
| 667 | 669 | @item @code{neighbors} |
| 668 | 670 | @cindex neighbor dragons |
| 669 | 671 | @cindex adjacent dragons |
| … |
… |
|
| 671 | 673 | @quotation |
| 672 | 674 | Dragons of either color near the given one are called @dfn{neighbors}. |
| 673 | 675 | They are computed by the function @code{find_neighbor_dragons()}. |
| 674 | | The @code{dragon2.adjacent} array gives the dragon numbers of |
| 675 | | these dragons. |
| | 676 | The @code{adjacent} array gives the dragon numbers of |
| | 677 | these dragons and @code{neighbors} gives the number of them. |
| 676 | 678 | @end quotation |
| 677 | | @item neighbors |
| 678 | | @quotation |
| 679 | | The number of neighbor dragons. |
| 680 | | @end quotation |
| 681 | | @item hostile_neighbors |
| | 679 | @item @code{hostile_neighbors} |
| 682 | 680 | @quotation |
| 683 | 681 | The number of neighbor dragons of the opposite color. |
| 684 | 682 | @end quotation |
| 685 | | @item moyo_size |
| 686 | | @item float moyo_territorial_value |
| | 683 | @item @code{moyo_size} |
| | 684 | @item @code{moyo_territorial_value} |
| 687 | 685 | @findex compute_surrounding_moyo_sizes |
| 688 | 686 | @quotation |
| 689 | 687 | The function @code{compute_surrounding_moyo_sizes()} assigns |
| … |
… |
|
| 691 | 689 | each dragon (@pxref{Territory and Moyo}). This is the |
| 692 | 690 | moyo size. They are recorded in these fields. |
| 693 | 691 | @end quotation |
| 694 | | @item safety |
| | 692 | @item @code{safety} |
| 695 | 693 | @cindex dragon safety |
| 696 | 694 | @quotation |
| 697 | 695 | The dragon safety can take on one of the values |
| … |
… |
|
| 707 | 705 | @item INESSENTIAL - the dragon is unimportant (e.g. nakade stones) and dead |
| 708 | 706 | @end itemize |
| 709 | 707 | @end quotation |
| 710 | | @item weakness |
| 711 | | @item weakness_pre_owl |
| | 708 | @item @code{weakness} |
| | 709 | @item @code{weakness_pre_owl} |
| 712 | 710 | @cindex dragon weakness |
| 713 | 711 | @cindex weakness |
| 714 | 712 | @quotation |
| … |
… |
|
| 717 | 715 | dragons in greater need of safety. The field @code{weakness_pre_owl} |
| 718 | 716 | is a preliminary computation before the owl code is run. |
| 719 | 717 | @end quotation |
| 720 | | @item escape_route |
| | 718 | @item @code{strategic_size} |
| | 719 | @cindex strategic_size |
| | 720 | @quotation |
| | 721 | An effective size including weakness of neighbors. |
| | 722 | @end quotation |
| | 723 | @item @code{escape_route} |
| 721 | 724 | @cindex dragon escape_route |
| 722 | 725 | @cindex escape_route |
| 723 | 726 | @findex compute_escape |
| … |
… |
|
| 726 | 729 | in case it cannot make two eyes locally. Documentation |
| 727 | 730 | may be found in @ref{Escape}. |
| 728 | 731 | @end quotation |
| 729 | | @item struct eyevalue genus |
| | 732 | @item @code{genus} |
| 730 | 733 | @cindex dragon genus |
| 731 | 734 | @cindex genus |
| 732 | 735 | @quotation |
| … |
… |
|
| 744 | 747 | |
| 745 | 748 | @end example |
| 746 | 749 | @end quotation |
| 747 | | @item heye |
| | 750 | @item @code{heye} |
| 748 | 751 | @quotation |
| 749 | 752 | Location of a half eye attached to the dragon. |
| 750 | 753 | @end quotation |
| 751 | | @item lunch |
| | 754 | @item @code{lunch} |
| 752 | 755 | @cindex dragon lunch |
| 753 | 756 | @cindex lunch |
| 754 | 757 | @quotation |
| … |
… |
|
| 756 | 759 | can be captured. In contrast with worm lunches, a dragon |
| 757 | 760 | lunch must be able to defend itself. |
| 758 | 761 | @end quotation |
| 759 | | @item surround_status |
| 760 | | @item surround_size |
| | 762 | @item @code{surround_status} |
| | 763 | @item @code{surround_size} |
| 761 | 764 | @cindex surround_status |
| 762 | 765 | @cindex surround_size |
| 763 | 766 | @cindex surround |
| … |
… |
|
| 766 | 769 | it is @dfn{surrounded}. See @ref{Surrounded Dragons} and |
| 767 | 770 | the comments in @file{surround.c} for more information about the |
| 768 | 771 | algorithm. Used in computing the escape_route, and also callable |
| 769 | | from patterns (currently used by CB258). |
| | 772 | from patterns. |
| 770 | 773 | @end quotation |
| 771 | | @item semeais |
| 772 | | @item semeai_defense_point |
| 773 | | @item semeai_defense_certain |
| 774 | | @item semeai_attack_point |
| 775 | | @item semeai_attack_certain |
| 776 | | @cindex semeai |
| | 774 | @item @code{semeais} |
| | 775 | @item @code{semeai_defense_code} |
| | 776 | @item @code{semeai_defense_point} |
| | 777 | @item @code{semeai_defense_certain} |
| | 778 | @item @code{semeai_defense_target} |
| | 779 | @item @code{semeai_attack_code} |
| | 780 | @item @code{semeai_attack_point} |
| | 781 | @item @code{semeai_attack_certain} |
| | 782 | @item @code{semeai_attack_target} |
| | 783 | @cindex semeais |
| | 784 | @cindex semeai_defense_code |
| 777 | 785 | @cindex semeai_defense_point |
| 778 | 786 | @cindex semeai_defense_certain |
| | 787 | @cindex semeai_defense_target |
| | 788 | @cindex semeai_attack_code |
| 779 | 789 | @cindex semeai_attack_point |
| 780 | 790 | @cindex semeai_attack_certain |
| | 791 | @cindex semeai_attack_target |
| 781 | 792 | @quotation |
| 782 | 793 | If two dragons of opposite color both have the status CRITICAL |
| 783 | 794 | or DEAD they are in a @dfn{semeai} (capturing race), and their |
| … |
… |
|
| 785 | 796 | @code{owl_analyze_semeai()} in @file{owl.c}, which attempts to |
| 786 | 797 | determine which is alive, which dead, or if the result is |
| 787 | 798 | seki, and whether it is important who moves first. The |
| 788 | | function @file{new_semeai()} in @file{semeai.c} attempts |
| | 799 | function @code{semeai()} in @file{semeai.c} attempts |
| 789 | 800 | to revise the statuses and to generate move reasons based |
| 790 | 801 | on these results. The field @code{dragon2.semeais} is nonzero |
| 791 | 802 | if the dragon is an element of a semeai, and equals the |
| 792 | 803 | number of semeais (seldom more than one). The semeai defense |
| 793 | 804 | and attack points are locations the defender or attacker |
| 794 | | must move to win the semeai. The field @code{semeai_margin_of_safety} |
| 795 | | is intended to indicate whether the semeai is close or not |
| 796 | | but currently this field is not maintained. The fields |
| | 805 | must move to win the semeai and the result code of these moves is |
| | 806 | also stored. In @code{semeai_defense_target} and |
| | 807 | @code{semeai_attack_target} an origin of an opponent dragon in |
| | 808 | semeai, on which the move has impact, is stored. The fields |
| 797 | 809 | @code{semeai_defense_certain} and @code{semeai_attack_certain} |
| 798 | 810 | indicate that the semeai code was able to finish analysis |
| 799 | 811 | without running out of nodes. |
| 800 | 812 | @end quotation |
| 801 | | @item owl_status |
| | 813 | @item @code{owl_threat_status} |
| | 814 | @quotation |
| | 815 | Informs, whether the dragon has any defense or attack threats |
| | 816 | (@code{CAN_THREATEN_ATTACK} or @code{CAN_THREATEN_DEFENSE}). |
| | 817 | @end quotation |
| | 818 | @item @code{owl_status} |
| 802 | 819 | @quotation |
| 803 | 820 | This is a classification similar to @code{dragon.crude_status}, but |
| 804 | 821 | based on the life and death reading in @file{owl.c}. |
| … |
… |
|
| 810 | 827 | @code{owl_defend()} is run, and if it can be defended it |
| 811 | 828 | is classified as @code{CRITICAL}, and if not, as @code{DEAD}. |
| 812 | 829 | @end quotation |
| 813 | | @item owl_attack_point |
| | 830 | @item @code{owl_attack_point} |
| 814 | 831 | @cindex owl_attack_point |
| 815 | 832 | @quotation |
| 816 | 833 | If the dragon can be attacked this is the point to attack the dragon. |
| 817 | 834 | @end quotation |
| 818 | | @item owl_attack_code |
| | 835 | @item @code{owl_attack_code} |
| 819 | 836 | @cindex owl_attack_code |
| 820 | 837 | @quotation |
| 821 | | The owl attack code, It can be WIN, KO_A, KO_B or 0 (@pxref{Return Codes}). |
| | 838 | The owl attack code, It can be WIN, KO_A, GAIN, LOSS, |
| | 839 | KO_B or 0 (@pxref{Return Codes}). |
| 822 | 840 | @end quotation |
| 823 | | @item owl_attack_certain |
| | 841 | @item @code{owl_attack_certain} |
| 824 | 842 | @cindex owl_attack_certain |
| 825 | 843 | @quotation |
| 826 | 844 | The owl reading is able to finish analyzing the attack |
| 827 | 845 | without running out of nodes. |
| 828 | 846 | @end quotation |
| 829 | | @item owl_second_attack_point |
| | 847 | @item @code{owl_attack_node_count} |
| | 848 | @cindex owl_attack_node_count |
| | 849 | @quotation |
| | 850 | Number of nodes used during analyze of attack move. |
| | 851 | @end quotation |
| | 852 | @item @code{owl_second_attack_point} |
| 830 | 853 | @cindex owl_second_attack_point |
| 831 | 854 | @quotation |
| 832 | 855 | A second attack point. |
| 833 | 856 | @end quotation |
| 834 | | @item owl_defense_point |
| | 857 | @item @code{owl_defense_point} |
| 835 | 858 | @cindex owl_defense_point |
|