RaveDescender extends AbstractDescender { @Override public float searchValue(SearchNode node, short move) { if (node.getWinRate(move) < 0.0f) { return NEGATIVE_INFINITY; } if (move == PASS) { return node.getWinRate(move); } final RaveNode raveNode = (RaveNode) node; final float c = raveNode.getRuns(move); final float r = raveNode.getWinRate(move); final float rc = raveNode.getRaveRuns(move); final float rr = raveNode.getRaveWinRate(move); final float coef = raveCoefficient(c, rc); return r * (1 - coef) + rr * coef; } RaveDescender(Board board, TranspositionTable table, int biasDelay); @Override float searchValue(SearchNode node, short move);  }
@Test public void testIncorporateRun() { player.acceptMove(at("a1")); RaveNode root = (RaveNode) updater.getRoot(); runnable.copyDataFrom(player.getBoard()); runnable.acceptMove(at("a2")); runnable.acceptMove(at("a3")); runnable.acceptMove(at("a4")); updater.updateTree(BLACK, runnable); assertEquals(0.333333, root.getWinRate(at("a2")), 0.01); runnable.copyDataFrom(player.getBoard()); runnable.acceptMove(at("a4")); runnable.acceptMove(at("a3")); runnable.acceptMove(at("a2")); updater.updateTree(BLACK, runnable); assertEquals(0.25, root.getRaveWinRate(at("a2")), 0.01); assertEquals(0.2856f, descender.searchValue(root, at("a2")), 0.01f); }
@Test public void testExcludedMove() { RaveNode root = (RaveNode) updater.getRoot(); root.exclude(at("a1")); assertEquals(Double.NEGATIVE_INFINITY, descender.searchValue(root, at("a1")), 0.001); }