Skip to main content
. 2023 Mar 20;23(6):3293. doi: 10.3390/s23063293
Algorithm 1 Pseudo-code for GA.
  • 1:

    Determine Objective Function f(x).

  • 2:

    Assign the number of generations to 0 (t=0).

  • 3:

    Randomly create individuals in initial population P(t).

  • 4:

    Evaluate individuals in population P(t) using f(x).

  • 5:

    while Termination criterion is not satisfied do

  • 6:

        t=t+1

  • 7:

        Select the individuals to population P(t) from P(t−1).

  • 8:

        Change individuals of P(t) using crossover and mutation.

  • 9:

        Evaluate individuals in population P(t) using f(x).

  • 10:

    end while

  • 11:

    Return the best individual found during the evolution.