@Override
protected TwoPlayerMove searchInternal( TwoPlayerMove lastMove, int depth,
SearchWindow window, SearchTreeNode parent ) {
//System.out.println("moves="+ searchable.getMoveList());
HashKey key = searchable.getHashKey();
Entry entry = lookupTable.get(key);
if (lookupTable.entryExists(entry, lastMove, depth, window))
return entry.bestMove;
boolean done = searchable.done( lastMove, false);
if ( depth <= 0 || done ) {
if (doQuiescentSearch(depth, done, lastMove)) {
TwoPlayerMove qMove = quiescentSearch(lastMove, depth, window, parent);
if (qMove != null) {
entry = new Entry(qMove, qMove.getInheritedValue());
lookupTable.put(key, entry);
return qMove;
}
}
int sign = fromPlayer1sPerspective(lastMove) ? 1 : -1;
lastMove.setInheritedValue(sign * lastMove.getValue());
entry = new Entry(lastMove, -lastMove.getInheritedValue());
lookupTable.put(key, entry);
return lastMove;
}
MoveList list = searchable.generateMoves(lastMove, weights_);