示例#1
0
    public void CloseGeneration()
    {
        AdvancingGeneration = true;
        EndCurrentSubject();
        int pop_size = Population.Count;

        Population = Evolution.Cull(Population, ElitePercentage);
        Debug.Log("  -------------------    Generation Results   -------------------\n");
        for (int i = 0; i < Population.Count; i += 2)
        {
            string print = $"{Population[i].fitness}";
            if (i + 1 < Population.Count)
            {
                print += $"\n{Population[i + 1].fitness}";
            }
            Debug.Log(print);
        }
        Population = Evolution.Breed(Population, pop_size, MutationFactor, MutationChance, RandomChildChance);
    }