## 3 Scenario
### The Simulation and Replanning Process
The following formula is used to adjust the initial departure time: \[t_{late(\min)}=\left\{ \begin{array}{l}(t_{Arrival.h}-t_{O,h})*60+(t_{ Arrival.\min}-t_{O,\min})+1,t_{Arrival.s}>0\\ (t_{Arrival.h}-t_{O,h})*60+(t_{Arrival.\min}-t_{O,\min}),t_{Arrival.s}=0\\ \end{array} \right.\] (3) \[T_{new}=\left\{ \begin{array}{l}T_{initial}-(\left[t_{late(\min)}/t_{ MetroInterval}\right]+1)*t_{MetrolInterval},t_{late(\min)}\%t_{MetrolInterval}\
eq 0\\ T_{initial}-\left[t_{late(\min)}/t_{MetrolInterval}\right]*t_{MetrolInterval},t_{ late(\min)}\%t_{MetrolInterval}=0\end{array} \right.\] where \(t_{late(\min)}\) is the amount of time by which a person agent is late, measured in minutes; \(t_{Arrival.h}\) is the hour of the arrival time; \(t_{O.h}\) is the hour of the obligatory time; \(t_{Arrival.\min}\) is the minutes of the arrival time; \(t_{O.\min}\) is the minutes of the obligatory time, \(t_{Arrival.s}\) is the seconds of the arrival time; \(T_{new}\) is the new departure time in the next iteration; \(T_{initial}\) is the departure time in this iteration; \(t_{MetrolInterval}\) is the departure time interval of the metro; and \(\left[t_{late(\min)}/t_{MetrolInterval}\right]\) is the floor function. 2. In the subsequent iterations, the metro capacity is set to a suitable value, and each person agent faces the possibility of being late due to missing a metro trip. Note that the passage flow simulation in our simulation tool is implemented as a queue simulation, in which each metro stop is represented as a first-in first-out queue. Thus, person agents who were late in the last iteration can beat other competitors and board a given metro train by setting out just a few minutes, even one minute, early. The following formula gives the departure time adjustment: \[T_{x+1}=T_{x}+\eta\] (4) where the \(T_{x+1}\) is the departure time in iteration \((x+1)\), \(T_{x}\) is the departure time in iteration \(x\) and \(\eta\) is the step length (minutes) of the departure time adjustment for person agents who were late when going to work or missed metro trips when getting off work in the previous iteration. Specifically, \(\eta\) has a negative value for the forward adjustment of the departure time when going to work and a positive value for the backward adjustment of the departure time when getting off work. 3. As this iterative adjustment is performed, the departure time becomes increasingly early for those who are late, and the congestion is progressively reduced. The iterative process is stopped when none of the person actors are late. At that point, all of the metro trains that previously experienced congestion are full when leaving their stops. (2) Getting off work The strategies used in optimizing the departure time of each person agent when getting off work are similar to those employed when going to work. Since there is no arrival time constraint, the optimization simply shortens the travel time of each person agent. The departure times of the person agents are deferred when congestion occurs, and the iteration is stopped when no stops display congestion. Figure 4: (**a**) The procedure used in replanning going to work strategies; (**b**) The procedure used in replanning getting off work strategies.