Exemplo n.º 1
0
 public InfoDepthComplete(
     int positionCount,
     long elapsedMilliseconds,
     int depth,
     uint[] principalVariation,
     TranspositionTable transpositionTable)
     : base(positionCount, elapsedMilliseconds, depth, transpositionTable)
 {
     principalVariation.CopyTo(this.principalVariation, 0);
 }
Exemplo n.º 2
0
 public Info(int positionCount, long elapsedMilliseconds, int depth, TranspositionTable transpositionTable)
 {
     SearchedPositionCount = positionCount;
     ElapsedMilliseconds   = elapsedMilliseconds;
     Depth          = depth;
     TtAccessCount  = transpositionTable.AccessCount;
     TtHitCount     = transpositionTable.HitCount;
     TtMissCount    = transpositionTable.MissCount;
     TtReplaceCount = transpositionTable.ReplaceCount;
     TtUsage        = transpositionTable.Usage;
 }
Exemplo n.º 3
0
        public SearchResults(
            int positionCount,
            IReadOnlyCollection <long> elapsedMilliseconds,
            IReadOnlyCollection <MoveEvaluation> moveEvaluations,
            uint[][] principalVariations,
            TranspositionTable transpositionTable)
        {
            SearchedPositionCount = positionCount;
            ElapsedMilliseconds   = elapsedMilliseconds;
            MoveEvaluations       = moveEvaluations;

            var output = new List <List <MoveViewer> >();

            foreach (var principalVariation in principalVariations)
            {
                output.Add(principalVariation.Select(x => new MoveViewer(x)).ToList());
            }

            PrincipalVariations = output;

            this.transpositionTable = transpositionTable;
        }
Exemplo n.º 4
0
        public Game(Board board, TranspositionTable transpositionTable, Colour humanColour = Colour.None)
        {
            this.board = board;

            HumanColour = humanColour;
            CpuColour   = humanColour.Opposite();

            moveGenerator = new MoveGenerator(16);

            positionEvaluator = new PositionEvaluator();

            search = new Search(moveGenerator, positionEvaluator, transpositionTable);

            search.Info += _search_Info;

            var moves = new List <uint>();

            moveGenerator.Generate(board, Colour.White, moves);

            AvailableMoves = moves.Select(x => new MoveViewer(x));

            history.Push(new GameHistoryNode(board.History.First(), GetGameState()));
        }
Exemplo n.º 5
0
 public Search(MoveGenerator moveGenerator, PositionEvaluator positionEvaluator, TranspositionTable transpositionTable)
 {
     this.moveGenerator      = moveGenerator;
     this.positionEvaluator  = positionEvaluator;
     this.transpositionTable = transpositionTable;
 }