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:

    wc←0;

  • 4:

    lc←0;

  • 5:

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

  • 6:

        if max(Ec)>max(Ef) then

  • 7:

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

  • 8:

        else if max(Ec)<max(Ef) and mc≠lc+1 then

  • 9:

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

  • 10:

            j←{j|∀x∈{[1,mf]∩Z∖j},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]∩Z∖y},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]∩Z∖y},Ec(y)<Ec(x)};

  • 21:

        delete Cj;

  • 22:

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

  • 23:

    end for

  • 24:

    mc←mc+wc−lc;

  • 25:

    mf←mf+lc−wc;