예제 #1
0
        /// <summary>
        /// Returns the value of possible next move.
        /// Next position should be set inside chromosome.
        /// </summary>
        private double CalculateNextMove(TicTacToeChromosome chromosome)
        {
            double positionValue = 0;

            double[][] board = chromosome.Board;
            // In game board
            Point randomEmptySpace = this.CalculateNextEmptySpace(board);

            // Connect empty space with chromosome
            this.SetEmptySpaceForChromosome(chromosome, randomEmptySpace);
            // Valculate value for specified position
            positionValue = this.CalculatePositionValue(board, randomEmptySpace);

            return(positionValue);
        }
예제 #2
0
 private void SetEmptySpaceForChromosome(TicTacToeChromosome chromosome, Point point)
 {
     chromosome.Position.X = point.X;
     chromosome.Position.Y = point.Y;
 }