*Application of Ant Colony Optimization for Co-Design of Hybrid Electric Vehicles DOI: http://dx.doi.org/10.5772/intechopen.97559*

In this regard, first in pheromone representation stage the algorithm uniformly and in a random manner initializes the solution archive of *k* solutions where each solution is a D-dimensional vector for *xi* ∈½ � *x*min, *x*max where *i* ¼ 1, 2, … , *D:* The archived solutions are sorted based on their quality (best to worth). In the probabilistic construction stage a solution (i.e. *S <sup>j</sup>*) for *j th* solution will be selected considering the choosing probability *pj* defined by a Gaussian probability function where each solution *S <sup>j</sup>* is corresponded to its weight *wj*, mathematically expressed as follows [19, 20]:

$$w\_j = \frac{1}{qk\sqrt{2\pi}} \exp\left(\frac{-(rank(j)-1)^2}{2q^2k^2}\right) \tag{14}$$

$$p\_j = \frac{w\_j}{\sum\_{a=1}^{k} w\_a} \tag{15}$$

In this regard, the better solutions would get higher choosing chances. Correspondingly, *rank j* ð Þ is the rank of sorted solution *S <sup>j</sup>*, and the intensification factor (selection pressure factor), *q*, is a modifiable algorithm parameter dealing with uniformity of the probability function while larger *q* values make the probability function more uniform. A solution would be chosen based on the probabilistic approach and new candidate solutions are generated as the algorithm samples neighborhood of *ith* decision variable, *Si guide*, using the Gaussian function *G* (see **Figure 7**) with mean *μ<sup>i</sup> guide* <sup>¼</sup> *<sup>S</sup><sup>i</sup> guide* and standard deviation *σ<sup>i</sup> guide* values as follows [21]:

$$\sigma\_{guide}^{i} = \xi \sum\_{r=1}^{k} \frac{\left| \mathbf{S}\_{r}^{i} - \mathbf{S}\_{guide}^{i} \right|}{k - 1} \tag{16}$$

It calculates the average distance value of the *ith* component of *Sguide* and the values of the *ith* components of solutions in the archive. Here the multiplier *ξ*>0 is

**Figure 7.** *The solution archive and the Gaussian functions used in ACOR [21].*

the user-specified pheromone evaporation rate parameter affecting the convergence while lower *ξ* values lead to lower convergence speed.

In the phoremone update phase, the process repeates for *Na* (number of ants) times while appending the new generated solutions to the *k* solutions of the archive, to incrementally sort *k* þ *Na* solutions and remove the worst solutions. Therefore, before a next iteration starts, the algorithm updates the archive keeping only the best *k* solution and discarding the worst ones having the archive size unchanged. For a considered number of itterations, the algorithm runs till reaching a stoping

**Figure 8.** *General flowchart of the algorithm for the inner loops of the nested framework [22].*

*Application of Ant Colony Optimization for Co-Design of Hybrid Electric Vehicles DOI: http://dx.doi.org/10.5772/intechopen.97559*

criteria to eventually select the best solution among the the evaluated positions. **Figure 8** provides the algorithm flowchart for the elaborated procedures.
