Skip to main content
. 2019 Jun 22;21(6):617. doi: 10.3390/e21060617
Algorithm 2: Proposed PSO algorithm
  Input: popSize, maxIte
  • 1:

    initialize φ1, φ2, φ3 and φ4

  • 2:

    initialize limit1j,upper, limit1j,lower, limit2j,upper and limit2j,lowerj=1..n

  • 3:

    initialize limit3j,upper, limit3j,lower, limit4j,upper, limit4j,lowerj=1..n

  • 4:

    create swarm population with size maxIte

  • 5:

    repeat

  • 6:

     adjust inertia factor value according to Equation (9)

  • 7:

    for all i=1..popSize do

  • 8:

      fitIndi calculate particle pi fitness according to Equation (10)

  • 9:

      if fitIndi>fitBestIndi then

  • 10:

       fitBestIndi=fitIndi

  • 11:

      end if

  • 12:

    end for

  • 13:

    for all i=1..popSize do

  • 14:

      retrieve best particle from neighborhood

  • 15:

      update speed according to Equations (1)–(4) and (7) to binary and continuous part respectively

  • 16:

      modify particle pi position according to Equations (6) and (8)

  • 17:

    end for

  • 18:

    until reaching maxIte iterations

  • 19:

    return solution of best particle in population

  Output: The particle with the last best fitness value