示例#1
0
 def test_gene_non_mutation(self):
     gene = Gene(1, 2, True)
     gene.mutate(mutation_chance=0.2, mutation_seed=2)
     self.assertTrue(gene.is_active)
示例#2
0
 def test_gene_mutation_multiple_choice_pool(self):
     gene = Gene(1, 2, True)
     gene.mutate(mutation_chance=0.0)
     self.assertTrue(gene.is_active)
示例#3
0
 def test_gene_mutation_with_chance(self):
     gene = Gene(1, 2, True)
     gene.mutate(mutation_chance=0.2, mutation_seed=1)
     self.assertFalse(gene.is_active)
示例#4
0
 def test_gene_mutation(self):
     gene = Gene(1, 2, False)
     gene.mutate(mutation_chance=1.0)
     self.assertTrue(gene.is_active)