Skip to main content
. 2024 May 18;9(5):300. doi: 10.3390/biomimetics9050300
Algorithm 1 Pseudocode for the used GA
  • 1:

    Begin

  • 2:

    Select hyperparameters

  • 3:

    Set the initial population P; each individual is a vector with random coefficients corresponding to Equation (12).

  • 4:

    while fitness function ≤ 30,000 do

  • 5:

        Calculate fitness of each individual of P, defined by the Integral Square Error.

  • 6:

        Selection of P members with lower fitness value, according to biological pressure.

  • 7:

        Crossover parents with lowest fitness, using a random single point to create the union.

  • 8:

        Random change of a value in individuals (mutation).

  • 9:

        Generate a new generation of individuals P using elitism and the members with the lowest fitness.

  • 10:

    end while

  • 11:

    Keep the best solution (minimum fitness)

  • 12:

    end