Skip to main content
. 2022 Oct 18;22(20):7930. doi: 10.3390/s22207930
Algorithm1: Load balance based on GA
  • 1.

    Input: Trabij;BWi;PBi;AijTiδ,PAijTiδ,δ=1 h;

  • 2.

    Output: Aij_best,fitness_best

  • 3.

    Create a population matrix PopulationN,k;

  • 4.

    forifrom 1 to N

  • 5.

    Populationi,:rand (Aij)

  • 6.

    Tratotalj=1kTrabij×Populationi,k

  • 7.

    T_delayaveTratotalBWi×k

  • 8.

    fitnessik1×Tratotalk2T_delayave

  • 9.

    end for

  • 10.

    Row vectors in matrix PopulationN,k sorted by fitness in descending order

  • 11.

    fitnessave=1N×i=1N fitnessi

  • 12.

    Perform crossover operations Crossover Populationi,:

  • 13.

    Perform mutation operations MutationPopulationi,:

  • 14.

    forifrom 1 to end

  • 15.

    Tratotalj=1kTrabij×Populationi,k

  • 16.

    T_delayaveTratotalBWi×j=1kPopulationi,k

  • 17.

    fitnessk1×Tratotalk2T_delayave

  • 18.

    end for

  • 19.

    Row vectors in matrix Populationend,k sorted by fitness in descending order

  • 20.

    Tournament selects N rows to form a new population matrix

  • 21.

    if reach the maximum evolution generation then

  • 22.

    Aij_bestPopulation1,:

  • 23.

    fitness_bestfitnessPopulation1,:

  • 24.

    else

  • 25.

    Go to step 11

  • 26.

    end if