# Research on the Simulation Method of HTTP Traffic Based on GAN
## 3 Materials and Methods
### Evolutionary Algorithms (EAs)  
Evolutionary algorithms (EAs) [22] refer to a class of algorithms that simulate the process of natural selection, where the fittest individuals survive and reproduce while the less fit individuals are eliminated. This class includes well-known algorithms such as genetic algorithms and ant colony optimization [25; 26; 27; 28].  
Genetic algorithms, for example, explore different paths through multiple populations of individuals and iteratively converge towards the optimal solution. EAs are particularly effective in solving highly complex, nonlinear problems, especially those with a single objective. They have achieved notable success in various computational tasks such as deep learning and machine learning.  
In contrast to traditional approaches that rely on a single generator and discriminator, this paper introduced multiple generators and multiple training objectives to overcome the limitations of a single generator and objective. The discriminators simulated the natural environment and selected or retained existing generator models. During the training process, gene mutation was achieved through multiple diverse adversarial objectives. After each training iteration, the top n generators with the best fitness and quality were selected as candidates for the next generation. This method ensured that the genes of the offspring come from the optimal parents.  
This paper adopted three mutation operators proposed by [PERSON] [29] for asexual reproduction to generate the next generation of individuals. Each mutation operator was selected based on different training objectives, aiming to reduce the discrepancy between the generated data and the real data from different perspectives. The three operators were minimax mutation, heuristic mutation, and least-squares mutation, corresponding to different objectives. The formulas for these operators are shown in Equations (5)-(7) respectively.  
\[M_{\text{G}}^{\text{minimax}}=\frac{1}{2}E_{z\sim p_{z}}[\log(1-D(G(z)))] \tag{5}\]  
\[M_{\text{G}}^{\text{heuristic}}=-\frac{1}{2}E_{z\sim p_{z}}[\log(D(G(z)))] \tag{6}\]  
\[M_{\text{G}}^{\text{least-square}}=E_{z\sim p_{z}}[(D(G(z))-1)^{2}] \tag{7}\]  
The minimax mutation, although prone to gradient vanishing issues during generator optimization, effectively reduces the distribution gap between the generated and real data when there is an overlap between the two distributions. On the other hand, the heuristic mutation avoids the problem of gradient vanishing but suffers from training instability, as it tends to push the two distributions apart once the JSD (Jensen-Shannon divergence) becomes negative. The least-squares mutation approaches saturation and tends to converge to a value close to zero when the discriminator output increases. However, it avoids gradient vanishing and reduces the likelihood of mode collapse in other scenarios. The three types of mutations are illustrated in Figure 2.  
As shown in Figure 2, by combining these three types of mutations, we ensured that there was always at least one mutation operator that effectively updated the generator  
Figure 2: The three mutation operators that the generator G receives given the discriminator D.  
during any training stage. This ensured a smooth training process without getting stuck in optimization pitfalls, allowing the generator to continue learning and improving.