# A Division-of-Labour Approach to Traffic Light Scheduling
## 3 Division-of-Labour Model for Traffic Light Scheduling  
The developed division-of-labour-based traffic scheduling algorithm is designed for use in a complex intersection with multiple traffic phases. The single task-allocation model is used where the next traffic phase in the cycle is represented as the task. The probability of the traffic phase changing every second is calculated as  
\[P= \begin{cases}\frac{(\tilde{s}\times\tilde{s}_{f})^{\omega}}{(\tilde{s}\times \tilde{s}_{f})^{\omega}+(\frac{\tilde{s}}{\tilde{s}\times\tilde{s}_{f}}\times L +\theta\times\tilde{s}_{f})^{\omega}}&\text{if $s+\theta\
eq 0$}\\ 0&\text{if $s+\theta=0$}\end{cases}  \tag{4}\]  
where \(\tilde{s}=\frac{s}{n-1}\) and \(\omega=2+\frac{s+\theta}{c}\). The number of traffic phases in the cycle is represented as \(n\). The number of stationary vehicles waiting for the traffic phase to change is represented as \(s\), and \(\theta\) is the number of vehicles that will become stationary if the traffic phase were to change. The saturation flow rate is represented as \(s_{f}\), and \(L\) is the time lost when the traffic phase changes, which includes the yellow light duration in seconds, the number of seconds where all traffic lights are red, and the time lost while the vehicles accelerate. The variable \(c\) is a parameter that sets how sensitive the steepness threshold is to the total traffic volume around the intersection. The variables \(\tilde{s}\) and \(\theta\) are scaled with the saturation flow rate \(s_{f}\) to allow these variables to be compared to the time lost when the traffic phase changes, \(L\). The variable \(\tilde{s}\) represents the average number of vehicles per phase not currently allocated the green light. The stimulus value, \(s_{j}\), in Equation (1) is thereby set as \(\tilde{s}\times s_{f}\), the time needed to clear the average traffic volume in a phase not currently allocated the green light. The variable \(L\) is scaled with \(\frac{\theta}{\tilde{s}+\theta}\) so that the effect of \(L\) is proportional to the ratio of the number of vehicles shown the green light, and the average number of vehicles per phase not shown the green light. The threshold value, \(\theta_{kj}\), in Equation (1) is thereby set as \(\frac{\theta}{\tilde{s}+\theta}\times L+\theta\times s_{f}\), a representation of the time lost if the traffic phase is changed. A dynamic steepness threshold, \(\omega\), is used to prevent the traffic phase from constantly changing in high-intensity traffic scenarios and allow for some flexibility in lower-intensity traffic scenarios. It was found that a linear relationship exists between the total amount of traffic around the intersection and the most optimal value for \(\omega\), so \(\omega\) is set to be linearly proportional to the total amount of traffic around the intersection, \(s+\theta\). Two is added to \(\frac{\tilde{s}+\theta}{c}\) so that \(\omega\) starts from the default steepness threshold value of two as the total traffic volume increases from zero. The use of probability in every time unit to determine whether the controller should continue to the next phase in the cycle or not is what distinguishes this approach from existing approaches. The developed division-of-labour-based traffic scheduling algorithm is formally described in Algorithm 1. Every timestamp of the phase has a probability \(P\) of not changing, a minimum green light duration, \(t_{\text{min}}\), and a maximum green light duration, \(t_{\text{max}}\). It should be noted that the computational cost of the division-of-labour algorithm is not significant. Most of the cost relates to the calculation of Equation (4), which is a simple calculation for the probability of a traffic phase change for each traffic phase. This results in a \(O(n)\) calculation per time step. Sampling of the resulting probability distribution is also computationally efficient, as illustrated in Algorithm 1, requiring sampling of a random value for each traffic phase.