1. Introduction
With the development of national economies and the acceleration of urbanization, traffic congestion has become a common problem around the world [
1,
2]. Traffic congestion produces broad social and environmental costs, such as delays in the delivery of goods, air pollution, changes in microclimates, increases in the urban heat island effect, increases in respiratory problems and lost productivity [
3]. To address this severe challenge, intelligent transportation system (ITS)-based studies have become increasingly prevalent, especially in the field of traffic simulation. Traffic simulations, which represent an important component of ITSs and differ from traditional mathematical modelling, can simulate traffic-related phenomena, including the flow of traffic and traffic accidents. They can also reproduce the spatial and temporal variations in traffic flow and help to analyze the characteristics of vehicles, drivers, pedestrians, roads and traffic [
4,
5]. Moreover, using virtual reality technology, traffic simulations can intuitively show the status of traffic in real time, including whether roads are smooth, whether traffic accidents are present and what kind of solutions can be used to address traffic problems, without risk.
Traffic simulations can be divided into macroscopic, microscopic and mesoscopic scales [
6]. The macroscopic traffic simulation model was proposed by Whitham and Richards and is mainly used to study the characteristics of traffic flow globally [
7,
8]. Microscopic traffic simulations, such as the car-following model (Reuschel, Pipes) and the lane-changing model (Gipps, 1986), can describe the conditions of traffic networks and the detailed behaviors of traffic participants to a high degree [
9,
10,
11]. The description of traffic systems provided by the mesoscopic traffic simulation model proposed by Prigogine and Andrews lies between those of the macroscopic and microscopic models. The mesoscopic model describes the inflow and outflow behaviors of vehicles at links and intersections or at links and stops, but it does not include car-following or lane-changing models [
12]. In terms of application, macroscopic and mesoscopic traffic simulations are both used for traffic planning and management; mesoscopic traffic simulations can also be used to present travel suggestions to the public, whereas microscopic traffic simulations can be used for traffic accident analysis and automated driving.
Despite the different scales at which traffic simulation research is conducted, most traffic simulation tools are based on multi-agent models, which are a powerful tool for the simulation of complex systems. Such a model is dynamic and captures nonlinear interactions, and its components exhibit unpredictable reactions that result in realistic behavior patterns [
13,
14,
15]. Agent technology originated at MIT in the 1970s. Agents are typically defined as independent and autonomous entities that can coordinate with each other according to the different states of other entities and systems and determine their own actions and states [
16]. Various kinds of elements, such as people, vehicles, links, and traffic lights, have been viewed as agents. These elements communicate and collaborate to simulate complex traffic conditions in simulation tools. Among the many simulation tools that exist today, our research focuses on those that are concerned with resident trips. MATSim (Multi-Agent Transport Simulation), Albatross and ADAPTS (Agent-based Dynamic Activity Planning and Travel Scheduling) are typical examples of these simulation tools [
17,
18,
19]. Most traffic simulation tools that are concerned with resident trips use activity-based models to identify optimal combinations of activities in time and space [
20]. However, it is also necessary to carry out commuting-based traffic simulations, especially for public transit.
The key element of the simulation tools mentioned above is the replanning module, which employs the scores and plans of the agents and determines whether these travel plans must be modified. Most optimization algorithms for travel planning focus on four dimensions, specifically the departure time, travel route, travel mode and the combinations of activities represented by the activity chain [
21]. The optimization of the departure time contains two steps. The first of these steps involves setting a range of time adjustments based on the current departure time. The second step involves drawing an adjustment value at random from within the range and adding this adjustment to the previous departure time (Balmer et al., 2005; Gao, 2013) [
2,
22]. The optimization of the travel route is based on static traffic assignment using the user equilibrium (UE) or the stochastic user equilibrium (SUE) models (Raney et al., 2003) [
23]. The multinomial logit model and the probit model are often used to optimize the mode of travel, and the optimization of the combinations of activities represented by the activity chain is based on heuristic solution algorithms, such as hill-climbing algorithms or the tabu search algorithm (Balmer and Axhausen, 2009; Nagel and Axhausen, 2016) [
20,
21,
24,
25].
Of the four types of optimization algorithms, research on the optimization of departure time is still insufficient. The challenges involved in such studies are as follows. First, it is difficult to define the direction of adjustment of the departure time, i.e., whether the optimal departure time is earlier or later than the current departure time. Second, it is also difficult to know when the iteration can be stopped. In this study, iteration refers to the replanning process in our simulation tool. Person agents must replan their travel strategies—i.e., perform departure time adjustment—to avoid late arrival or missing their desired metro trips. If there are no person agents who are late when going to work or who become caught in congestion at metro stops when getting off work, the iteration will end.
In view of the two challenges identified above, this paper aims to explore a strategy for adjusting departure times to obtain relatively optimal travel utility values, using metro travel as an example. To address the first problem, the two concepts of “obligatory arrival times” and “empirical travel times” are introduced to determine the direction of departure time adjustment. For the second problem, an explicit condition is proposed for the termination of iteration. With these adjustments, shorter travel times can be achieved. Moreover, we find the latest average departure time with no risk of being late when going to work and the earliest average departure time with no risk of missing metro trips when getting off work. This research on the optimization of departure times will broaden the horizons in this field and can be used to provide the public with suggestions regarding their travel plans.
3. Scenario
3.1. The Study Area and Its Metro Network
Shenzhen is a coastal city located in the south of China, northeast of the Pearl River Estuary. This city is located south of the Tropic of Cancer, between 113°46′ and 114°37′ east in longitude and between 22°27′ and 22°52′ north in latitude, and the total area of Shenzhen is approximately 1952.84 km2.
Before 2016, the metro network in Shenzhen, which was developed by the Shenzhen Metro Group, originally had five lines. It was extended by an additional three lines in 2016. Our simulation applies to 199 metro stops on all eight of these lines, as well as the departure timetable for the metro trains.
Figure 3 shows the location of Shenzhen in China and the metro network in Shenzhen. The specific values of the major attributes of the metro trains, such as capacity, speed, numbers of carriages and door counts, are shown in
Section 4. Notably, the results (the person agents’ average departure time, travel time and travel utility, as well as the numbers of person agents who are late and miss metro trips in every iteration) are reported as sums over all eight metro lines.
3.2. The Travel Plans of Person Agents
The travel plans of person agents represent the most important initial input data in CCTSim. Specifically, the generation of metro travel plans includes two steps.
1. Selecting the person agents who employ the metro
It is assumed that, if the distances from both the workplaces and the residences of the person agents to the nearest metro stop are less than 500 m, they will travel using the metro. Through the use of ArcGIS (ArcGIS 10.3, Esri, Redlands, CA, USA, 2014), 124,910 person agents are selected, and they are assigned corresponding travel plans in the next step.
2. Identifying the metro travel plans of the person agents
We apply the Baidu Map API (application program interface) to obtain the travel plans of the person agents who use the metro in as much detail as possible. The results show that some of the agents can reach their destinations directly, whereas others need to transfer.
Table 1 shows sample metro travel routes used by the agents. After excluding error messages returned by the Baidu Map API and person agents with metro travel plans having empirical travel times of more than two and a half hours (because they spend too much time in travelling and might choose a faster mode of travel), 103,637 person agents remain. These remaining person agents are simulated in this paper.
3.3. The Simulation and Replanning Process
Using these input data, CCTSim can simulate the travel of person agents during rush hour. More importantly, in the following, we present detailed strategies for optimizing the departure time of each person agent in every iteration.
1. The determination of the initial departure time
The attribute of empirical travel time is listed in the second column of
Table 2. This quantity represents the time spent in travel and is returned together with the corresponding travel route. Using the empirical travel time, the initial departure time of each person agent is set to the difference between the obligatory arrival time and the empirical travel time when going to work. This procedure is more practical than a stochastic departure time and helps to determine the specific direction of replanning. The initial departure time for getting off work is set stochastically to a time between 17:30 and 18:30.
2. The risk of being late
When going to work, each person agent employing a particular initial departure time confronts the risk of being late. Two factors drive lateness; the real travel time may be longer than the empirical travel time, and each person agent has the possibility of missing metro trips due to limited capacity and being forced to wait for the next metro train. This phenomenon can be described as congestion. When a person agent is late for work, the performance of the travel plan is bad because the plan receives a severe penalty in scoring. Congestion also extends travel time, which also decreases the utility of the corresponding travel plan. Thus, person agents tend to set out earlier to avoid the risk of missing their planned trip. However, an early departure time typically results in an increased travel time and premature arrival, which leads to the travel plan receiving a low score. This system resembles a game in which each person agent attempts to optimize his/her departure time.
3. The strategies used to optimize the departure time of each person agent
The objectives of adjusting travel plans are mentioned in
Section 2.2.4. The specific procedures followed in going to work and getting off work are shown in
Figure 4a,b.
(1) Going to work
- ①
In the first iteration, in order to avoid congestion, the metro capacity is set to an infinite number. Thus, all of the person agents can execute their initial travel plan without congestion. The simulation tool counts person agents as being late if their real travel time is longer than the corresponding empirical time and notes how late they arrive. Subsequently, the initial departure times of these person agents are adjusted forward so that they will not be late again using the same travel routes. The following formula is used to adjust the initial departure time:
where
is the amount of time by which a person agent is late, measured in minutes;
is the hour of the arrival time;
is the hour of the obligatory time;
is the minutes of the arrival time;
is the minutes of the obligatory time,
is the seconds of the arrival time;
is the new departure time in the next iteration;
is the departure time in this iteration;
is the departure time interval of the metro; and
is the floor function.
- ②
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:
where the
is the departure time in iteration (
x + 1),
is the departure time in iteration
x and
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,
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.
- ③
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.
4. Results and Discussion
The simulations are undertaken assuming different values for , the step length of the departure time adjustment shown in Formula 3. In this section, is set to 1 min, 2 min and 4 min, and the corresponding numbers of iterations are 201, 92 and 81. We present the departure time adjustments that result in every iteration, as well as the number of person agents who arrive late, the occurrence of congestion at metro stops and the average travel time, travel score and departure times for going to work and getting off work for the person agents. The specific results for every iteration are shown in the Supplementary Materials.
Because only 103,637 person agents are included in the simulation, whereas more than 500 thousand people take the metro during rush hour, the values of the metro attributes require appropriate adjustment [
26].
Table 2 and
Table 3 show the specific values of the metro attributes in reality and in the simulation test.
4.1. The Number of Person Agents Who Are Late and the Occurrence of Congestion at Metro Stops
This section examines the number of person agents who arrive late when going to work and the level of congestion at metro stops when getting off work.
Figure 5 shows the results in every iteration for different step lengths of departure time adjustment. Note that “HToW” (home to work) hereinafter means going to work, whereas “WToH” (work to home) means getting off work. In addition, blue, green and red lines indicate that the step lengths of departure time adjustment are 1 min, 2 min and 4 min, respectively. Overall, as the number of iterations increases, the number of person agents who arrive late to work and the congestion at metro stops getting off work decreases to zero. The rate at which congestion decreases is much faster than that of person agents who arrive late. In addition, as the step length of departure time adjustment increases, the convergence speed also becomes faster. The decreasing trend of the three results began in the second iteration because the metro capacity is set to infinite in the first iteration, but is set to plausible values in the other iterations. Furthermore, the number of person agents who arrive late displays small fluctuations as this quantity decreases to lower values. At that time, a certain departure time adjustment may cause some person agents who arrived at their workplace before the obligatory arrival time in the previous iteration to be late again. This phenomenon results from the finite capacity of the metro system and competition among the person agents; however, it is temporary and does not change the main decreasing trend.
4.2. Average Travel Score
This section examines the average travel score of person agents going to work and getting off work.
Figure 6 shows the results in every iteration for the different step lengths of departure time adjustment. Overall, as the number of iterations increases, the average travel score of the person agents increases. The average travel scores when getting off work is much better than that when going to work because there is an obligatory arrival time when going to work; person agents who are late for work will incur a severe penalty for this travel, whereas there is no such rule when getting off work. In addition, as the step length of departure time adjustment increases, the convergence speed also increases. The increasing trend of the three results begins in the second iteration, and there are slight fluctuations in the average travel score of going to work as it increases to a higher value, but these fluctuations do not change the main rising trend. The reason for these fluctuations is similar to that mentioned in
Section 4.1.
4.3. Average Departure Time and Travel Time
This section examines the average departure times and travel times of the person agents when going to work and getting off work.
Figure 7a–c show the results in every iteration for the different step lengths of departure time adjustment. Overall, as the number of iterations increases, the average travel time of the person agents decreases by approximately 3–5 min. It decreases from 45 min down to 40 min when going to work and from 40 min down to 37 min when getting off work. The average departure times of the person agents become earlier by approximately 15 min when going to work and later by approximately 5 min when getting off work. Moreover, when the iteration ends, the latest average departure time with no risk of being late when going to work is approximately 8:04, and the earliest average departure time with no risk of missing metro trips when getting off work is approximately 17:50. Interestingly, the average travel time of the person agents initially increases and then decreases. Although the average travel time displays the same trend for person agents going to work and getting off work, these trends result from different underlying causes. When getting off work, the increase in travel time is caused by the differences in metro capacity among the iterations. Therefore, the incidence of congestion at metro stops is so high that the travel time of the person agents in the second iteration is obviously longer than that in the first iteration. In the remainder of the iterations, since the person agents that experience adjusted departure times experienced congestion in the previous iteration and the direction of adjustment of the departure time is backward, their travel time must decrease as the number of iterations increases. On the other hand, when going to work, travel time rises in the second iteration for reasons that are similar to those that drive the increase in travel time when getting off work, but a different and somewhat complex cause drives the increase in travel time in the other iterations. Note that the person agents with adjusted departure times arrived late in the previous iteration, and the adjustment direction of the departure time is forward. At the beginning of the iteration, there are so many person agents who arrive late that an adjustment causes only a fraction of the person agents to arrive at their workplaces before the obligatory time. However, the arrival times of most of the person agents do not change, and their travel time is extended by the step length. As the number of iterations increases, the number of person agents who arrive late gradually decreases, resulting in reductions in the number of person agents that receive adjustments, and the travel times of greater numbers of person agents are shortened, due to the decrease in congestion at the metro stops. Thus, the average travel time begins to decrease, due to the objectives we employ in the dynamic optimization of departure time.
4.4. Verification of Our Simulation Results
To verify our simulation results, we compare the differences in the average travel times and average departure times when going to work and getting off work between simulation and reality.
Table 4 and
Table 5 show these differences between simulation and reality. The real data on the times at which people board at and depart from metro stops were obtained from the Shenzhen Metro Group. Moreover, we have calculated the average walking times from home to the origin metro stop and from the destination metro stop to the workplace. These times are helpful for calculating the average travel times without including walking time and the average times of boarding at and departing from metro stops in the simulation.
Table 6 presents these results. The abbreviations “HToS” and “SToW” stand for “home to metro stop” and “metro stop to workplace”.
The experiments reported in
Section 4.1 and
Section 4.3 demonstrate the core heuristics of the replanning strategy, namely that the average departure times of person agents when going to work should be as late as possible with no risk of being late and the average departure times of person agents when getting off work should be as early as possible with no risk of missing metro trips. With this strategy, the average travel time also becomes shorter.
However, there are some implicit flaws in our optimization strategy; some person agents who are represented as going to work are still caught in congestion when the iteration has ended. In addition, this paper does not consider bus and car trips because of a lack of relevant data. Furthermore, the computational efficiency of the simulation process is relatively low and should be improved by means of parallel computing.