# Electric Drive with an Adaptive Controller and Wireless Communication System
## 4 Utilization of Artificial Bee Colony Algorithm  
Artificial Bee Colony (Figure 4) is an algorithm inspired by a swarm, which consists of one queen, some male bees called drones, and many female workers. Bees can be divided into three main groups--employed, onlookers, and scouts [61]. The task of each member  
Figure 3: Concept of a series connection of the ADALINE-based elements. of the group is different, but all of them are working for a greater good--their queen and the hive. Before any optimization is performed, the initialization process for the algorithm takes place. A population of \(N\) bees is randomly generated using a pseudo-random generator it is schematically presented in the Figure 4 as a bee hive. Any member of a population should be constrained to the limits of the problem that is solved:  
\[x_{ij}=x_{i}^{lb}+\text{rand}(0,1)(x_{i}^{ub}-x_{i}^{lb}) \tag{37}\]  
where \(i\) is the dimension of a problem, \(j\) is the number of an individual bee, and \(x^{lb}\) and \(x^{ub}\) are the lower and upper bounds of the considered task. In the next step, the fitness function for the whole population is evaluated according to the equation:  
\[fit_{ij}=\left\{ \begin{array}{ll}\frac{1}{1+f_{ij}}&,f_{ij}\geq 0\\ 1+\left|f_{ij}\right|&,f_{ij}<0\end{array} \right. \tag{38}\]  
where \(f_{ij}\) is a fitness function defined by a user, and \(fit_{ij}\) is a benchmark defined in an algorithm itself [62]. Next, the first main part takes place--the employed bees phase (yellow bee), throughout which employed bees are looking for a new solution, using the expression:  
\[x_{ij}^{new}(iter)=x_{ij}(iter)+\phi_{ij}\Big{(}x_{ij}(iter)-x_{kj}(iter)\Big{)} \tag{39}\]  
where \(x_{ij}^{new}\) is a new solution found by an employed bee, \(x_{kj}\) is a randomly selected solution other than \(x_{ij}\), \(iter\) is a number of a current iteration of an algorithm, and \(\phi_{ij}\) is a random number in a range \((-1,1)\). The newly found solution \(x_{ij}^{new}\) is then compared to the old one \(x_{ij}\) according to the fitness value of each solution (38). If a new value is better (lower) than the previous one, it is exchanged so that the better value takes the place of the old one. However, if \(x_{ij}^{new}\) has a higher value, it is deleted from the population (the old value of a \(x_{ij}\) is kept in the population), and the abandoned solution counter (\(AC\)) is incremented. The  
Figure 4: Visualization of the ABC algorithm. next phase starts with a probability calculation which tells if a bee should be exploited in this part. It is done according to a simple equation:  
\[p^{OB}=\frac{fit_{j}}{\sum_{k=1}^{N}fit_{k}} \tag{40}\]  
In the onlooker bees phase (red bee), the solutions with the highest probability are further exploited using an equation similar to (39):  
\[x_{ij}^{new}(iter)=x_{ij}^{POB}(iter)+\phi_{ij}\Big{(}x_{ij}^{POB}(iter)-x_{ kj}(iter)\Big{)} \tag{41}\]  
where \(x_{ij}^{POB}\) is a solution candidate for an onlooker phase with a chosen probability. This takes place until all onlookers find their solution--the food source. \(AC\) is also incremented in this phase. In the scout bees phase (green bee), the abandonment counter can be used. If its value exceeds the set limit, the bee becomes a scout bee, and then it is looking for a new source of food for its hive. In such a case, the Equation (37) is used. The end of the optimization process is evaluated by fulfilling at least one of the following criteria: reaching the maximum number of iterations, exceeding the calculation time, or obtaining small changes in the best value. The complexity of the ABC algorithm is proportional to the number of dimensions of the problem and the size of population, as well as the number of iterations of the main loop of the algorithm. The whole process is presented in Figure 5.  
In this paper, the ABC was used to optimize the coefficients in the input layer of a neural network controller. Examples of different values of \(k_{e}\) and \(k_{I}\) are shown in Figure 6. Only one variable was changed at a time.