## 3 Methodology  
### Theoretical Background of Store-and-Forward Modeling  
The cell transmission model is the backbone, over which the freeway traffic control is founded. It originates from the works of [34] and was sequentially improved and complicated in [35; 36]. In [37], traffic modeling was performed in the case of dynamical variation optimization. The cell transmission model decomposes the route on sequential of cells, \(i-1\), \(i\), \(i+1\), which have appropriate parameters, given in Figure 1. In this model, the outgoing flow of the \(i^{\text{th}}\) cell is equal to the incoming flow of the \((i+1)^{\text{th}}\) cell or \(q_{i}^{out}(t)=q_{i+1}^{in}(t)\).  
The sequence of cells substitutes the distance \(x\) with the number \(i\) of the cell. The parameters which characterize the cell are:  
* \(q_{i}(t)\)--input flow of the vehicles in time \(t\), [veh/time];
* \(n_{i}(t)\)--the number of vehicles in the cell \(i\) at time \(t\), [veh];
* \(\rho_{i}(t)\)--the density of the traffic flow in time \(t\), [veh/distance].  
The cell transmission model is based on the relation for flow continuity in liquids:  
\[\frac{\partial q}{\partial x}+\ \frac{\partial\rho}{\partial t}=0. \tag{1}\]  
Figure 1: Cell element and its characteristics.  
This general relation is substituted by the increase of each partial derivative or:  
\[\frac{\partial\rho}{\partial t}\ \approx\frac{\Delta\rho}{\Delta t}=\frac{\rho_{i}(t+1)- \rho_{i}(t)}{T}, \tag{2}\]  
where \(\rho\) has dimension \(\left[\frac{vch}{km}\right]\):  
\[\frac{\partial q}{\partial x}\ \approx\frac{\Delta q}{\Delta x}=\frac{q(t+1)-q_{i} (t)}{\Delta x}\ =\frac{q(t+1)-q_{i}(t)}{l_{i}},\]  
where \(q_{i},\ q_{i\_1}\) have dimension \(\left[\frac{vch}{h}\right]\).  
If \(\Delta t\) is the control step in discrete time, then \(T\) is the duration of the control cycle. The cell length \(l_{i}\) corresponds to the number of cells in the transmission model. In general, \(l_{i}\) [km] is the length of the cell.  
The difference between the flow densities \(\left[\rho_{i}(t+1)-\rho_{i}(t)\right]\) is numerically expressed by the difference of the number of vehicles \(n_{i}(t)\), which enter and leave the cell with length \(l_{i}\) or:  
\[\frac{\Delta\rho}{\Delta t}=\frac{\rho_{i}(t+1)-\rho_{i}(t)}{T}=\frac{n_{i+1} (t)-n_{i}(t)}{l_{i}}. \tag{3}\]  
Hence, using Equations (2) and (3), it follows:  
\[\frac{\rho_{i}(t+1)-\rho_{i}(t)}{T_{i}}=\frac{q_{i}(t+1)-q_{i}(t)}{l_{i}}\]  
or:  
\[\rho_{i}(t+1)=\rho_{i}(t)+\frac{T_{i}}{l_{i}}\ [q_{i}(t)-q_{i+1}(t)]\ \ \ [\text{veh}/ \text{km}] \tag{4}\]  
Because the density is equal to the number of vehicles for a distance \(l\) (\(\rho=n/l\)), Equation (4) takes the form of:  
\[\frac{n_{i}(t+1)-n_{i}(t)}{T_{i}l_{i}}=\frac{q_{i}(t+1)-q_{i}(t)}{l_{i}}\]  
or:  
\[n_{i}(t+1)=n(t)+T_{i}\ [q_{i}(t)-q_{i+1}(t)]\ \ \ [\text{veh}]. \tag{5}\]  
Equation (4) is the main one, which is applied in the LWR (Lighthill-Whitham-Richards) [38; 39] modeling for the ramp metering control. Equation (5) is used for the application of store-and-forward modeling.  
Our research uses the last relation. Due to its simplicity, it is applied in analytically defined traffic control problems. Unfortunately, the size of the network makes the overall optimization problem quite difficult due to the mutual interconnections between the transport crossroads. The meaning of the term \(T_{i}q_{i}(t)\) concerns the inflow in a junction, and the corresponding \(T_{i}q_{i+1}(t)\) refers to the outgoing flow. These terms can be expressed with the green phases and cycle durations in a control problem. Our approach is to decompose these control relations in a bi-level formal description. This can give an opportunity to define an optimization problem, which optimizes simultaneously both variables as green lights and cycle durations according to different goal functions in a hierarchical order.