Example #1
0
 def test_max_run_end():
     """Test max_run function for case where run is at the end of the
     state"""
     state = np.array([1, 1, 1, 1, 0, 1, 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1])
     assert ContinuousPeaks.max_run(1, state) == 9
Example #2
0
    def test_continuouspeaks_r_gt():
        """Test ContinuousPeaks fitness function for case when R > 0."""
        state = np.array([0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1])

        assert ContinuousPeaks(t_pct=0.15).evaluate(state) == 17
Example #3
0
 def test_max_run_middle():
     """Test max_run function for case where run is in the middle of the
     state"""
     state = np.array([1, 1, 1, 1, 0, 1, 0, 2, 1, 1, 1, 1, 1, 4, 6, 1, 1])
     assert ContinuousPeaks.max_run(1, state) == 5