Esempio n. 1
0
        public void GetChampionTest_AfterFitnessAdjustment()
        {
            Genome gen1 = new Genome(r); gen1.ParentSimulation = sim; gen1.Fitness = 1.0f;
            Genome gen2 = new Genome(r); gen2.ParentSimulation = sim; gen2.Fitness = 2.0f;
            Genome gen3 = new Genome(r); gen3.ParentSimulation = sim; gen3.Fitness = 3.0f;

            species.Genomes.AddRange(new Genome[] { gen1, gen2, gen3 });
            species.AdjustFitness();

            Assert.IsTrue(species.GetChampion() == gen3);
        }