public ThreadedSolver(int numThreads, double ttSize) { table = new TranspositionTable(gbytes: ttSize); var locker = new MoveLocker(); solvers = new List <Solver>(); for (int i = 0; i < numThreads; i++) { solvers.Add(new Solver(table, locker)); } }
public Solver(TranspositionTable table, MoveLocker locker = null) { // Parameters this.table = table; this.locker = locker; // Preallocate all the memory. Since the algorithm is recursive, // we need one list per depth level to make it re-entrant. // We'll never need more that 50 depths, right? moveLists = new List <List <Move> >(); while (moveLists.Count < 50) { moveLists.Add(new List <Move>()); } quiescenceMoves = new List <List <Move> >(); while (quiescenceMoves.Count < 50) { quiescenceMoves.Add(new List <Move>()); } }