예제 #1
0
        public void TestChromosomeClone()
        {
            // Use the Assert class to test conditions
            var chromosome = new LevelChunkChromosome(10);

            Assert.AreEqual(chromosome, chromosome.Clone());
        }
예제 #2
0
        public void TestEquality()
        {
            var fitness = new LevelChunkFitness(0);

            // Use the Assert class to test conditions
            var chromosome = new LevelChunkChromosome(10);

            Assert.LessOrEqual(Mathf.Abs((float)fitness.Evaluate(chromosome)
                                         - (float)fitness.Evaluate(chromosome.Clone())), _errorMargin);
        }