Example #1
0
        public void HammingDistance_On_different_algos_size_2_should_return_0()
        {
            var algo1 = new GeneticProgramming.Simulator.Strategies.Strategy(new List <string> {
                "Backward", "Shoot"
            });
            var algo2 = new GeneticProgramming.Simulator.Strategies.Strategy(new List <string> {
                "Stay", "Forward"
            });
            var result = StrategyGeneticExtensions.HammingDistance(algo1, algo2);

            Assert.AreEqual(0, result);
        }
Example #2
0
        public void FincMostUnlikely_on_3_algos_should_return_algo_with_3_diffeence()
        {
            var algo1 = new GeneticProgramming.Simulator.Strategies.Strategy(new List <string> {
                "Backward", "Backward", "Shoot"
            });
            var algo2 = new GeneticProgramming.Simulator.Strategies.Strategy(new List <string> {
                "Backward", "Backward", "Stay"
            });
            var algo3 = new GeneticProgramming.Simulator.Strategies.Strategy(new List <string> {
                "TurnLeft", "TurnLeft", "TurnLeft"
            });
            var result = algo2.FindMostUnlikely(new List <GeneticProgramming.Simulator.Strategies.Strategy> {
                algo1, algo2, algo3
            });

            CollectionAssert.AreEqual(algo3.commands, result.commands);
        }