Example #1
0
        public void ItCanDetermineIfAChromosomeItShouldRetireByAge()
        {
            _config.RetirementStrategy = RetirementStrategy.MaxAge;
            var chromosome = new OrderedChromosome(8);

            chromosome.Age = 10;

            Assert.AreEqual(true, chromosome.ShouldRetire(_config));
        }
Example #2
0
        public void ItCanDetermineIfAChromosomeItShouldRetireByChildrenSired()
        {
            _config.RetirementStrategy = RetirementStrategy.MaxChildren;
            _config.MaxRetirement      = 9;
            var chromosome = new OrderedChromosome(8);

            chromosome.Age      = 0;
            chromosome.Children = 100;

            Assert.AreEqual(true, chromosome.ShouldRetire(_config));
        }