Exemplo n.º 1
0
        //The data of the current generation is saved in a log file
        private void SaveCurrentGeneration()
        {
            TetrisGeneration currentGeneration = new TetrisGeneration();

            currentGeneration.genIndex    = generation;
            currentGeneration.bestScore   = best.GetScore();
            currentGeneration.bestWeights = best.GetWeights();

            currentGeneration.scoreMean = scoreSum / population.Count;

            currentGeneration.pieces = best.GetPieces();
            currentGeneration.level  = best.GetLevel();
            currentGeneration.lines  = best.GetLines();

            LogWriter.WriteGeneration(botVersion, currentGeneration);
        }