Ejemplo n.º 1
0
        public void TestChromosomeClone()
        {
            // Use the Assert class to test conditions
            var chromosome = new LevelChunkChromosome(10);

            Assert.AreEqual(chromosome, chromosome.Clone());
        }
Ejemplo n.º 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);
        }