public double Evaluate(IPlayerNode node) { if (node.GameOver) { return(-10000000); } var result = Heuristics.GetMonotonicity(node.Grid) * 10 + Heuristics.GetEmptyCellCount(node.Grid); return(result); }
public double Evaluate(IPlayerNode node) { if (node.GameOver) { return -10000000; } var result = Heuristics.GetMonotonicity(node.Grid) * 10 + Heuristics.GetEmptyCellCount(node.Grid); return result; }
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))); }
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; }
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); }
public static byte GetMaxValueEvalution(IPlayerNode node) => node.Grid.Flatten().Max();