edaxBookCountBoardBestpath method

CountBestpathResult edaxBookCountBoardBestpath(
  1. Board board, {
  2. required int playerColor,
  3. int playerLowerLimit = BookCountBoardBestPathLowerLimit.best,
  4. int opponentLowerLimit = BookCountBoardBestPathLowerLimit.best,
})

Count bestpath with book.

Compute the indicator of efficiency to win, which means the minimum number you should memorize on the situation both of players always choose one of the move list which of score is larger than lower limit.

This function is very advanced.
You must understand the book structure of edax and following important notice list.

  • Because internal each node lookup is stopped when book has no links, the more lower the accuracy of your book is, the more lower this feature accuracy is.
    • In addition, if your book has some depth links (e.g. 24, 30, 40, ...), shallow depth link (≈ path is few) can be taken with a reasonable probability.
    • In a word, if the accuracy of your book is low, you shouldn't use this function. For you reference, if your book has N GB and the depth is more than 30, this feature can probably be inidicator.
  • This function only lookup the best score links. So, this indicator can't consider easy win links which is not best score. In reversi game, the situation can sometimes be found in my experience as a player.
    • In a word, as you know, this indicator isn't perfect. This is just a indicator.
  • The depth of this feature depends on your book.
  • The moves which meet up with another moves is counted respectively.
    • btw, symmetric moves is counted 1 because of edax book structure.

Implementation

CountBestpathResult edaxBookCountBoardBestpath(
  final Board board, {
  required final int playerColor,
  // by default, LowerLimit is only best moves.
  final int playerLowerLimit = BookCountBoardBestPathLowerLimit.best,
  final int opponentLowerLimit = BookCountBoardBestPathLowerLimit.best,
}) {
  final dstP = calloc<bindings.Position>();
  final dstB = calloc<bindings.Board>();
  dstB.ref.player = board.player;
  dstB.ref.opponent = board.opponent;
  _bindings.edax_book_count_board_bestpath(
    dstB,
    dstP,
    playerLowerLimit,
    opponentLowerLimit,
    playerColor,
  );

  final position = Position.fromCStruct(dstP.ref);
  calloc
    ..free(dstP)
    ..free(dstB);
  return CountBestpathResult(board, position);
}