## 2 Modelling, Analysis and Optimization of a System
### Optimization: Artificial Bee Colony
\begin{array}{l}\frac{1}{1+\bar{ \mathrm{f}}_{\bar{\mathrm{i}}}},\mathrm{f}_{\bar{\mathrm{i}}}\geq 0\\ 1+|\mathrm{f}_{\bar{\mathrm{i}}}|,\mathrm{f}_{\bar{\mathrm{i}}}<0\end{array} \right. \tag{12}\]  
where \(\mathrm{f}_{\bar{\mathrm{i}}}\) is the cost values of the solution of the \(v_{\bar{\mathrm{i}}}\) source. Depending on the nectar amounts between \(x_{\bar{\mathrm{i}}}\) and \(v_{\bar{\mathrm{i}}}\), in other words the fit, a greedy selection process is applied. If the newly found \(v_{\bar{\mathrm{i}}}\) solution is better, the location of the old food source is wiped from the duty bee's memory and the location of \(v_{\bar{\mathrm{i}}}\) source is noted. Otherwise, the worker bee continues going to \(x_{\bar{\mathrm{i}}}\) source and as the \(x_{\bar{\mathrm{i}}}\) solution was not developed the failure counter (failure\({}_{\bar{\mathrm{i}}}\)) for this source increases by one; if it succeeds the counter resets to zero. After all worker bees have completed one cycle of research, they return to the hive and transmit information about nectar amounts of sources to observer bees. An observer bee uses the information transmitted by the dance to choose a region (source) in accordance with the nectar amount of the food source. This is an example of the ABC algorithm displaying multiple interactions. The probabilistic selection process is made by using the fit values equivalent to the nectar amounts in the algorithm. The basis of the selection process linked to fit value in the ABC algorithm is completed using a roulette wheel. The angle of each section of the wheel is proportional to the fit value. That is, the fit value of a food source as a proportion to the total fit value of all sources expresses the relative selection probability for that source compared to other sources:  
\[\mathrm{P_{i}}=\frac{\mathrm{fitness_{i}}}{\sum_{j=1}^{\mathrm{SN}}\mathrm{ fitness_{j}}} \tag{13}\]  
According to the probability calculation process, as the amount of nectar in a source increases (as the degree of fit increases), the number of observer bees selecting this region will increase. This characteristic shows that the ABC displays similar behaviour to the positive feedback characteristics revealed by natural bee behaviour. After the probability values of the algorithm are calculated, these values are used to produce a random number in the [0, 1] interval for each source in the selection process according to roulette wheel. If the \(\mathrm{p_{i}}\) value is larger than this produced number, worker bees use Equation (11) like observer bees and produce a new solution for this source region. The new solution is assessed and the quality is calculated. Later the fit of the new solution is compared with the old solution and the better one is chosen by using the greedy selection process. If the new solution is better, this solution is replaced by the old solution and the failure counter is set to zero. Conversely, if the fit of the old solution is better, this solution is retained and the failure counter increases by one. This process continues until all observer bees are assigned to a food source region. At the end of a cycle, all worker bees and observer bees have completed search processes and the solution failure counters are checked. Whether a bee benefitted from a source or not, in other words whether the nectar at that point has been consumed or not, is known from the solution failure counter. If the solution failure counter of a source is above a certain threshold value, the duty bee for that source should have left that consumed solution and started to search for another one. This means that the worker bee for a consumed source should become an explorer bee. The threshold value used to determine whether a source is consumed is an important control parameter for the ABC algorithm and is called the \"limit\". For each cycle of a basic ABC algorithm, only one explorer bee is allowed out.