Content deleted Content added
m →Algorithm description: {{nowrap}} for MathML bug. |
|||
Line 13:
'''Begin'''
1) Objective function: {{nowrap|<math>f(\mathbf{x}), \quad \mathbf{x}=(x_1,x_2,...,x_d) </math>;}}
2) Generate an initial population of fireflies {{nowrap|<math> \mathbf{x}_i \quad (i=1,2,\dots,n)</math>;.}}
3) Formulate light intensity
(for example, for maximization problems, {{nowrap|<math>I \propto f(\mathbf{x})</math> or simply <math>I=f(\mathbf{x})</math>;)}}
4) Define absorption coefficient
'''While''' (t < MaxGeneration)
'''for''' i = 1 : n (all n fireflies)
'''for''' j = 1 : n (n fireflies)
{{nowrap|'''if''' (<math>I_j>I_i </math>),
move firefly i towards j;
Vary attractiveness with distance r via {{nowrap|<math> \exp(-\gamma \; r) </math>;}}
Evaluate new solutions and update light intensity;
'''end if'''
|