Open-Source Public Transportation Mobility Simulation Engine DTALite-S: A Discretized Space–Time Network-Based Modeling Framework for Bridging Multi-agent Simulation and Optimization

Recently, an open-source light-weight dynamic traffic assignment (DTA) package, namely DTALite, has been developed to allow a rapid utilization of advanced dynamic traffic analysis capabilities. Aiming to bridge the modeling gaps between multi-agent simulation and optimization in a multimodal environment, we further design and develop DTALite-S to simplify the traffic flow dynamic representation details in DTALite for future extensions. We hope to offer a unified modeling framework with inherently consistent space–time network representations for both optimization formulation and simulation process. This paper includes three major modeling components: (1) mathematic formulations to describe traffic and public transportation simulation problem on a space–time network; (2) transportation transition dynamics involving multiple agents in the optimization process; (3) an alternating direction method of multipliers (ADMM)-based modeling structure to link different features between multi-agent simulation and optimization used in transportation. This unified framework can be embedded in a Lagrangian relaxation method and a time-oriented sequential simulation procedure to handle many general applications. We carried out a case study by using this unified framework to simulate the passenger traveling process in Beijing subway network which contains 18 urban rail transit lines, 343 stations, and 52 transfer stations. Via the ADMM-based solution approach, queue lengths at platforms, in-vehicle congestion levels and absolute deviation of travel times are obtained within 1560 seconds.The case study indicate that the open-source DTALite-S integrates simulation and optimization procedure for complex dynamic transportation systems and can efficiently generate comprehensive space-time traveling status.

dynamic representation details in DTALite for future extensions. We hope to offer a unified modeling framework with inherently consistent space-time network representations for both optimization formulation and simulation process. This paper includes three major modeling components: (1) mathematic formulations to describe traffic and public transportation simulation problem on a spacetime network; (2) transportation transition dynamics involving multiple agents in the optimization process; (3) an alternating direction method of multipliers (ADMM)based modeling structure to link different features between multi-agent simulation and optimization used in transportation. This unified framework can be embedded in a Lagrangian relaxation method and a time-oriented sequential simulation procedure to handle many general applications. We carried out a case study by using this unified framework to simulate the passenger traveling process in Beijing subway network which contains 18 urban rail transit lines, 343 stations, and 52 transfer stations. Via the ADMM-based solution approach, queue lengths at platforms, in-vehicle congestion levels and absolute deviation of travel times are obtained within 1560 seconds.The case study indicate that the open-source DTALite-S integrates simulation and optimization procedure for complex dynamic transportation systems and can efficiently generate comprehensive space-time traveling status.
Keywords Space-time network Á Dynamic traffic assignment Á Multi-agent simulation Á Lagrangian relaxation Á Alternating direction method of multipliers

Introduction
To understand and analyze future emerging mobility scenarios, planers and engineers need to utilize many different simulation tools to generate corresponding modeling results. The main purpose of transportation simulation is to shed more light on the underlying mechanisms or potential problems that control the behavior of a complex transportation system.
Typically, simulating a system involves a probabilistic input model, a set of dynamic equations or constraints between the inputs and outputs, and then finally produces a set of outputs under different input instances. Optimization, on the other hand, needs to search a solution in the dynamic (possibly complex) system subject to a number of constraints. There are a wide range of studies focusing on simulation-based optimization, to name a few, a leading study by Osorio et al. [1] involving stochastic urban traffic simulators, and another study by Xiong et al. [2] using the DTALite simulator. Generally, transportation planners and engineers utilize simulation tools to evaluate and further optimize a subset of system's parameters, but there is a critical modeling gap between simulation and optimization for complex dynamic transportation systems. To bridge such a gap in a multimodal environment, this research focuses on how to offer a theoretically sound and practically useful modeling framework with a simplified traffic flow dynamic.

Literature Review
Scheduling vehicles on congested transportation networks needs to consider both traffic flows with vehicle-to-road assignment and vehicle routing problem (VRP) with passenger-to-vehicle matching. There are numbers of studies about agent-based traffic assignment and traffic simulation. Mahmassani et al. [3] used flow-density relationships to predict time-dependent traffic flows in the Dynamic Network Assignment-Simulation Model for Advanced Roadway Telematics (DYNASMART). From a broader multiagent optimization perspective, in the study by Nedic et al. [4], a distributed computation model is built for optimizing a sum of convex objective functions for all types of agents. For shared autonomous vehicle (SAV) operating, Fagnant et al. [5] proposed an agent-based shared autonomous vehicle relocation model in order to reduce potential users' wait times. Following Newell's kinematic approach [6], Zhou and Taylor [7] designed a mesoscopic traffic simulation approach and developed a time-driven open-source traffic assignment package DTALite to simulate large-scale networks with millions of vehicles. Based on the multisource data generated from transportation network companies, Spieser et al. [8] provide an on-demand transportation service model and estimate the benefits of sharing vehicles. Focusing on modeling the microscopic behavior in virtual reality systems, Yu et al. [9] provided a hierarchical modular modeling and distributed simulation methodology. A concise overview of simulation-based transportation analysis approaches is offered by Bierlaire [10].
Transportation researchers have devoted significant attentions to both traffic and public transportation simulation models. Recently, Bradley et al. [11] conducted possible autonomous vehicle (AV) operating scenarios in a road network system, and further modeled the metro transit station as a finite capacity queuing system through a discrete-event simulation (DES) approach, which was also adopted in the study by Afaq et al. [12]. Liang et al. [13] provided a mathematical model to consider the door-todoor intermodal travel trips and found that the vehicle fleet size directly influences the performance of the taxi system. Mahmassani [14] integrated varying behavioral mechanisms for different classes of vehicles into a microsimulation framework through a series of experiments under varying market penetration rates of AVs and/or connected vehicles. Qu et al. [15] presented a computationally efficient parallel-computing framework for real-life traffic simulation for metropolitan areas. To meet simulation accuracy requirements, Martinez et al. [16] proposed an agent-based model to simulate individual daily mobility while traffic assignment conditions are updated every 5 min. Golubev et al. [17] presented an agent-based traffic modeling framework allowing users to set a specific model for each supported class. Sun et al. [18] presented an agentbased simulation for urban rail transit systems. Based on kinematic wave model, Wen et al. [19] implemented a shared autonomous mobility-on-demand (AMoD) modeling platform for simulating individual travelers and vehicles with demand-supply interaction and analyzing the system performance through various metrics of indicators.
Recently, there are many papers focusing on vehicle routing optimization models and algorithms used in largescale optimization. Boyd et al. [20] discussed general distributed optimization and provided efficient implementation under the non-convex setting. Mahmoudi and Zhou [21] built the state-space-time network to model the vehicle routing problem with pickup and drop-off and with time windows (VRPPDTW). Based on the Lagrangian decomposition and space-time windows, Tong et al. [22] developed a joint optimization approach for customized bus services. Wei et al. [23] developed a set of integer programming and dynamic programming models to optimize simplified multi-vehicle trajectories. Zhou et al. [24] introduced a vehicle routing optimization engine VRPLite on the basis of a hyper space-time-state network representation with an embedded column generation and Lagrangian relaxation framework. Zhao et al. [25] considered an optimization framework for electric vehicles in the one-way carsharing system, and they proposed a Lagrangian relaxation-based solution approach to decompose the primal problem.

Paper Structure
The remainder of this paper is organized as follows. The next section presents a modeling framework within a space-time transportation network representation. In Sect. 3, we formulate a set of space-time network-based formulations to describe the public transportation optimization problem. Section 4 provides a simulation process of vehicular loading with pickup/drop-off services based on Lagrangian relaxation. In Sect. 5, we use ADMM algorithm to expound the linkage between multi-agent-based optimization and simulation. Numerical experiments based on Beijing subway network are conducted in Sect. 6. In conclusion, Sect. 7 provides concluding remarks and future research work.

Motivation
Many disruptive transportation technologies such as autonomous vehicles (AVs) and mobility as a service (MaaS) create new opportunities for public transit to provide high-level services. Along this line, transit operating researchers need to address some theoretical questions, including (a) how to consider individual system dynamics in the context of public transportation network optimization, (b) how to use agent-based simulation tools to evaluate travel schedules with limited road capacity, and (c) how to improve system flexibility and accessibility with a consolidation of modes. To meet these challenges, this paper considers the vehicle route scheduling optimization in the broader framework of public transportation and develops a unified space-time framework to improve public transportation mobility. Table 1 gives an overarching list for different stakeholders and their measures to be examined in our analytical models.
Among widely used traffic simulation tools, DTALite is a queue-based mesoscopic traffic simulator, documented in the paper by Zhou and Taylor [7]. It is an open-source mesoscopic DTA (dynamic traffic assignment) simulation package designed to provide transportation planners, engineers, and researchers with a theoretically rigorous and computationally efficient traffic network modeling tool.
The transportation mobility simulation engine DTALite-S to be proposed in this paper is an important extension based on DTALite, with much more consistent representations for optimization in a space-time network. This fully functional, open-source DTALite-S can be downloaded from https://github.com/xzhou99/DTALite-S/tree/master/ Version2_PickupDropoffSimulation/DTALite-S. In general, the software suite of DTALite-S aims to: 1. Provide an open-source simulation package that enables transportation researchers and students to understand the complex space-time network modeling process. 2. Offer a unified framework with pickup and drop-off events that cover different traveling activities from driving-only to multiple public transportation modes, across the emerging transportation mobility spectrum, e.g., urban rail transit, synchronized bus, ride-sharing applications, as well as freight transport. 3. Agent-based dynamic traffic assignment and traffic simulation are integrated and extended to tackle practical applications of vehicle routing problem (VRP), or its variants, e.g., vehicle routing problem with pickup and delivery (VRPPD), vehicle routing problem with pickup and delivery with time windows (VRPPDTW).

Overall Modeling Framework
As shown in Fig. 1, there are five different elements in the overall modeling framework. The first category is (1) input data, covering a transportation network, passenger information with origin, destination, preferred departure/arrival time window and desired travel path; vehicle information with depot, time window, and capacity constraint. We consider two different types of vehicles, (I) the background vehicles, driven by their own drivers as single-occupancy vehicle (SOV) or high-occupancy vehicle (HOV), move along the given physical paths from the traffic assignment program, and (III) the MaaS vehicles operated by MaaS companies with optimized routes to meet the demand of MaaS passengers as stakeholder (II). For the benefits of stakeholder (IV), we have two coupled optimization modules, namely (2) space-time network-based traffic assignment for background vehicles to find the shortest path for each agent, (3) transportation mobility optimization for MaaS vehicles and passengers, which assigns the tasks of serving passengers to specific vehicles in a cost-optimal way, and finally, (4) traffic simulation for calculating traffic states in the transportation network. The system output (5) includes time-dependent travel times, and vehicle and passenger space-time trajectories.
The traffic congestion factors, if need to reach the steady states or fixed point equilibrium, should be returned back to part of (1) input data for further consistent optimization and simulation. Please note that Roman numerals (I-IV) correspond to the stakeholders' indices in Table 1.

Space-Time Network Construction for a Point Queue Model with Constant Capacity
Consider a physical transportation network M ¼ N; L ð Þ with a finite set of nodes N and a finite set of links L, where nodes i; j 2 N and directed link i; j ð Þ 2 L. Set L is further divided into two subsets, i.e., passenger link set L p and vehicle link set L v . In this research, the physical transportation network is expanded into two coupled high-dimensional space-time networks, for passengers and vehicles. Besides typical space-time traveling/waiting arcs, additional space-time arcs, such as pickup and drop-off space-time arc, are also constructed for modeling the vehicle-passenger service process.
is the set of space-time links/arcs under the planning time horizon T. Each arc i; j; t; t 0 ð Þ2A indicates a directed spacetime path from node i departing at time t to node j arriving at time t 0 . Thanks to the discretized space-time network structure, it is easy to incorporate passengers' travel request   [26] provides a more systematic comparison among modes of point queues, spatial queues, and an extended version with time-dependent capacity and spillback along the backward wave. Along this line, one can extend the method from Lawson et al. [27] to calculate the spatial and temporal extents of queue and the actual waiting time spent on upstream of a bottleneck. The schematic trajectories of vehicle v from node i to node j in space-time network are shown in Fig. 2.
The detailed attributes of vehicles and passengers can be described in the coupled modules of simulation and optimization. Given a set of passengers P and their travel requests, pickup/delivery locations o p =d p for each passenger p, a set of vehicles V with vehicle capacity Cap v and other routing constraints, the simulation problem aims to find a feasible set of vehicle's space-time trajectories. Given an aggregated realization of traffic flow conditions from the simulation module, the optimization module needs to perform matching and provide system-optimal routing instructions between vehicles and passengers. In details, a space-time network can be built systematically using the following steps from Tong et al. [28]. As illustrated in Fig. 3, a vehicle could travel through a sequence of pickup and drop-off links for different passengers. For a passenger, his first pickup link along his trip is his own pickup link, while he can still travel through pickup/drop-off links of other passengers. This unique modeling feature is critically important for urban rail transit and public transportation bus systems ( Table 2). A station should be represented as a pair of pickup and drop-off links, as well as a possible dedicated traveling-through link, as 3-5 and 6-8 in Fig. 3

Mathematic Formulations for Traffic and Public Transportation Optimization Problem on a Space-Time Network
The notations used in this section are listed in Tables 3, 4, and 5. Focusing on analytically solvable equations, space-time network-based optimization used in our study needs to capture complex and important features including vehicle capacities, pickup, sharing policies, fare schemes, and hailing strategies such as in-advance and on-demand requests. The optimization problem in DTALite-S can be formulated as a multi-commodity network flow model. The objective function shown in Eq. (1) is to minimize all vehicles and passengers' total costs.  Step 1: Build space-time vertex set Add vertex ( , ) to for ∈ and each Step 2: Build space-time transportation arc set / for passengers/vehicles Step 2.1: Add space-time traveling arc ( , , , + ( , , )) to / , for link ( , ) ∈ , where ( , , ) is the link travel time from node to node starting at time Step 2.2: Add a set of space-time waiting arcs for a pair of vertexes with the same node , from time to + 1 Step 3: Add space-time pick-up and drop-off arcs for passengers to consider request time window constraints Step 3.1: Add space-time pick up arc ( ′, , , + 1) to at each time ( ( ) ≤ < ( )) for each passenger , where ′ is 's corresponding virtual node Step 3.2: Add space-time drop off arc ( , ′, , + 1) to at each time ( ( ) < ≤ ( )) for each passenger , where ′ is 's corresponding virtual node Step 4: Add space-time origin-departing and destination-returning arcs for vehicles to consider constraint of operating hours Step 3.1: Add space-time departing arc ( ′, , , + 1) to at each time ( ( ) ≤ < ( )) for each vehicle , where ′ is 's corresponding origin node Step 3.2: Add space-time arriving arc ( , ′, , + 1) to at each time ( ( ) < ≤ ( )) for each vehicle , where ′ is 's corresponding destination node Algorithm 1. Build a space-time network Flow balance constraints for physical path at vehicle v 0 s node > : Flow balance constraints for physical path at passenger p 0 s node X j2N: i;j ð Þ2L > : Flow balance constraint for space-time path at passenger p 0 s vertex X Consistency constraints between physical path and space-time path for p X t;t 0 ð Þ2T y i;j;t;t 0 p ð Þ ¼ x i;j p ð Þ; 8p 2 P; i; j ð Þ 2 L p ð6Þ    Consistency constraints between physical path and space-time path for v X Road capacity constraints for all the vehicles using the same link X v2V y i;j;t;t 0 v ð Þ CapRoad i;j;t ; Passenger carrying capacity constraints for vehicles Matching constraints (10) ensures that each passenger is matched to exactly one vehicle X v2V Equations (2) to (5) impose passenger/vehicle flow balance constraints on both physical and space-time network. Equations (6) and (7) ensure that the path used in the physical network corresponds to the time-index trajectories in the space-time network for each agent. Both classes of MaaS vehicles and passengers use the offline scheduled routes from the passenger-to-vehicle assignment results in the MaaS optimization program. In the future, an on-line vehicle-to-passenger matching capability can be a nature extension; for example, following the line of research by Ma et al. [29] Alonso-Mora et al. [30], and Vazifeh et al. [31], constraint (8) can be viewed as a simplified version of point queue model with constant capacity in a space-time network with waiting arcs, and the related modeling details can be found in Lu et al. [26]. Constraint (9) aims to satisfy the vehicle carrying capacity with combined Eq. (10), which ensures that each passenger is matched to exactly one vehicle. If we need to consider intermodal transfers in the public transportation problem, then one passenger may be served by multiple vehicles in a tour sequence and Eq. (10) needs to be further extended.

Simulation Flowchart Based on Simple Data Structure
Illustrated in Algorithm 2, we need to perform two loops of time and agents across different links to check the available road and vehicle carrying capacity. As we follow a point queue-based system, without complicated data structure, we only need to concern about the key variables, namely arrival time and departure time of vehicle v on link l: TA v; l ð Þ, TD v; l ð Þ, as well as cumulative arrival/departure counts of vehicles on link l at time t, Aðl; tÞ and Dðl; tÞ.
In step 3, illustrated in Fig. 4, the waiting time and queue length can be derived from the grant traffic state variables of Aðl; tÞ and Dðl; tÞ. Overall, it could be memory consuming to store a full matrix of variables TA v; l ð Þ, TD v; l ð Þ, one can use dynamically allocated vectors to store and update the link sequences along their paths. As illustrated in Fig. 5, the software architecture designed in DTALite-S aims to bridge multi-agent simulation and optimization (integrating passenger-to-vehicle assignment and time-dependent routing) in the open-source DTALite-S modeling package. ODME (origin-destination matrix estimation) is considered throughout the dynamic assignment module adopted from Zhou et al. [32].

Further Discussions for Multimodal Environment
As a discretized space-time network-based simulation tool for the multimodal environment, we need to model various public transportation problems including routing and scheduling of urban rail transit system, bus, taxi with ridehailing strategies, and with in-advance and on-demand requests. Accordingly, Table 6 shows a detailed comparison of multi-mode agent representation and the related modeling focuses. Finally, as a simplified or ''student'' version of DTALite on a fully discretized space-time network, DTALite-S has the following distinctions listed in Table 7.
Step 1: Initialization: prepare input data with given agents' physical routes, A route could pass through a sequence of transportation, pick-up and drop-off links.
Step 2: Perform simulation For ( =0; < ; ++) // loop for each simulation time ADMM is a widely used optimization algorithm, and the literature of ADMM can be traced to classical papers by Douglas and Rachford [33] and Boyd et al. [20].
Essentially, it integrates problem decomposition techniques of augmented Lagrangian and block coordination descent. In our proposed framework, ADMM is firstly used to generate vehicle routing solutions for the multi-agent optimization problem. With Lagrangian multipliers and quadratic penalty terms, the complex public transportation mobility model can be decomposed into simple subproblems that can be solved by a sequential solution scheme.   The open-source vehicle routing package using the ADMM framework proposed by Yao et al. [34] can be downloaded from https://github.com/YaoYuBJTU/ADMM_Python. Consider a space-time network problem with two agents v 1 and v 2 . Given v 0 2 s trajectory up to time t ? h, we need to schedule trajectory of v 1 from t to t ? h, where h is the optimization time horizon in the future. We can interpret the above problem from perspectives of simulation and optimization. Min The standard Lagrangian relaxation form for problem (11) can be rewritten as Eq. (12), where k i;j ð Þ is the vector of Lagrangian multiplier for different links.
The ADMM function can be written as Eq. (13), and the algorithm will apply a block coordinate decomposition scheme for each agent v.
Through the record of CapRoad i;j;t in Algorithm 2, the simulation mechanism in DTALite-S first removes the infeasible space-time regions occupied by vehicle v 2 , to ensure the full feasibility trajectories of v 1 . Recall that, CapRoad i;j;t ¼ 0 indicates that the space-time resource capacity at link (i, j) at time t has been used by one previously scheduled vehicle, otherwise.
As shown in Table 8, we want to show how the sequential ADMM decomposition method can be linked to the vehicle loading process inside simulation. In this context, whether a vehicle can use the resource at i; j; t ð Þ depends on the value of penalty parameters q in Eq. (13). Of course, an infinite value of q can always lead to feasible solutions, which is equivalent to setting CapRoad i;j;t ¼ 0 by removing infeasible space-time solution regions. On the other hand, a small value of q could still allow different vehicles to compete for the limited road resources, through an iterative process, depending on their own priority and waits on the objective functions. From the ADMM modeling perspective, in each iteration k, the simulation process can be viewed as a one-shot procedure from time 0 to time T, with the infinite penalty parameters to ensure the full feasibility of space-time agent trajectories. Essentially, the ADMM-based iterative optimization procedure can optimize the system-wide costs by iteratively scheduling individual vehicle trajectories with a relatively small q and then increasing the value of q further aims to enforce the primal feasibility. In contract, the simulation-based process makes scheduling decisions only based on purely local information at current time and only schedules the trajectories at a short time horizon. Interested readers can further study the use of ADMM in a distributed multi-agent optimization environment, e.g., for distributed automated vehicles, based on a recent study by Nedic and Ozdaglar [4].

Case Study
In this section, we implement the DTALite-S engine to simulate the passenger traveling process in the Beijing subway network as shown in Fig. 6, which contains of 18 urban rail transit lines, 343 stations, and 52 transfer stations.
In the proposed modeling framework, Beijing subway network is represented by a physical network with 2401 nodes and 3510 links. A total of 6699 train services are modeled into the DTALite-S as vehicle schedules. Up to 1,393,093 passenger transaction record samples during 7:00 to 9:00 on a typical workday are obtained from the AFC system in the Beijing subway network as input passenger agents. To implement Beijing subway case, the total computing time is about 1560 s. For illustration purpose, we choose four time intervals during the morning peak hours in Fig. 7 to show the passenger crowding levels over the whole Beijing subway network.
We can also obtain the time-dependent passenger waiting queues at platforms. Figure 8 shows passenger queue lengths and crowding levels in both up and down directions of Yizhuang line in Beijing.
To assess a more complete set of simulation performances, we also calculate the absolute deviation value between the simulated arrival time and actual arrival time of each passenger, as shown in Fig. 9. Specifically, the absolute deviations of 65% passengers are within 3 min and the absolute deviations of 82% passengers are within 5 min.

Conclusions
Optimization tends to solve tactical/operational issues, while simulation aims to resolve more complex and realistic transportation problems. A number of researchers have devoted a great amount of efforts to integrating both optimization approaches and simulation tools to pursue future advanced mobility solutions. For example, stochastic programming and approximate dynamic programming often use simulation to estimate expected values within an optimization framework. The proposed discrete space-time network-based modeling framework can be used to evaluate and further optimize transport strategies from new demand and supply perspectives. It intends to bridge the modeling gaps for solving complex transportation problems, such as multimodal transportation network design, VRP, urban rail transit scheduling, bus operating, etc. With the embedded Lagrangian relaxation and ADMM algorithms, the framework is able to shed more lights on many fundamental research issues in large-scale dynamic traffic assignment, mesoscopic traffic simulation, and vehicle route optimization. The proposed modeling framework is used to simulate the passenger traveling process in Beijing subway network. Via the ADMM-based solution approach, queue lengths at platforms, in-vehicle congestion levels and In our future research, a more comprehensive and microscopic cell-based simulation framework will be further studied to simulate more detailed travel decisions, such as passenger route choice lane changing behavior, and car flowing behavior. In addition, we will apply and extend the proposed open-source offline modeling framework to many emerging transportation applications, in a real-time and distributed computing environment.