# Hybrid Artificial Protozoa-Based JADE for Attack Detection
## 3 Hybrid APO-JADE Optimization Algorithm
### Algorithm Framework
#### 3.1.3 Hybrid Approach  
The hybrid APO-JADE algorithm integrates these two methodologies to create a robust optimization framework. The key steps in the algorithm are outlined below:  
* **Initialization**: A population of candidate solutions is generated uniformly within the defined lower and upper bounds, ensuring a diverse starting point. * **Behavioral Strategy Selection**: Each individual in the population randomly selects one of the APO-inspired behaviors (foraging, dormancy, reproduction, autotrophy, heterotrophy) in each iteration. * **Adaptive Parameter Adjustment**: JADE's adaptive mechanisms are applied to adjust \(CR\) and \(F\), enhancing the search capabilities. * **Crossover and Mutation**: The selected APO behavior and JADE's crossover method are used to generate new candidate solutions. * **Fitness Evaluation**: New candidate solutions are evaluated using the objective function. * **Selection and Archive Update**: Individuals are replaced with better-performing candidates, and an archive of replaced solutions is maintained to preserve diversity and guide parameter adjustments. * **Parameter Adaptation**: \(CR\) and \(F\) are updated based on the performance of the archive solutions, ensuring the algorithm remains adaptable throughout the optimization process. * **Repeat**: The process continues for a predefined number of iterations or until convergence criteria are met. This hybrid framework allows the algorithm to effectively explore the search space using APO's diverse behaviors while dynamically adjusting search parameters using JADE's adaptive mechanisms. The combination of these strategies aims to achieve superior convergence rates and solution accuracy across a variety of optimization problems. Initialization  
The algorithm begins by initializing a population of candidate solutions uniformly within the defined lower and upper bounds. This ensures a diverse starting point for the optimization process, which is critical for effective exploration. Let  
* **P** be the population matrix of size \(\text{pop}\times\text{dim}\);
* **lb** and **ub** be the lower and upper bounds, respectively. The initialization is defined as shown in Equation (7):  
\[\textbf{P}_{i}=\textbf{lb}+\textbf{r}_{i}\cdot(\textbf{ub}-\textbf{lb}) \tag{7}\]  
where \(\textbf{r}_{i}\) is a random vector with values uniformly distributed in \([0,1]\). Behavioral Strategies  
The hybrid algorithm incorporates five distinct behaviors inspired by APO. Foraging  
Individuals adjust their positions based on a randomly chosen peer, promoting exploration as shown in Equation (8). \[\textbf{x}_{\text{new}}=\textbf{x}_{i}+F\cdot(\textbf{x}_{j}-\textbf{x}_{i}) \tag{8}\]  
where \(j\) is a randomly chosen index different from \(i\). Dormancy  
Individuals randomly relocate within the search space, enhancing diversity as shown in Equation (9). \[\textbf{x}_{\text{new}}=\textbf{lb}+\textbf{r}\cdot(\textbf{ub}-\textbf{lb}) \tag{9}\]  
where **r** is a random vector with values uniformly distributed in \([0,1]\). Reproduction  
Individuals generate new positions based on Gaussian perturbations, enabling localized exploration as shown in Equation (10). \[\textbf{x}_{\text{new}}=\textbf{x}_{i}+\textbf{N}(0,1)\cdot(\textbf{ub}- \textbf{lb})\cdot F \tag{10}\]  
where \(\textbf{N}(0,1)\) represents a vector of normally distributed random variables. Autotroph  
Individuals adjust positions toward a selected peer, balancing exploration and exploitation as shown in Equation (11). \[\textbf{x}_{\text{new}}=\textbf{x}_{i}+F\cdot(\textbf{x}_{j}-\textbf{x}_{i}) \tag{11}\]  
where \(j\) is a randomly chosen index different from \(i\). Heterotroph  
Individuals move based on differences between two peers, promoting diverse search patterns as shown in Equation (12). \[\textbf{x}_{\text{new}}=\textbf{x}_{i}+F\cdot(\textbf{x}_{j}-\textbf{x}_{k}) \tag{12}\]  
where \(j\) and \(k\) are randomly chosen indices different from \(i\) and each other.