Skip to main content
. 2020 Aug 10;22(8):876. doi: 10.3390/e22080876
Algorithm 4 Update function
  • 1:

    input:P(t),indc;                      ▹ the sub-populations P(t)

  • 2:

    output:P(t+1);                     ▹ the new sub-population P(t+1)

  • 3:

    [o1,o2] generate new offspring by crossover from the indc and best individual of P(t);

  • 4:

    P(t+1){o1,o2};

  • 5:

    while|P(t+1)|<|P(t)|do                ▹ keep the number of individuals in the P

  • 6:

        p1 select an individual at random among the indc and best individual of the P(t);

  • 7:

        p2 select an individual at random among remaining individuals of P(t);

  • 8:

        [o1,o2] generate new offspring by crossover from the p1 and p2;

  • 9:

        P(t+1)P(t+1){o1,o2};

  • 10:

    end while

  • 11:

    P(t+1) run a mutation on overlapping individuals;