Skip to main content
. 2024 Aug 6;9(8):476. doi: 10.3390/biomimetics9080476
Algorithm 5 Reproduction
  • 1:

    procedure ReproductionStage(P, k)

  • 2:

        sample GetPopulationSample(P, k)

  • 3:

        parent1 SelectParentTournament(S)

  • 4:

        if parent1 is not null then

  • 5:

            sample GetPopulationSample(P, k)

  • 6:

            parent2 SelectParentTournament(S)

  • 7:

            if parent2 is not null then

  • 8:

               offspring PerformCrossover(parent1, parent2)

  • 9:

               for all child in offspring do

  • 10:

                   AddToEvaluation(child)

  • 11:

               end for

  • 12:

               AddToPopulation(P, parent2)

  • 13:

            end if

  • 14:

            AddToPopulation(P, parent1)

  • 15:

        end if

  • 16:

    end procedure