Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void GetOutbreed_returns_valid_strategy()
        {
            var initialStrategies = new List <Strategy>();

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

            var strategies = crossover.GetOutbreed(initialStrategies);

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