Esempio n. 1
0
 def test_sixpeaks_r_gt0():
     """Test SixPeaks fitness function for the case where R>0 and max>0"""
     state = np.array([1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0])
     assert SixPeaks(t_pct=0.15).evaluate(state) == 16
Esempio n. 2
0
 def test_sixpeaks_r0_max0():
     """Test SixPeaks fitness function for the case where R=0 and max=0"""
     state = np.array([0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1])
     assert SixPeaks(t_pct=0.30).evaluate(state) == 0
Esempio n. 3
0
 def test_sixpeaks_r_gt0_max2():
     """Test SixPeaks fitness function for the case where R>0 and max>0
     based on the second condition"""
     state = np.array([0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1])
     assert SixPeaks(t_pct=0.15).evaluate(state) == 16