예제 #1
0
 def test_combine_half_and_half(self):
     g1 = Multiplier(0.333)
     g2 = Constant(20.2)
     self.assertEqual(6.7266, Genome.combine(g1, g2))
     # order shouldn't matter
     self.assertEqual(6.7266, Genome.combine(g2, g1))
예제 #2
0
 def test_combine_two_multiply(self):
     g1 = Multiplier(0.23)
     g2 = Multiplier(4.2)
     self.assertEqual(1, Genome.combine(g1, g2))
예제 #3
0
 def test_combine_two_constant(self):
     g1 = Constant(15.1)
     g2 = Constant(20.2)
     self.assertEqual(20.2, Genome.combine(g1, g2))