# A Novel Multi-Agent-Based Approach for Train Rescheduling in Large-Scale Railway Networks
## 4 Multi-Agent System for Train Rescheduling Problems
### Algorithm Development
#### 4.3.4 Modification  
As the individual generated by crossover and mutation operators may not be feasible with its local operational constraints, a modification operator is applied to ensure the feasibility of the solutions with respect to its network layout and its local knowledge of train operation. The following equations are applied to the modification operator:  
\[\left\{\begin{array}{l}\textbf{IF}\ t_{\tau_{m}}^{lm}<t_{\tau_{m}}^{b}+t_{ \tau_{m}}^{b_{Jm}}\\ \textbf{THEN}\ t_{\tau_{m}}^{lm}=t_{\tau_{m}}^{b}+t_{\tau_{m}}^{b_{Jm}},\ J_{m} \in\mathbb{J},\ \tau_{m}\in\mathbb{T}\\ \end{array}\right. \tag{15}\]  
\[\left\{\begin{array}{l}\textbf{IF}\ t_{\tau_{m}}^{lm}<t_{\tau_{m}}^{lm}+H_{ \tau_{m},\tau_{m}}*t_{\tau_{m},\tau_{m}}^{j_{m}}\\ \textbf{THEN}\ t_{\tau_{m}}^{lm}=t_{\tau_{m}}^{lm}+H_{\tau_{m},\tau_{m}}*t_{ \tau_{m},\tau_{m}}^{j_{m}},\ J_{m}\in\mathbb{J},\ \tau_{m},\tau_{m}\in\mathbb{T}\\ \end{array}\right. \tag{16}\]  
\[\left\{\begin{array}{l}\textbf{IF}\ t_{\tau_{m}}^{S_{m},dep}<max\left(t_{ \tau_{m}}^{S_{m},arrT}+D_{\tau_{m}}^{S_{m}}*t_{\tau_{m}}^{S_{m}},\ t_{\tau_{m}}^{S_{ m},dep}\right)\\ \textbf{THEN}\ t_{\tau_{m}}^{S_{m},dep}=max\left(t_{\tau_{m}}^{S_{m},arrT}+D_{ \tau_{m}}^{S_{m}}*t_{\tau_{m}}^{S_{m}},\ t_{\tau_{m}}^{S_{m},dep}\right),\\ \hskip 56.905512 ptS_{m}\in\mathbb{S},\ \tau_{m}\in\mathbb{T}\\ \end{array}\right. \tag{17}\]  
\[\left\{\begin{array}{l}\textbf{IF}\ t_{\tau_{m}}^{S_{m},dep}<max\left(t_{ \tau_{m}}^{S_{m},arrT}+C_{\tau_{m},\tau_{m}}^{S_{m}}*t_{\tau_{m},\tau_{m}}^{S_ {m},dep}\right.\ t_{\tau_{m}}^{S_{m},dep}\right)\\ \textbf{THEN}\ t_{\tau_{m}}^{S_{m},dep}=max\left(t_{\tau_{m}}^{S_{m},arrT}+C_{ \tau_{m},\tau_{m}}^{S_{m}}*t_{\tau_{m},\tau_{m}}^{S_{m},dep}\right),\\ \hskip 56.905512 ptS_{i}\in\mathbb{S},\ \tau_{i}\in\mathbb{T}\\ \end{array}\right. \tag{18}\]  
\[\left\{\begin{array}{l}\textbf{IF}\ t_{\tau_{m}}^{I_{\tau_{m}}}<t_{\tau_{m}}^{ l}+t_{\tau_{m}}^{l,J_{m}}\\ \textbf{THEN}\ t_{\tau_{m}}^{l}=t_{\tau_{m}}^{l}+t_{\tau_{m}}^{l,J_{m}},\ J_{m} \in\mathbb{J},\ \tau_{m}\in\mathbb{T}\\ \end{array}\right. \tag{19}\]  
In the operators above, (15) ensures the minimum operational travel time for train \(\tau_{m}\) from the control boundary and junction area. And in (16), the decision variable \(i_{\tau_{m},\tau_{m}}^{l}\) will be adjusted, and the operational headway between trains \(\tau_{m}\) and \(\tau_{m}\) is satisfied based onthe decision variable \(i_{t_{\varpi,\tau_{n}}}^{l_{\varpi}}\). Here, the decision variable will be decided without the decision from other junctions; that is, (6) is not considered in this section, and \(i_{t_{\varpi,\tau_{n}}}^{l_{\varpi}}\) has to keep the same sequence for trains \(\tau_{m}\) and \(\tau_{n}\) if they come from the same route and there is no looping in the route to the junction area. Furthermore, train dwelling time and connection time are checked by (17) and (18), respectively, if the train is supposed to stop in the local control area of the junction. The departure time is chosen using the same logic as in (4) and (5), where the departure time is decided as the maximum value between the departure time in the timetable and the delayed arrival time plus minimum dwelling time or connection time of train \(\tau_{m}\). Finally, the minimum traveling time between two junctions is guaranteed based on (19). Here, in (16) and (19), the indicator \(i_{t_{m},\tau_{n}}^{l_{\varpi},l_{\varpi}}\) is not considered; in other words, the junction will decide \(i_{t_{m},\tau_{n}}^{l_{\varpi}}\) by itself, though it is coupled with the indicator \(i_{t_{m},\tau_{n}}^{l_{\varpi},l_{\varpi}}\). Couplings among the decisions of junction agents are ensured in the collaborative strategy illustrated in Section 4.4.