
Source-code of GSO algorithm in C++ 183
87 global n pb
88 bound_lower = 0 ; bound_upper = 0 ; t o s s = rand ; j = 0 ;
89 fo r k = 1 : n
90 bound_lower = bound_upper ; bound_upper = bound_upper + pb ( i , k ) ;
91 i f ( t o s s > bound_lower ) & ( t o s s < bound_upper ) j = k ; break ; end
92 end %−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
93 function Move( i , j ) % Fun : Move .m
94 global A m s t e p1 E l l bound
95 i f ( j ~=0) & ( E l l ( i ) < E l l ( j ) )
96 temp ( i , : ) = A( i , : ) + s t e p 1 ∗Path ( i , j ) ; f l a g = 0 ;
97 for k = 1 : m
98 i f ( temp ( i , k ) < −bound ) | ( temp ( i , k ) > bound ) f l a g =1;break ; end
99 end
100 ...