Skip to main content
. 2017 Dec 19;17(12):2935. doi: 10.3390/s17122935

Table 2.

Pseudocode for executing the QPSO algorithm [18,19].

Initialise the current positions and the Pi_best positions of all the particles
Do
 Calculate mbest in Equation (2)
 Select a suitable value for α
 For particles i = 1 to S
 1. Calculate the fitness value of particle i according to classification accuracy
 2. Update Pi_best and Pglobal in Equation (7)
 3. For dimension 1 to d
φ = rand (0,1)
u = rand (0,1)
 If s = rand (0,1) ≥ 0.5
 update particle positions in Equation (4)
else
 update particle positions in Equation (3)
Until terminal condition is satisfied.