Beispiel #1
0
        public List <Strategy> CrossoverStrategies(List <Strategy> strategies)
        {
            var result = new List <Strategy>();

            result.AddRange(Crossover.GetPanmixia(strategies));
            result.AddRange(Crossover.GetInbreed(strategies));
            result.AddRange(Crossover.GetOutbreed(strategies));
            return(result);
        }
Beispiel #2
0
        public void GetInbreed_returns_valid_strategy()
        {
            var initialStrategies = new List <Strategy>();

            for (int i = 0; i < config.PopulationSize; i++)
            {
                initialStrategies.Add(StrategiesGenerator.GenerateProgram());
            }

            var strategies = crossover.GetInbreed(initialStrategies);

            foreach (var strategy in strategies)
            {
                Assert.IsTrue(StrategiesGenerator.CheckProgram(strategy.commands));
            }
        }