Skip to main content
. 2022 Oct 18;22(20):7930. doi: 10.3390/s22207930
Algorithm 2: Crossover
  • 1.

    Input: PopulationN,k;fitnessave;fitnessi; AijTiδ,PAijTiδ,δ=1 h;

  • 2.

    Output:Populationend,k;

  • 3.

    i=1

  • 4.

    while i N do

  • 5.

    iffitnessifitnessave then

  • 6.

    ifrandPacr0×fitnessmaxfitnessfitnessmaxfitnessave then

  • 7.

    Randomly choose a crossover starting node

  • 8.

    Randomly choose the crossover length

  • 9.

    Populationi,k perform a crossover operation with Populationi+1,k

  • 10.

    Sub-individuals are inserted at the end of the population

  • 11.

    i=i+2

  • 12.

    else

  • 13.

    i=i+1

  • 14.

    end if

  • 15.

    else

  • 16.

    ifrandPacr1 then

  • 17.

    Select prior high fitness crossover objects by selection probability

  • 18.

    Randomly choose a crossover starting node

  • 19.

    Randomly choose the crossover length

  • 20.

    Populationi,k perform a crossover operation with AijTiδ

  • 21.

    Sub-individuals are inserted at the end of the population

  • 22.

    i=i+1

  • 23.

    else

  • 24.

    i=i+1

  • 25.

    end if

  • 26.

    end if

  • 27.

    end while