Esempio n. 1
0
        public double Evaluate(IPlayerNode node)
        {
            if (node.GameOver)
            {
                return(-10000000);
            }

            var result = Heuristics.GetMonotonicity(node.Grid) * 10 + Heuristics.GetEmptyCellCount(node.Grid);

            return(result);
        }
Esempio n. 2
0
        public double Evaluate(IPlayerNode node)
        {
            if (node.GameOver)
            {
                return -10000000;
            }

            var result = Heuristics.GetMonotonicity(node.Grid) * 10 + Heuristics.GetEmptyCellCount(node.Grid);

            return result;
        }
Esempio n. 3
0
        private void Visit(IPlayerNode node, int searchDepth)
        {
            if (searchDepth == 0)
            {
                return;
            }

            foreach (var child in node.Children.Values)
            {
                this.Visit(child, searchDepth);
            }
        }
Esempio n. 4
0
        private void Visit(IPlayerNode node, int searchDepth)
        {
            if (searchDepth == 0)
            {
                return;
            }

            foreach (var child in node.Children.Values)
            {
                this.Visit(child, searchDepth);
            }
        }
        private double GetPositionEvaluation(IPlayerNode playerNode, int depth, double probability)
        {
            this.searchStatistics.NodeCount++;

            if (playerNode.GameOver || probability < this.minProbability || depth == 0)
            {
                this.searchStatistics.TerminalNodeCount++;

                return(playerNode.HeuristicValue);
            }

            return(playerNode.Children.Values.Max(child => this.GetPositionEvaluation(child, depth, probability)));
        }
Esempio n. 6
0
        public double Evaluate(IPlayerNode node)
        {
            if (node.GameOver)
            {
                return MinEvaluation;
            }

            var grid = node.Grid;

            var result = this.heatMaps.Select(map => EvaluateGrid(grid, map)).Max();

            result -= 1 << Math.Max(0, 6 - EvaluateEmptyCells(node.Grid));

            return result;
        }
Esempio n. 7
0
        public double Evaluate(IPlayerNode node)
        {
            if (node.GameOver)
            {
                return(MinEvaluation);
            }

            var grid = node.Grid;

            var result = this.heatMaps.Select(map => EvaluateGrid(grid, map)).Max();

            result -= 1 << Math.Max(0, 6 - EvaluateEmptyCells(node.Grid));

            return(result);
        }
Esempio n. 8
0
 public static byte GetMaxValueEvalution(IPlayerNode node) => node.Grid.Flatten().Max();
Esempio n. 9
0
 public static byte GetMaxValueEvalution(IPlayerNode node) => node.Grid.Flatten().Max();