Skip to main content
. 2019 Jun 18;21(6):602. doi: 10.3390/e21060602
Algorithm 3 Competition function.
  • 1:

    input:C,F,Ec,Ef,mc,mf;               ▹ fitness values for each group Ec,Ef

  • 2:

    output:C,F,mc,mf;                ▹ changed particles via competitions C,F

  • 3:

    wc0;

  • 4:

    lc0;

  • 5:

    fork=1 to min([mc,mf]) do               ▹ set the number of competitions

  • 6:

        if max(Ec)>max(Ef) then

  • 7:

            wcwc+1;              ▹ add one whenever evolution-based particle wins

  • 8:

        else if max(Ec)<max(Ef) and mclc+1 then

  • 9:

            lclc+1;               ▹ add one whenever evolution-based particle loses

  • 10:

            j{j|x{[1,mf]Zj},Ef(j)>Ef(x)};

  • 11:

            Ef(j);               ▹ exclude winning particle at next competition

  • 12:

        end if

  • 13:

    end for

  • 14:

    fork=1 to wc do

  • 15:

        j{y|x{[1,mf]Zy},Ef(y)<Ef(x)};

  • 16:

        delete Fj;                    ▹ delete the particle with low fitness value

  • 17:

        Cend+1 a new particle;                    ▹ use uniform distribution

  • 18:

    end for

  • 19:

    fork=1 to lc do

  • 20:

        j{y|x{[1,mc]Zy},Ec(y)<Ec(x)};

  • 21:

        delete Cj;

  • 22:

        Fend+1 a new particle;                ▹ use score vector for feature filter

  • 23:

    end for

  • 24:

    mcmc+wclc;

  • 25:

    mfmf+lcwc;