
Step-by-step numerical example of global version of CSO algorithm 65
104 Gbest [ j ] = P[ TheBest ] [ j ] ;
105 }
106 EvalGbest = Eval [ TheBest ] ;
107 }
108 }
109 cout << " EvalGBest = " << EvalGbest << en d l ;
110 return 0 ;
111 }
Listing 5.4
Source-code of the global version of the CSO in C++.
5.5 Step-by-step numerical example of global version of
CSO algorithm
In the first step let us assume that we want to minimize an objective function
OF (.) given by equation 5.10, where M, the number of dimensions, is equal
to 5.
In the second step we determine the parameter values of the CSO algorithm
such as N = 6, MR = 0.2, SMP = 5, SRD = 0.2, CDC = 3, MAX = 100 ...