예제 #1
0
            private int Simulate(Move move, int depth)
            {
                SimulationCount++;
                var version      = game.HandleMove(move);
                var updatedScore = game.GetScore();

                if (updatedScore < initialScore - MaxLossTolerance)
                {
                    AbortedSimCount++;
                    game.RevertToVersion(version);
                    return(-1);
                }

                var score = (depth < MaxDepth && game.TurnsRemaining > 0)
               ? Simulate(depth + 1).Item1
               : updatedScore;

                game.RevertToVersion(version);
                return(score);
            }
예제 #2
0
 public Simulation(Game game)
 {
     this.game = game;//.Copy();
     initialScore = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }
예제 #3
0
 public Simulation(Game game)
 {
     this.game     = game;//.Copy();
     initialScore  = game.GetScore();
     initialPlayer = game.GetCurrentPlayer();
 }