コード例 #1
0
ファイル: test_fitness.py プロジェクト: zemerica/mlrose
 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
コード例 #2
0
ファイル: test_fitness.py プロジェクト: zemerica/mlrose
 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
コード例 #3
0
ファイル: test_fitness.py プロジェクト: kelvinheng92/CS7641
 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