Exemple #1
0
 /** Some nodes may have their biases updated. */
 @Override
 public void descend(McRunnable runnable) {
   SearchNode node = getRoot();
   assert node != null : "Fancy hash code: " + board.getFancyHash();
   while (runnable.getBoard().getPasses() < 2) {
     selectAndPlayMove(node, runnable);
     final SearchNode child = table.findIfPresent(runnable.getBoard().getFancyHash());
     if (child == null) {
       return; // No child
     }
     if (child.getTotalRuns() > biasDelay && !child.biasUpdated()) {
       child.updateBias(runnable);
     }
     node = child;
   }
 }
Exemple #2
0
 @Override
 public void fakeDescend(McRunnable runnable, short... moves) {
   runnable.copyDataFrom(board);
   final SearchNode node = getRoot();
   assert node != null : "Fancy hash code: " + board.getFancyHash();
   for (final short move : moves) {
     System.out.println("Passing " + move + " to runnable");
     runnable.acceptMove(move);
     final SearchNode child = table.findIfPresent(runnable.getBoard().getFancyHash());
     if (child == null) {
       return; // No child
     }
     if (child.getTotalRuns() > biasDelay && !child.biasUpdated()) {
       child.updateBias(runnable);
     }
   }
 }
Exemple #3
0
 /** Returns the root node (creating it if necessary). */
 SearchNode getRoot() {
   return table.findOrAllocate(board.getFancyHash());
 }