# Stochastic Model Predictive Control for Urban Traffic Networks
## 4 Optimization Method
### Hybrid Intelligent Algorithm  
Over the past several decades, genetic algorithms (GAs) have been widely used in the area of management science, operational research and industrial and system engineering. GAs are a class of powerful and broadly applicable stochastic search and optimization methods that really work for many problems that are difficult to be solved by conventional techniques [28; 31; 39]. As pointed out in [38], the major advantage of GAs is that it is independent of the concave-convex feature of the particular problem being analyzed. GAs require only an objective (fitness) function that can be evaluated for any set of the decision variables. This function can be nonlinear, non-differentiable, or discontinuous. In other words, as a global optimization method, genetic algorithm (GAs) can be implemented to solve the optimization problems (17). As a result, in this paper, we embed the stochastic simulation and neural networks (NNs) into a genetic algorithm (GA) and produce a hybrid intelligent algorithm (HIA). The procedure of the proposed method HIA is summarized as shown in Algorithm 2. GAs with the basic evaluation, selection, crossover and mutation operators is employed. The first step of GAs is to generate an initial population. According to the objective function defined in Equation (17), it can be easily found that the task of HIA is to get the best control decision serial \([\mathbf{u}(k_{0}|k_{0}),\cdots,\mathbf{u}(k_{0}+P-1|k_{0})]\) at each control step \(k_{0}\). Since the size of each vector of the decision serial is assumed to be equal to \(m\), \(m*P\) variables are needed to be optimized at the beginning of each control step. Each variable is coded with \(L\) digits of binary number. The length \(L\) is determined by the desired representation accuracy [38]. Although there are a number of ways to make selections, a nonlinear selection strategy is adopted in this study. It is worth noting that the feasibility of the offspring individuals (generated by crossover operation or mutation operation) should be checked with a neural network created by Algorithm 1. In addition, to help readers to better understand the main idea of the proposed algorithm HIA, Figure 2 illustrates the scheme diagram of HIA. ```
**Algorithm 2** Hybrid Intelligent Algorithm
``` Step 1: (Generate Training Data) Using Algorithm 1 to generate a set of input-output data for the uncertain function (23). For example, \((\mathbf{x},\mathbf{u})\rightarrow\mathbf{P}\{0\leq\varphi(\mathbf{x},\mathbf{u}, \boldsymbol{\Theta})\leq\mathbf{N}\},\qquad(\mathbf{x},\mathbf{u})\to E \big{[}f(\mathbf{x},\mathbf{u})\big{]}\). Step 2: (Train Neural Network) Using the set of input-output data generated at Step 1 to train a neural network to approximate the uncertain function (23). Step 3: (Initialize Population) Initialize a population \(Pop\) (contains \(N\) individuals) in which each individual should be checked by the trained neural network. Step 4: (Evaluate) Using the trained neural network and Equations (17) and (18) to calculate the objective function value (fitness) of each individual in the population \(Pop\). Meanwhile, save the fitness of each individual into a set \(E\). Step 5: (Select) Select \(2*m\) individuals from the population \(Pop\) according to the fitness set \(E\) and previously defined crossover rate \(CroRate\), and save them into a set \(SelPop\). Randomly divide the set \(SelPop\) into two groups (\(G_{1}\) and \(G_{2}\)) of the same size \(m\). Step 6: (Crossover) Randomly select two individuals (one from \(G_{1}\) and the other from \(G_{2}\)). Perform the crossover operations on these two individuals to produce two new individuals whose feasibility should be checked by the trained neural network. Repeat the select operation and the cross operation \(m\) times. At the same time, use these new individuals (produced in the cross process) to replace the original \(2*m\) individuals (selected at Step 5) in population \(Pop\).