
Particle Swarm Optimization Implementation 133
switch (fun_type)
{
case G1_MIN:
g1_min(); break;
case G1_MAX:
g1_max(); break;
case G7_MIN:
g7_min(); break;
case G7_MAX:
g7_max(); break;
case G9_MIN:
g9_min(); break;
case G9_MAX:
g9_max(); break;
case F6:
f6(); break;
case PARABOLIC:
parabolic(); break;
case ROSENBROCK:
rosenbrock(); break;
case RASTRIGRIN:
rastrigrin(); break;
case GRIEWANK:
griewank(); break;
default: break;
}
}
The PSO UPDATE LOCAL BEST State
In this state, the handler routine, as shown in Listing 4.26, first checks whether it’s a
minimization or a maximization problem according to the current PSO’s optimiza-
tion type so that the implementation can be ...