Skip to main content
. 2024 Oct 19;9(10):643. doi: 10.3390/biomimetics9100643
Algorithm 2 hill–valley
Input:
      p1,p2–two individuals;
Output:
  • valleyExists–a Boolean value indicating whether there is a valley between the two individuals;

  • 1:

    valleyExists False;

  • 2:

    for each tSamples (Samples is a fixed array of real values within [0, 1]) do

  • 3:

       p3p1+(p2p1)·t;

  • 4:

       if fit(p3)<min{fit(p1),fit(p2)} then

  • 5:

         valleyExists True;

  • 6:

         break;

  • 7:

       end if

  • 8:

    end for