コード例 #1
0
        public PopulationBase(PopulationSettings settings, Board board)
        {
            this.settings = settings;
            this.board = board;

            genomeOperations = new GenomeOperations();
        }
コード例 #2
0
ファイル: Board.cs プロジェクト: byronwall/BlockGameSolver
        public static Board FromIBoardSource(IBoardSource source)
        {
            //update game settings
            GameSettings.Rows = source.Rows;
            GameSettings.Columns = source.Columns;
            Board board = new Board();
            foreach (Piece piece in source.GetPiecesForBoard())
            {
                board[piece.Row, piece.Column] = piece;
            }
            board.SaveBoard();

            return board;
        }
コード例 #3
0
 public PopulationMultiRun(Board board)
     : base(board)
 {
 }
コード例 #4
0
 public PopulationMultiRun(PopulationSettings settings, Board board)
     : base(settings, board)
 {
 }
コード例 #5
0
 public PopulationBase(Board board)
     : this(PopulationSettings.Default, board)
 {
 }
コード例 #6
0
ファイル: Board.cs プロジェクト: byronwall/BlockGameSolver
 private static Board CreateRandomBoard(int? rowMissing, int? colMissing)
 {
     Board output = new Board();
     MersenneTwister rng = RandomSource.Instance;
     for (int i = 0; i < GameSettings.Rows; i++)
     {
         if (i == rowMissing)
         {
             continue;
         }
         for (int j = 0; j < GameSettings.Columns; j++)
         {
             if (j == colMissing)
             {
                 continue;
             }
             bool isDouble = (rng.NextDoublePositive() < 0.05) ? true : false;
             bool isBomb = (!isDouble && rng.NextDoublePositive() < 0.05) ? true : false;
             output[i, j] = new Piece(i, j, rng.Next(1, 6), isBomb, isDouble);
         }
     }
     output.SaveBoard();
     return output;
 }