public MoveIterator(Board board, SortInfo sortInfo, int depth) { this.sortInfo = sortInfo; this.board = board; this.depth = depth; bbAttacks = BitboardAttacks.GetInstance(); }
public SearchEngine(Config config) { // time to think to // For testing suites // Inital Ply of search // For performance Benching // aspiration window // Futility pruning // Aggresive Futility pruning // Razoring // Singular Extension // Null Move // Transposition Table this.config = config; random = new Random(); board = new Board(); sortInfo = new SortInfo(); moveIterators = new MoveIterator[MAX_DEPTH]; for (int i = 0; i < MAX_DEPTH; i++) { moveIterators[i] = new MoveIterator(board, sortInfo, i); } pvReductionMatrix = new int[][] { new int[64], new int[64], new int[64], new int[ 64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int [64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int [64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64] }; nonPvReductionMatrix = new int[][] { new int[64], new int[64], new int[64], new int [64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int [64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64], new int [64], new int[64], new int[64], new int[64], new int[64], new int[64], new int[64 ], new int[64], new int[64], new int[64], new int[64] }; // Init our reduction lookup tables for (int depth = 1; depth < MAX_DEPTH; depth++) { // OnePly = 1 for (int moveNumber = 1; moveNumber < 64; moveNumber++) { double pvRed = 0.5 + Math.Log(depth) * Math.Log(moveNumber) / 6.0; double nonPVRed = 0.5 + Math.Log(depth) * Math.Log(moveNumber) / 3.0; pvReductionMatrix[depth][moveNumber] = (int)(pvRed >= 1.0 ? Math.Floor(pvRed * PLY ) : 0); nonPvReductionMatrix[depth][moveNumber] = (int)(nonPVRed >= 1.0 ? Math.Floor(nonPVRed * PLY) : 0); } } // System.out.println(i + " " + j + " " + // pvReductionMatrix[i][j] + " " + nonPvReductionMatrix[i][j]); Init(); }
public virtual void Destroy() { config = null; observer = null; tt = null; evaluator = null; sortInfo = null; if (moveIterators != null) { for (int i = 0; i < MAX_DEPTH; i++) { moveIterators[i] = null; } } System.GC.Collect(); }