public void ItCanUseUnorderedGenes() { var configuration = GATestHelper.GetTravelingSalesmanDefaultConfiguration(); configuration.GeneSize = 11; var pool = PopulationGenerator.GenerateUnorderedPopulation(configuration, typeof(PhraseGene)); var population = new UnorderedPopulation(GATestHelper.GetTravelingSalesmanDefaultConfiguration(), _pool, typeof(PhraseGene)); Assert.IsNotNull(population.Configuration); Assert.IsNotNull(population.Chromosomes); }
public void ItCanAddToTheNextGeneration() { var config = GetUnorderedConfiguration(); var population = GetUnorderedChromosomes(config); var up = new UnorderedPopulation(config, population, typeof(PhraseGene)); Assert.IsNotNull(up); up.AddToNextGeneration(population[0]); Assert.AreEqual(1, up.NextGeneration.Count); Assert.AreEqual(0, up.OptionsInPool.Count); }