Next Article in Journal
Neuronal Specialization for Fine-Grained Distance Estimation Using a Real-Time Bio-Inspired Stereo Vision System
Next Article in Special Issue
Machine Learning-Based Driving Style Identification of Truck Drivers in Open-Pit Mines
Previous Article in Journal
Efficient Evaluation of Slowly Converging Integrals Arising from MAP Application to a Spectral-Domain Integral Equation
Previous Article in Special Issue
Deep, Consistent Behavioral Decision Making with Planning Features for Autonomous Vehicles
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Masivo: Parallel Simulation Model Based on OpenCL for Massive Public Transportation Systems’ Routes

by
Juan Ruiz-Rosero
1,*,
Gustavo Ramirez-Gonzalez
1 and
Rahul Khanna
2
1
Departamento de Telemática Universidad del Cauca, Calle 5, No. 4-70, Popayan, Cauca 190002, Colombia
2
Intel Corporation, 2111 NE 25th Ave., Hillsboro, OR 97124, USA
*
Author to whom correspondence should be addressed.
Electronics 2019, 8(12), 1501; https://doi.org/10.3390/electronics8121501
Submission received: 19 November 2019 / Revised: 3 December 2019 / Accepted: 3 December 2019 / Published: 8 December 2019
(This article belongs to the Special Issue Intelligent Transportation Systems (ITS))

Abstract

:
There is a large number of tools for the simulation of traffic and routes in public transport systems. These use different simulation models (macroscopic, microscopic, and mesoscopic). Unfortunately, these simulation tools are limited when simulating a complete public transport system, which includes all its buses and routes (up to 270 for the London Underground). The processing times for these type of simulations increase in an unmanageable way since all the relevant variables that are required to simulate consistently and reliably the system behavior must be included. In this paper, we present a new simulation model for public transport routes’ simulation called Masivo. It runs the public transport stops’ operations in OpenCL work items concurrently, using a multi-core high performance platform. The performance results of Masivo show a speed-up factor of 10.2 compared with the simulator model running with one compute unit and a speed-up factor of 278 times faster than the validation simulator. The real-time factor achieved was 3050 times faster than the 10 h simulated duration, for a public transport system of 300 stops, 2400 buses, and 456,997 passengers.

Graphical Abstract

1. Introduction

Millions of more people are expected to migrate to urban centers in the following years. The United Nations predicts that for 2050, 66% of the population will live in urban areas [1]. Hence, transportation planners are embracing new ways of tackling the old problem of congestion. Public Transport Systems (PTS) move a large number of people while consuming fewer resources (lower energy requirements, lower accident cost, and air quality improvements). Currently, one of the top applications of the Internet of Things (IoT) is the development of smart cities [2]. Smart cities target the increasing capacity to collect a large quantity of data from a PTS and process them in real-time (big data processing). This capacity has become the basis for the development of more effective transit modeling and simulation [3]. An efficient transit simulation powers the optimization agents for public transport systems. These optimization agents improve the route path, route frequency, number of transfers, the waiting time, bus or train sizes, ticket price, and others. With these optimizations, different studies reduced the wait time by 75% [4], the travel time by 14% [5], and operational cost by 11% [5].
The basis of a PTS simulation is system modeling. This modeling is divided into three different approaches: macroscopic, mesoscopic, and microscopic [6]. The macroscopic models aggregate traffic streams without analyzing the internal elements. The mesoscopic ones model homogeneous groups of actors and the interactions with little detail. Finally, the microscopic ones model in detail the dynamics of each actor (vehicles or passengers) and their interactions with others [6]. The public transport system components have been simulated inside these three different models. The macroscopic modeling has been used for simulating the vehicle accumulation of public transport vehicles along with private cars [7]; furthermore, for the modeling of the public transport vehicles’ speed [8] and for the road safety impacts of public transport [9]. Similarly, the mesoscopic models have been used for simulating the crowding levels on-board the public transport vehicles [10], emergency evacuation methodologies [11], traffic safety policy evaluation [12], and a multi-modal mobility simulator for large scale scenarios [13]. The microscopic models are the most used for public transport simulation. These models are included in the simulation of the operations at public transport stops [14,15], the public transport system’s reliability [16,17], bus priority methods [18,19], exclusive bus lanes [20,21], bus routes [22], transfer organization of public transportation terminals [23], multimodal systems [24], and traffic networks [25].
Similarly, we performed a literature review supported by the scientometric tool ScientoPy [26] to find the most simulated and modeled components in the PTS. For this, we downloaded a dataset from the Clarivate Web of Science (WoS) and Scopus, with the search string (“public trans*” OR “mass transit”) AND (“simulation” OR “model*”) applied to the documents’ title. Figure 1 shows the top seven most simulated or modeled components for PTS. In-door air quality had the most documents, with papers that included diseases transmission [27] and air quality prediction [28,29,30,31,32,33]. Second, accessibility included modeling the potential effect of shared bicycles on public transport travel times [34] and modeling access to PTS [35,36,37]. Line planning simulation and modeling covered models and methods for line planing [38], passenger routing decision [39,40], and PTS connection simulation [41].
Waiting time was the topic with the highest growth in PTS simulation and modeling, with 60% of the documents published in the last two years. It includes impacts on passengers’ waiting time uncertainty [42], timetable optimization models for minimizing passenger waiting [43], and a stochastic model for the passenger arrival process [44]. Finally, other simulation and modeling components are passenger flow [45,46,47,48], transfers [49,50,51,52], and path choice [53,54].
These kinds of implementations suffer from two critical issues. First is scalability, because most of them only offer single machine solutions that are not adequate to process large scale data. Second is granularity, due them not considering microscopic traffic situations such as individual passengers/bus/train modeling [55]. For these reasons, novel works have developed new models and simulators that employ parallel architectures to get the simulation results more efficiently. Currently, we find mesoscopic [13,56,57,58,59,60] and microscopic [61] traffic simulators based in GPUs (Graphics Processing Units), HPC (High Performance Computing) [62,63,64], and microscopic simulation based on Apache Spark [55,65]. Nevertheless, these modeling and simulation approaches do not consider each passenger as a unique entity in the simulation model.
In this paper, we present Masivo. Masivo is a new parallel simulation model based in OpenCL using a multi-core high performance platform for massive public transportation systems. Masivo works with predefined public transport system conditions, which include the stops’ total number, the stops’ capacity, and the Origin-Destination matrix (OD). This OD matrix and routes’ information are updated to this model via CSV files. Masivo gets the simulation results for total alighted passengers and average commute time. Similarly, it shows the performance indicators.
We organized this paper as follows. First, “Section 2. Public Transport Systems’ Basis ” describes the public transport system, the simulation variables, and output indicators. Then, in ”Section 3. Masivo Public Transport Routes’ Simulation”, we present the components, the input parameters, the output results, and the algorithms for the Masivo simulator. In “Section 4. Results”, we summarize the validation and performance results of Masivo. Later, in “Section 5. Discussion”, we discuss Masivo’s performance against other parallel traffic and public transport simulators. Finally in “Section 6. Conclusions”, we summarize all the concluding remarks and future work.

2. Public Transport Systems’ Basis

In a public transport system, the buses, trains, or other forms of transport are used by people to travel from one place to another [66]. Figure 2 shows a small public transport system example, which consists of three stops ( S i ) separated 2 km and two routes ( R 1 and R 2 ). In this system, we have, for instance, passengers from the origin stop S 1 that travel to the destination stops S 2 and S 3 . The origin-destination matrix (OD) denoted as D represents the number of passengers that travel from each stop to another. For example, if we have 10 passengers that travel from S 1 to S 2 , the value D 1 , 2 is 10.
In this way, the OD matrix can describe the full system demand, as shown in Equation (1). Here, we see a diagonal of zero, which indicates that there are no passengers that travel from the origin station to the same origin station.
D = 0 10 20 10 0 10 20 10 0
The routes are designed to transport passengers from one stop to another. Figure 2 shows two routes ( R 1 and R 2 ).  R 1 has the direction west to east, and R 2 has the direction east to west. The  R T r value defines the total trip time (in seconds) for route r, that is the time needed by the bus to complete the full route. The value f r defines the frequency (in seconds 1 ) of the route r, and it represents how often the bus is dispatched for each route. Therefore, the number of buses needed for each route is defined by Equation (2) as B R r , where the symbols “⌈” and “⌉” represent a ceiling function that returns the nearest integer that is greater.
B R r = R T r f r
For instance, we need an R 1 frequency of 5 min ( f r = 1 / 300 s 1 ), and the total trip is 570 s, defined by Equation (3), where N is the number of stops:
R T 1 = Total distance Bus avg . speed + ( Stop time ) × N R T 1 = 4 km 30 km / h + ( 30 s ) × 3 R T 1 = 570 s
As a result, the number of buses needed for R 1 for this case is defined by Equation (4) as:
B R r = 570 s × 1 300 s B R r = 2
As we can see in Equation (2), if we increase the frequency of a route, we will need to have more buses to meet the demand. Nevertheless, the number of buses is limited by the total fleet size or even by the roads’ capacity. Then, to find the route’s frequency, we have an optimization problem described by Equation (5), where the objective is to minimize the total travel time, restricted by the total fleet size [67].
minimize i N j N D i j T i j ( f ) subject to : r R R T r f r total fleet size
where:
  • N = total stops;
  • R = total routes;
  • D i j = OD (Origin-Destination) demand;
  • T i j = passenger travel time;
  • R T r = round-trip time on route r;
  • f r = frequency on route r;
The passenger travel time T i j includes the expected waiting time, as a function of the routes’ frequencies f . Unfortunately, this travel time cannot be calculated directly, because it depends on other variables such as the buses’ capacity, the stops’ capacity, and the routes’ stops’ table. Furthermore, the buses’ free seats depend on the buses’ capacity and the number of passengers that have boarded the buses at the previous stops. This correlation between the buses’ free seats with other variables of the systems converts this into an NP-hard problem, where the approach to this problem relies on heuristic techniques for systems of a reasonable size [67].

2.1. Passenger Demand in Public Transport Systems

The Origin-Destination matrices (OD) specifies the passengers’ travel demands between the origin and destination nodes in the network. Geographic Information Systems (GIS) have been used effectively for OD data analysis, supporting geocoding OD survey data to point locations [68]. The OD matrix is dynamic because it is time varying. Inside a city’s public transport system, the OD matrix varies on weekdays and weekends and even between different hours of the day. A high quality OD matrix is a fundamental prerequisite for any serious transport system analysis. Surveys have been done to define the OD matrices [68,69]; nevertheless, more sophisticated methods are used today for this purpose, such as passive smart card fare collection system data [70,71] or mobile network data [72].

2.2. Public Transport Vehicle Routes

In public transport systems, the vehicles (trains or buses) follow a route to meet the passengers’ demand. The route is defined by a set of stops, where the bus picks up or alights passengers. Furthermore, the route’s frequency is defined as how often the bus is dispatched for each route. That also means how frequent a bus route passes one stop. Due to the dynamic nature of the OD, one of the essential components in determining the public transport service is the selection of the most suitable routes’ frequency by time-of-day and day-of-week. The routes’ design also includes the development of timetables, scheduling buses, and scheduling drivers. The route layout design depends on the passenger flow because routes are configured to provide a direct or indirect connection between origin-destination demand for passengers.

2.3. Traffic Simulation Software

There is much literature that deals with topics about the simulation of traffic networks especially focused on traffic simulation of private vehicles  [73,74,75,76,77,78,79,80,81]. This literature presents simulation systems based on the different models already explained (macroscopic, microscopic, and mesoscopic). With the help of these models, different computational tools have been designed to help to simulate traffic environments. For macroscopic models, there are for example tools such as: Strada [82], Metacor [83], Visum [84], and Emme [85], among others. On the other hand, SUMO [86], PTV VISSIM [87], and Aimsun [88] are some of the tools available that allow traffic simulation with microscopic models. For mixed or mesoscopic models, some of the existing tools are: OmniTRANS [89], TransModeler [90], and the Aimsun [88].
For public transport systems, in Bogotá, Colombia, the Bus Rapid Transit (BRT) system Transmilenio uses two of the most recognized tools for strategic route planning. These tools are PVT Vissim for microsimulation (traffic simulation at intersections, stop crowds simulation, etc.) and Emme for route planning (macrosimulation). With PTV Vissim, it is possible to carry out the specific traffic congestion simulation at an intersection; furthermore, traffic light crossing or lane sections, without these unit simulations interacting with each other to predict a global behavior. On the contrary, Emme allows planning routes based on predictions of passenger demand.
Optimizing the routes’ frequencies has been widely studied because this type of optimization can reduce the operating costs and travel times of passengers [5,91,92]. Unfortunately, frequency programming optimization for buses and public transport trains is known to be in the class of NP-hard [93] problems. These kinds of problems cannot be solved in polynomial time [94], which indicates that an algorithm may take an indeterminate time to find the solution to this problem.

2.4. Traffic Simulation Parameters’ Specification

For this research work, we define the public transport system parameters’ specification with the following conditions and variables. First, we have the system conditions that are defined in Table 1. These conditions define the total number of stops, a full OD matrix of size N × N , the max passenger capacity of each stop, and the stop position.
On the other hand, Table 2 defines the variables related to the routes and buses. Here, we find the total number of routes, the maximum number of buses available per route, the frequency of each route, the maximum passenger bus capacity, and the route stops’ table array. The stops’ table array represents the stations (or transit stops) where the bus route stops.
Next, Table 3 presents the simulation output variables, which indicate the performance of the public transport system with the actual routes’ configuration. These output variables consist of the total departed passengers per stop, the alighted passengers at the destination stop, the total average passengers’ commute time, and the average passengers’ commute time for the alight stop.

2.5. Simulation Performance Indicators

Table 4 shows the simulation performance variables. These variables indicate the simulation execution time and how fast the parallel simulation is relative to the real system and the sequential execution.
Simulation performance can be measured using two measures of effectiveness, namely the real-time factor and the speed-up factor. The real-time factor is a measure of the relative speed of simulation concerning real time [95]. In this work, we measure the real time factor of the parallel implementation by using Equation (6). For example, if we are simulating 1 h (3600 s) of the public transport systems’ routes in 3 s of execution time by the parallel model, the real-time factor will be 1200.
r t f = t s t p s t
On the other hand, the speed-up factor ( s u f ) is a measure of parallel simulation performance, which reveals how much faster the simulation is executed in parallel versus the sequential one [95]. Equation (7) describes how to calculate it. For instance, if the simulation execution time in parallel is 3 s and in the sequential one 30 s, the speed-up factor is 10.
s u f = s s t p s t
The efficiency ( e f ) describes where the improvements would be useful [96]. Equation (8) describes the efficiency as a function of the number of processing threads (p). It also represents the relationship between the minimum theoretical execution time for a parallel implementation ( s s t / p ) and the measured processing time for the parallel run p s t ( p ) .
e f ( p ) = s s t / p p s t ( p )

3. Masivo Public Transport Routes’ Simulation

In this section, we describe the components and the operational description of the developed public transport routes’ simulation called Masivo. Masivo is a public transport simulation software built in this research project to evaluate the new parallel simulation model proposed. This software is divided into three main components, as described in Figure 3.
First, we have the Parameters’ Loading Module (PLM), which is a Python sequential module that loads two CSV files with the information related to the OD matrix, stops, and routes. Then, we have the Parallel Simulation Core (PSC), which runs in OpenCL. The PSC runs the public transport route simulation model, by running each stop’s operation in an independent work-item. Finally, we have the Results’ Statistics Module (RSM), which is a Python module that extracts the statistical information related to passengers served, commute times, and simulation performance. The following subsections describe in-depth these three components. The full Masivo source code is available on GitHub (masivo codebase: https://github.com/jpruiz84/masivo), including installation instructions.

3.1. Parameters Loading Module

The Parameters Loading Modules (PLM) is a Python module that executes sequential operations to load and prepare the passenger arrival queue for the PSC. The PLM opens two CSV files, one with the information needed for the stop operations and others with the information needed for the bus operations, as described in Figure 4. The content of the two input files is described below.

3.1.1. ODM CSV File

The ODM (OD Matrix) CSV file contains the information related to the operation of the stops. This information includes the names of the stops, stops’ position (X and Y), stops’ max capacity, and the OD matrix. Table 5 shows an example of an ODM file for a three stop system. The first column (stop_number) has the following list of numbers starting at zero to identify each stop. The second column (stop_name) presents a text string with the stop name due in real transport systems. Here, a name, instead of a number, is used to identify a stop or station. Then, the third and fourth columns indicate the X and Y position in meters. The fifth column shows the maximum passenger capacity at each stop. Finally, the last three columns indicate the OD matrix, where the first row of these columns represents the names of the destination stops.

3.1.2. Routes’ CSV File

The routes’ CSV file contains the information related to the route’s operation. This information includes the routes’ set, names, routes’ frequencies, routes’ time offset, routes’ direction, routes’ notes, and stops’ table. Table 6 shows an example of a routes’ file with four routes’ information. The first column (number) has the following list of numbers starting at zero to identify each route. The second column (name) presents the text string with the route name, as in a real transport system, names composed of letters and numbers are used to identify a route. The third column (freq.) indicates the route frequency in seconds, which represents how often a bus is dispatched for each route. The fourth column (offset) represents the route time offset in seconds, and it is the time when the first bus of each route is sent. The fifth column (buses) indicates the maximum number of buses available for each route. The sixth column (dir.) indicates the direction of this route, where W-E is west to east and E-W is east to west. The seventh column (notes) is used only for information proposes (not used by the PSC) and indicates, in this case, the type of route. Finally, the eighth column (stops_table) contains the stops’ table, which indicates the stop stations where the bus has to stop to pick up or alight passengers.

3.1.3. Passenger Arrival Queue Generation

After loading the ODM and routes’ CSV files, the PLM generates the passenger arrival queue ( p a q ) for each stop from the OD matrix defined as D. The  p a q i is an array that contains the passenger that will arrive at the stop during the simulation. The passengers are sorted by the arrival time, starting with the first passenger that arrives at the stop. Algorithm 1 describes the full process to generate the p a q . First, in Line 2, we define the PASS_TOTAL_ARRIVAL_TIME as 3600 s. This means that the passengers will arrive at the stops from Time 0 to 3600 s during the simulation. Then, in Line 3, we declare a for loop that will run in each of the stops i and then will run the rows of the OD matrix D. The passengers’ queues are statics list, with a fixed size of STOP_MAX_PASS (by default, 10,000). Then, we initialize these lists, with a status value in each field that indicates the end of the list ( P A S S _ S T A T U S _ E N D _ L I S T ) and an a r r i v a l _ t i m e that is an unsigned short (UINT16) variable to the maximum possible value. This initialization is done by the operation performed in the loop from Lines 4 to 8.
Algorithm 1 Passenger arrival queue generation algorithm.
1:
proceduregeneratePaq
2:
     P A S S _ T O T A L _ A R R I V A L _ T I M E 3600 ;
3:
    for i 0 to t o t a l _ s t o p s do
4:
        for j = 0 to S T O P _ M A X _ P A S S do
5:
            p w q i [ j ] . s t a t u s = P A S S _ S T A T U S _ E N D _ L I S T ;
6:
            p a q i [ j ] . s t a t u s = P A S S _ S T A T U S _ E N D _ L I S T ;
7:
            p a q i [ j ] . a r r i v a l _ t i m e = U I N T 16 _ M A X ;
8:
        end for
9:
        
10:
        for j = 0 to t o t a l _ s t o p s do
11:
           for k = 0 to D [ i , j ] do
12:
                p a q i [ j ] . o r i g _ s t o p = i ;
13:
                p a q i [ j ] . d e s t _ s t o p = j ;
14:
                p a q i [ j ] . a r r i v a l _ t i m e = P A S S _ T O T A L _ A R R I V A L _ T I M E × k / D [ i , j ] ;
15:
           end for
16:
        end for
17:
        Sort p a q i by a r r i v a l _ t i m e ;
18:
    end for
19:
end procedure
Later, in Line 10, we define a for loop to cover all destination stops. This will run the columns of the OD matrix D. In Line 11, we set another for loop that will run for each passenger that will travel from stop index i to stop index j. In Lines 12 to 14, we set the passenger’s origin stop p a q i [ j ] . o r i g _ s t o p , the destination stop p a q i [ j ] . d e s t _ s t o p , and the arrival time p a q i [ j ] . a r r i v a l _ t i m e . Finally, after the full list of passengers is generated for the stop i, we sort the passengers of p a q i by the arrival time. With this, the PSC can process p a q efficiently, as we will discuss later.

3.2. Parallel Simulation Core

The Parallel Simulation Core (PSC) runs in an OpenCL kernel the passenger operations and the buses’ position update. The simulation tick is 1 s (this means that all simulation components are updated every 1 s). Each passenger has a data structure that contains the data needed for his operations. Figure 5 shows the passengers’ operations and the passengers data information. Each passenger has an ID that identifies him/her in the system; furthermore, the origin and destination stop numbers that indicate at which stop the passenger has arrived and at which stop he/she will alight. The arrival time is the time in the simulation that indicates when the passenger has arrived, and the alight time indicates when the passenger has alighted. The status points out the actual status of the passenger inside the simulation (to arrive, arrived, on the bus, alighted, or empty). The empty status means that this space is free for another passenger, such as a seat on the bus. This passenger structure uses 13 bytes of data per passenger.
The stops are defined in the simulator by an array of structures. As described in Figure 5, each element inside the stops’ array has a stop number. Furthermore, they include the stop position in the map, total passengers, the last empty index, which indicates which was the last space empty in the waiting queue, and the passengers’ queues. Second, we include the arrival queue for passengers that will arrive at the stop. Third is the waiting queue for passengers that have arrived at the stop and are waiting for the bus. Finally, there is the alight queue for passengers that have finished the trip and have alighted at the stop. Each stop structure uses 130 KB of data.
Next, we have an array of structures that describes the buses in the simulator. As shown in Figure 5, each element inside the buses’ array has a bus number. Besides, we include the current stop index, which indicates at which stop the bus is, and the last stop index, which indicates which was the last stop where the bus stopped. Similarly, we incorporate here the stops’ arrays that have the stops’ index where the bus will stop to pick up or alight passengers. Finally, we include the total number of passengers on the bus and the passengers’ array that has the data of the passengers that are on the bus.
Moreover, in Figure 5, we see the three passengers’ operations (1, arriving; 2, boarding; 3, alighting). During the arriving, the passenger passes from the arrival queue to the waiting queue at the origin stop. During the boarding, the passenger moves from the origin stop waiting queue to the bus passenger array. Finally, during the alighting, the passengers move to form the bus’s passenger array to the alight queue at the destination stop. These passengers’ move operations are optimized to run efficiently in OpenCL and are described in the following subsections.

3.2.1. Passenger Arriving

In the passenger arriving operation, the passengers arrive at the stop at the arrival time. Algorithm 2 describes this process. First, we have an infinite while loop that breaks when there are no more passengers that will arrive at the stop in the given simulated time. In Line 2, we check if the total number of passengers remaining in p a q is zero. If yes, we break the while loop. In Line 6, we extract the working index ( w _ i n d e x ) of the passengers’ arrival queue ( p a q ) in w. This working index represents the last passenger’s index that has been removed from p a q . Then, in Line 9, if the arrival time of a passenger that we are processing p a q . p [ w ] . a r r i v a l t i m e is greater than the actual simulation time, we do not process this passenger yet. Hence, we break the while loop. Due to the passengers in p a q being sorted by a r r i v a l t i m e , we do not need to process the next passengers, because we already know that a r r i v a l t i m e will be greater than s i m t i m e .
Algorithm 2 Passengers’ arriving operation at stop n, where passenger arrival queue p a q and passenger waiting queue p w q are specific for stop n.
1:
while TRUE do
2:
    if p a q . p [ l ] . t o t a l = 0 then
3:
        break;
4:
    end if
5:
    
6:
     w p a q . w _ i n d e x ;
7:
    if p a q . p [ w ] . a r r i v a l _ t i m e > s i m _ t i m e then
8:
        break;
9:
    end if
10:
    
11:
     l p w q . l a s t _ e m p t y ;
12:
     p w q . p [ l ] p a q . p [ w ] ;
13:
     p w q . p [ l ] . s t a t u s ARRIVED ;
14:
     p w q . l a s t _ e m p t y p w q . l a s t _ e m p t y + 1 ;
15:
     p w q . l a s t _ t o t a l p w q . t o t a l + 1 ;
16:
    
17:
     p a q . p [ l ] . s t a t u s PASS _ STATUS _ EMPTY ;
18:
     p a q . p [ l ] . w _ i n d e x p a q . p [ l ] . w _ i n d e x + 1 ;
19:
     p a q . p [ l ] . t o t a l p a q . p [ l ] . t o t a l 1 ;
20:
    
21:
end while
Thus, we move the passenger from the passenger arrival queue ( p a q ) to the passenger waiting queue ( p w q ) only if the conditions of Lines 2 and 7 are not fulfilled. If we have a valid passenger with a r r i v a l t i m e equal to or less than the simulation time, we move it. For this, in Line 11, we extract the p w q last empty index, which indicates the index of the last empty space in p w q . Then, we assign the actual processing passenger in the arrival queue p a q . p [ w ] to the last empty space in the waiting queue p w q . p [ l ] . Latter, in Lines 13–15, we update the passenger status, and we increment the last empty index and the total counter for p w q . In Lines 17–19, we update the p a q passenger’s status to PASS_STATUS_EMPTY, we update the w _ i n d e x of p a q , to process the next passenger in the next iteration, and we decrement the total counter of passengers in p a q .

3.2.2. Passenger Boarding

The passenger boarding operations run concurrently at each stop. Algorithm 3 describes the boarding operations for the stop n. For this, in Line 1, we start with a main for loop, then run for all the buses. Then, in Line 2, we have an if that only lets us process the bus passenger array ( b p a ) that is at the current stop. In Line 3, if the total number passengers in the waiting queue is zero ( p w q . t o t a l ), we brake, and we do not process more buses, because we do not have passengers at this stop waiting for boarding. In Line 6, we check if the total number of passengers of bus b p a [ j ] has reached the maximum BUS_MAX_PASS (the bus is full). If yes, we continue to process the next bus.
At this point, in Line 9, we know that passengers are waiting at the stop, and the bus is not full. Therefore, we check for each passenger at the stop to check which of them needs to board the actual bus. For this, in Line 9, we set a temporal variable l a s t _ e m p t y _ s e a t _ i n _ b u s to zero. This variable indicates which is the last seat on the bus that is empty. In this way, if there is more than one passenger in the stop to board the bus, we will not start from the beginning of the seats to check which is empty for each passenger.
To check if a passenger is at the stop, in Line 10, we have a for loop, then it runs over passenger waiting queue until STOP_MAX_PASS, that is the last position of the queue (in this case, 10,000). The queue is a static list with a size of 10,000. We know that there will be no more than 10,000 passengers in this queue; the total number of passengers in this queue is always less than this size. To know if we have passed the last passenger that has arrived in the queue, we check that the passenger’s status is PASS_STATUS_END_LIST. If yes, we break, and we finish checking for passengers to board at this stop. In Line 15, we check if the status of the passenger ( p w q [ k ] ) is PASS_STATUS_ARRIVED, which indicates that the passenger has arrived at the stop and is waiting for the bus. Then, in Line 16, we check if the destination stop of this passenger is in the stops’ table of the bus that we are processing. If yes, in Line 17, we have a for loop that checks the next empty seat on the bus, with the if condition in Line 18. If the position is empty on the bus, we move the passenger from the waiting list to the bus empty seat in Line 19. In Lines 20 and 21, we update the passenger’s status to PASS_STATUS_IN_BUS, and we increment the total number of passengers on the bus. In Lines 22 to 23, we update the status of the empty space in the p w q , and we decrement the total number of passengers at the stop. Finally, in Line 24, we update the temporal variable l a s t _ e m p t y _ s e a t _ i n _ b u s to l, so that when we process the next passenger at this stop in this simulation time iteration, we do not start from the beginning of the bus seats, which we already know are not empty.
Algorithm 3 Passengers’ boarding operation at stop n, where p w q is the passenger waiting queue specific for the stop n.
1:
for j 0 to t o t a l _ b u s e s do
2:
    if s t o p _ n u m = b p a [ j ] . c u r r _ s t o p then
3:
        if p w q . t o t a l = 0 then
4:
           break;
5:
        end if
6:
        if b p a [ j ] . t o t a l BUS _ MAX _ PASS then
7:
           continue;
8:
        end if
9:
         l a s t _ e m p t y _ s e a t _ i n _ b u s 0 ;
10:
        for k 0 to STOP _ MAX _ PASS do
11:
           if p w q [ k ] . s t a t u s = PASS _ STATUS _ END _ LIST then
12:
               break;
13:
           end if
14:
           
15:
           if p w q [ k ] . s t a t u s = PASS _ STATUS _ ARRIVED then
16:
               if p w q [ k ] . d e s t _ s t o p in b p a [ j ] . s t o p s _ t a b l e then
17:
                   for l l a s t _ e m p t y _ s e a t _ i n _ b u s to BUS _ MAX _ PASS do
18:
                       if b p a [ j ] . b p l [ l ] . s t a t u s = PASS _ STATUS _ EMPTY then
19:
                           b p a [ j ] . b p l [ l ] p w q [ k ]
20:
                           b p a [ j ] . b p l [ l ] . s t a t u s PASS _ STATUS _ IN _ BUS
21:
                           b p a [ j ] . t o t a l b p a [ j ] . t o t a l + 1
22:
                           p w q [ k ] . s t a t u s PASS _ STATUS _ EMPTY
23:
                           p w q . t o t a l p w q . t o t a l 1
24:
                           l a s t _ e m p t y _ s e a t _ i n _ b u s l
25:
                          break;
26:
                       end if
27:
                   end for
28:
               end if
29:
           end if
30:
           
31:
        end for
32:
    end if
33:
end for

3.2.3. Passenger Alighting

The passenger alighting operations also run concurrently at each stop. Algorithm 4 describes the boarding operations for the stop n. For this, in Line 1, we start with a main for loop that runs for all the buses. Then, in Line 2, we have an if that only lets us process the bus passenger array ( b p a ) that is in the current stop. In Line 3, we have an if that only lets us process buses that have more than zero passengers. In this way, at this point, we know that the bus is at the stop, and we have at least one passenger there. Then, in Line 5, we have another for loop that runs for all the bus’s seats. Later, the if condition in Line 6 checks if there is a passenger in the actual processing seat. Next, the if condition in Line 7 check if the passenger’s destination stop is the same as the actual stop. If yes, we know that the passenger must alight from the bus.
Algorithm 4 Passenger alighting operation at stop n, where passenger waiting queue p w q and passenger alight queue p l q are specific for stop n.
1:
for j 0 to t o t a l _ b u s e s do
2:
    if s t o p _ n u m = b p a [ j ] . c u r r _ s t o p then
3:
        if b p a [ j ] . t o t a l > 0 then
4:
           
5:
           for k 0 to BUS _ MAX _ PASS do
6:
               if b p a [ j ] . b p l [ k ] . s t a t u s = PASS _ STATUS _ IN _ BUS then
7:
                   if b p a [ j ] . b p l [ k ] . d e s t _ s t o p = p w q . s t o p _ n u m then
8:
                        l p l q . t o t a l ;
9:
                        p l q [ l ] b p a [ j ] . b p l [ k ] ;
10:
                        p l q [ l ] . s t a t u s PASS _ STATUS _ ALIGHTED ;
11:
                        p l q [ l ] . a l i g h t _ t i m e s i m _ t i m e ;
12:
                        p l q . t o t a l p l q . t o t a l + 1 ;
13:
                       
14:
                        b p a [ j ] . b p l [ k ] . s t a t u s PASS _ STATUS _ EMPTY ;
15:
                        b p a [ j ] . t o t a l b p a [ j ] . t o t a l 1 ;
16:
                   end if
17:
               end if
18:
           end for
19:
           
20:
        end if
21:
    end if
22:
end for
To alight the passenger from the bus to the stop, first in Line 8, we get the last empty index of the passenger alight queue ( p l q ) for the temporal variable l. Next, in Line 9, we move the passenger from the bus b p a [ j ] . b p l [ k ] to the alighting stop p q l [ l ] . Later, in Lines 10 to 11, we update the passenger status to PASS_STATUS_ALIGHTED, we set the alight time, and we increment the total number of passengers in the alight queue. Finally, in Lines 14 and 15, we set the status of the empty seat on the bus to PASS_STATUS_EMPTY, and we decrement the passengers’ total number for this bus.

3.2.4. Buses’ Position Update

The buses’ position update runs sequentially per bus in an independent OpenCL work item. This position update consists of moving the bus across the stops and holding the bus at the stops inside the stop table for a fixed time in seconds. Algorithm 5 shows the operations for the bus position update. First, in Line 1, we have a for loop to run for all the buses. Then, in Line 2, we check if we have to start a new bus according to the route frequency and time offset. In Line 4, we check if the bus is already at a stop. If yes, we decrement i n _ t h e _ s t o p _ c o u n t e r , which indicates how many seconds are remaining for the bus to be held at the stop. In Line 6, we check that i n _ t h e _ s t o p _ c o u n t e r is zero. If yes, we set i n _ t h e _ s t o p to FALSE, indicating that the bus has finished the holding time at the stop.
Algorithm 5 Bus update position operations.
1:
for i 0 to t o t a l _ b u s e s do
2:
    check_if_start_the_bus( b u s [ i ] );
3:
    
4:
    if b u s [ i ] . i n _ t h e _ s t o p = TRUE then
5:
         b u s [ i ] . i n _ t h e _ s t o p _ c o u n t e r b u s [ i ] . i n _ t h e _ s t o p _ c o u n t e r 1 ;
6:
        if b u s [ i ] . i n _ t h e _ s t o p _ c o u n t e r = 0 then
7:
            b u s [ i ] . i n _ t h e _ s t o p = FALSE ;
8:
        end if
9:
    end if
10:
    
11:
    if b u s [ i ] . i n _ t h e _ s t o p = FALSE then
12:
         b u s [ i ] . c u r r _ p o s b u s [ i ] . c u r r _ p o s + TRAVEL _ SPEED ;
13:
    end if
14:
    
15:
    if b u s [ i ] . c u r r _ p o s = next stop window then
16:
         b u s [ i ] . c u r r _ s t o p n e x t _ s t o p _ i ;
17:
         b u s [ i ] . i n _ t h e _ s t o p TRUE ;
18:
         b u s [ i ] . i n _ t h e _ s t o p _ c o u n t e r BUS _ STOPPING _ TIME ;
19:
    end if
20:
end for
Then, in Line 11, we check if the bus is not at the stop. If it is not held at the stop, we increment the current position ( c u r r _ s t o p ) according to TRAVEL_SPEED. Finally, we check in Line 15 if the bus is in the stop window of the next stop. If yes, we update the c u r r _ s t o p and i n _ t h e _ s t o p variables accordingly; also, we set i n _ t h e _ s t o p _ c o u n t e r to BUS_STOPPING_TIME, which by default is 20 s.

3.3. Results Statistics Module

The Results Statistics Module (RSM) is a Python module that extracts the statics information results from the executed simulation. It extracts the number of passengers served, the passengers’ commute time, and the simulation performance. Masivo saves this information in the result folder, including CSV files and statistics graphs.

3.3.1. Passengers Served Information

When the simulation is done, each of the stops has a passenger alight queue, which contains the full passenger structure information (passenger ID, origin and destination stops, arrival and alight time, and status), as described in Figure 5. Masivo saves this information and statics about this information in the following output files.
  • total_passengers_results.csv: contains all the information (passenger ID, origin and destination stops, arrival and alight time, and status) of all passengers inside the simulation.
  • served_passengers_per_stop.csv: describes per stop the total number of passengers waiting for a bus, the expected total input passengers, the total alight passengers, the total expected alight passengers, and the alighted passengers’ percentage.
  • served_passengers_per_stop.eps: graphs the total alighted passengers contrasted with the remaining passengers expected per stop.
  • commute_time_per_stop.eps: graphs the average commute time of the alighted passengers per destination stop and per travel direction. This graph is useful to see how the commute time is affected at a specific destination stop depending on traffic congestion on the road.

3.3.2. Performance Information

To know the simulation performance, Masivo saves useful simulation timings and host computer status information. These data are stored in the following files:
  • performance_timeline.csv: contains the real-time simulation factor over time, with a sampling frequency of 100 s of the simulation. Furthermore, this file contains information related to CPU usage and CPU operation frequency over time.
  • performance_timeline.eps: graphs the real-time factor over time, the real-time factor low-pass filtered signal, the CPU usage, and the CPU operation frequency.
  • simulation_brief.csv: contains all simulation configured parameters, total simulation outputs, and total performance indicators. In particular, as inputs, this file contains the buses’ average travel speed, bus max passengers, bus stopping time, end simulation time, ODM file, passenger total arrival time, routes’ file, and stop to bus windows’ distance. As outputs, we find here total alighted expected passengers, total alighted passengers, total alighted passenger percentage, total average commute time, total simulated buses, total simulated passengers, total routes, and total stops. Finally, for the total performance indicators, we include in this file the average CPU usage, average real-time factor, total simulation execution time, OpenCL device name and compute units used, and the limit of the max OpenCL compute units.

3.4. 3D System Visualization Output

For validation purposes, a 3D system visualization output was integrated into Masivo. This visualization system is based on a Python 3D engine called Panda3D. When enabled, a separate thread runs the 3D visualization, with a running interval of 30 fps. In each frame update, the buses’ position, buses’ occupied seats, stops’ alighted passengers, and stops’ waiting passengers values are updated from the PSC. Figure 6 shows this 3D output interface. Here, the stops are represented with a blue container, which has a horizontal red bar that indicates the percentage of passengers in the waiting queue relative to the maximum stop passenger capacity. The vertical purple cylinder represents the percentage of alighted passengers relative to the total expected alight passengers. The bus has a horizontal red bar, which represents the percentage of occupied seats relative to the maximum bus passenger capacity.

3.5. Validation Simulator

A validation simulator was built only using Python (called here Pure Python) with dynamic arrays (to emulate passenger’s queues). This Pure Python simulator helped to get results that ensured the correct operation of the routes inside an origin-destination demand and then compared these results with the parallel simulator. In this simulator, contrary to the Masivo PSC, the boarding and alighting operations were performed per bus that was held at a stop and not at the stop.
The correct behavior for this simulator was validated with the 3D system visualization output. For this, a three stop small public transport simulation system was simulated. The ODM matrix used here is described by Equation (9), totaling 80 passengers. The passengers arrived at the stops from Time 0 to 3600 s.
ODM matrix = 0 10 20 10 0 10 20 10 0
Two routes, with a 15 min frequency, were used for this system. The routes’ files are described by Table 7.
Figure 7 shows the 3D visualization output for three different simulation times. Figure 7a shows the stops at the time 800 s of the simulation. Here, some passengers have arrived at the stops, but the buses have not departed yet. Figure 7a shows the simulation at the time of 1900 s. Here, some passengers have arrived at their destination stops. Furthermore, we see two buses moving passengers. Finally, Figure 7c shows the end of the simulation, where all passengers have arrived at their stops.
Furthermore, Figure 8 shows the total alighted and not alighted passengers at each stop. Here, we note that all passengers (80 of 80 expected) alighted at their destination stops.
Finally, this validation simulation also calculated the average commute for the passengers per destination stop and travel direction, as shown in Figure 9. Here, we note that the commute time for corner stops (Stop_00 and Stop_02) was greater than the commute time of the center stop (Stop_01). This was because, for instance, Stop_02 received passengers from the closest stop Stop_00 and the furthest stop Stop_01. Meanwhile, Stop_01 received a passenger for the closer stops Stop_00 and Stop_02; hence, the passengers’ average commute time was lower.

4. Results

In this section, we discuss the simulation model results. First, we present the results for the validation process, where we compare the Masivo PSC outputs with the Pure Python validation simulator. Then, we show the performance results.

4.1. Validation Results

For the validation of the Masivo PSC, four different scenarios were created. These scenarios, with the same conditions, were simulated in the Masivo PSC and the Pure Python validation simulator. Output simulation results related to alighted passengers per stop and the commute time were compared.

4.1.1. Scenario 1, 30 Stops and Two Routes at 54 km/h

The simulation conditions for Scenario 1 are summarized in Table 8. The two routes pick up and alight passengers from all stops, with a bus departing frequency of 1 min. The first route goes from west to east, and the second one goes from east to west. The separation of the stops is 400 m, totaling a line length of 12 km for the 300 stops.
Figure 10 shows the alighted passenger numbers per stop and the total alighted passenger numbers and percentage. The percentage of alighted passengers for the Masivo PSC was 99.85% and 100.00% for the Pure Python validation simulator, giving an error of 0.15%.
Figure 11 shows the average passengers’ commute time per destination and the total average commute time. Masivo PSC showed a total average commute time of 15.77 min. Meanwhile, the Pure Python validation simulator showed a total average commute time of 16.44 min, giving us an error of 0.52% relative to the total simulation time.

4.1.2. Scenario 2, 30 Stops and Two Routes at 70 km/h

The simulation conditions for Scenario 2 are summarized in Table 9, where the difference between this and Scenario 1 was the transit bus speed, increased from 54 km/h to 70 km/h.
Figure 12 shows the alighted passenger numbers per stop and the total alighted passenger numbers and percentage. The percentage of alighted passengers for the Masivo PSC was 99.62% and 100.00% for the Pure Python validation simulator, giving an error of 0.38%.
Figure 13 shows the average passengers’ commute time per destination and the total average commute time. Masivo PSC showed a total average commute time of 14.02 min. Meanwhile, the Pure Python validation simulator showed a total average commute time of 14.47 min, giving us an error of 0.37% relative to the total simulation time.

4.1.3. Scenario 3, 30 Stops and Four Routes at 54 km/h

The simulation conditions for Scenario 3 are summarized in Table 10, where the difference between this and Scenario 1 is the number of routes. Here, we have two new routes that do not stop at all stops. These new routes stop at the corners and in the downtown area where the demand is higher than the others. Both new routes have a frequency of 2 min. Precisely, Route 3 stops at Stop_00, Stop_01, Stop_02, Stop_03, Stop_18, Stop_19, Stop_20, Stop_21, and Stop_22. Meanwhile, Route 4 stops at Stop_29, Stop_28, Stop_27, Stop_26, Stop_22, Stop_21, Stop_20, Stop_19, Stop_18.
Figure 14 shows the alighted passenger numbers per stop and the total alighted passenger numbers and percentage. The percentage of alighted passengers for the Masivo PSC was 99.37% and 100.00% for the Pure Python validation simulator, giving an error of 0.63%.
Figure 15 shows the average passengers’ commute time per destination and the total average commute time. Masivo PSC showed a total average commute time of 15.71 min. Meanwhile, the Pure Python validation simulator showed a total average commute time of 16.33 min, giving us an error of 0.52% relative to total simulation time.

4.1.4. Scenario 4, 300 Stops and Two Routes at 54 km/h

The simulation conditions for Scenario 4 are summarized in Table 11. It consists of 300 stops, which have a normal distribution with more demand for longer distances plus a random number of passengers. Furthermore, corner stops have two times more demand than the others. The two routes pick up and alight passengers from all stops, with a bus departing frequency of 30 s. The first route goes from west to east, and the second one goes from east to west. The separation of the stops is 400 m, totaling a line length of 120 km for the 300 stops. Then, the end simulation time is 10 h, so that all passengers have enough time to finish traveling.
Figure 16 shows the alighted passenger numbers per stop and the total alighted passenger numbers and percentage. The percentage of alighted passengers for the Masivo PSC was 99.52% and 100.00% for the Pure Python validation simulator, giving an error of 0.48%.
Figure 17 shows the average passengers’ commute time per destination and the total average commute time. Masivo PSC showed a total average commute time of 297.55 min. Meanwhile, the Pure Python validation simulator showed a total average commute time of 298.37 min, giving us an error of 0.13% relative to the total simulation time.

4.2. Performance

The performance simulation execution was performed in a dedicated server rented from 1&1 IONOS (https://www.ionos.com/servers/dedicated-servers). The specification of the rented server is described in Table 12. Before each performance test, the Linux CPU scaling governors were set in performance mode, to enable the maximum operating frequency.
For the performance tests, the most complex simulation scenario (Scenario 4 previously tested) was used. This is a simulation scenario that has 300 stops and two routes. Table 13 describes the full list of conditions. It consists of 300 stops, which have a normal distribution with more demand for longer distances plus a random number of passengers. Furthermore, corner stops have two times more demand than the others. The two routes pick up and alight passengers from all stops, with a bus departing frequency of 30 s. The first route goes from west to east, and the second one goes from east to west. The separation of the stops is 400 m, totaling a line length of 120 km for the 300 stops. Then, the end simulation time is 10 h, so that all passengers have enough time to finish traveling.

4.2.1. Pure Python Validation Simulator Performance

The performance simulation of Scenario 4 was evaluated in the Pure Python validation simulator. Table 14 shows the performance output values. The total simulation execution time was near one hour (3303 s) for 10 h of simulation time. Then, the average real-time factor was 32.76 times faster than in real-time. Furthermore, we noted that due to this simulator being a sequential implementation, only one of the 40 processing threads was used, then only 2.19% of all the processing power was used.
Figure 18 shows the real-time factor (RTF) vs. the simulation time. Here, we note that the RTF starts at 780, and then, it has an exponential decline, getting values under 10 times. This decline is because the Pure Python simulator uses dynamic lists to handle passengers and buses. When the system starts, the number of passengers and buses is low. However, then, more passengers arrive at the stops, and more buses are dispatched. Hence, the systems have more elements to process, and the simulation speed decreases.
Furthermore, in Figure 18, we see that the CPU usage was always near 2.5%, due to the fact that the sequential implementation will never use more than one processing thread. Finally, the CPU frequency started at 3.2 GHz. However, because the CPU was not fully used, the OS decreased the CPU frequency during the simulation execution.

4.2.2. Masivo PSC Performance

The Masivo Parallel Simulation Core (PSC) performance was also evaluated using Test Scenario 4. Table 15 shows the performance output values. The total simulation execution time was 11.822 s, 278 times faster than the Pure Python simulator. The average real-time factor was 3050 times faster than real-time, and the average CPU usage was 84.21%.
Figure 18 shows the real-time factor vs. the simulation time. Here, we note that the RTF starts in 4300, and then, it has an exponential decline, stabilizing near 2500. This decline is because when the system starts, the number of passengers and buses is low, and the internal for loop that runs the statics list does not need to go to the end of the lists. Later in the simulation, more passengers arrive at the stops, and more buses are dispatched. Hence, the systems have more elements to process, and the simulation speed decreases. This decreasing is not as low as in the Pure Python simulator, due to the concurrent processing operations performed per stop. Finally, from the simulation time of 15,000, we see that the RTF is increasing due to the passengers arriving at the final destination, then there are fewer elements to process.
Figure 19 shows that the CPU usage is near 80%, due to all the cores being used most of the time. Finally, the CPU frequency started and sustained at 3.2 GHz, because the OS maintained this due to the high processing demand.
As described in Section 2.5, the simulation performance indicators were extracted. Figure 20 shows these indicators for the simulation executed with the compute units limited from one to 40. These results helped us to identify the performance for the different numbers of processing units and the efficiency of the proposed model.
First, Figure 20a shows the simulation execution time vs. the compute units. We see here that the execution time required to run the 10 h simulation was reduced exponentially with more compute units. Nevertheless, we had a low limit, near 10 s, because there were operations in the model that were not parallelized, such as the position update of the buses. Second, Figure 20b shows the real-time factor, which also increased, with the number of cores reaching a final value near to 3000.
Next, Figure 20c has the same shape as the RTF, because it is a function also of the simulation execution time, but in this case, divided by the simulation execution time for one compute unit. We see here that the maximum speed up factor reached was 10.2 times faster than the sequential simulation. Finally, we have the efficiency in Figure 20d, which shows an efficiency of more than 50% for 10 or less compute units.

5. Discussion

In this section, we discuss the performance of Masivo PCS versus other simulation tools. Table 16 summarizes the documents related to parallel simulation applications for traffic and transit systems and also for Masivo PSC. FPGA applications include urban traffic simulation [97], with one document in which the authors in 2005 developed a microscopic simulation of road traffic. They simulated the Portland road network with 124,000 road segments and 100,000 intersections, achieving a speed-up factor of 4.5 [98]. For GPU’s parallel architecture, we found five implementations, where four were related to road traffic and one to public transit simulation. In 2012, Wang et al. built a GPU based traffic parallel simulation module, which was able to simulate three hours (10,800 s) of road traffic of a 40 × 40 lattice road network, with 5000 vehicle agents in 109 s, achieving a speed-up of 105 and a real-time factor of 102 [99]. Later, in 2014, Xu et al. implemented a mesoscopic road traffic simulation on CPU/GPU. This implementation was tested in a road network of 10,201 nodes, 20,100 unidirectional links, and 100,000 vehicles during 1000 simulation ticks (each tick was 1 s). The simulation time for this network was 4720 ms for CPU and 423 ms for GPU, getting a speed-up of 11.2 and a real-time factor of 2364 [60].
In 2017, Song et al. implemented the mesoscopic traffic simulation on GPU developed in [60] for a real-world scenario. The scenario was the Singapore expressway system, which is made up of 3179 nodes, 3388 links, and 9419 lanes with a demand modeled as trips from 4106 OD pairs. In total, 100,000 vehicles loaded into the peak traffic scenario during 1000 simulation ticks (each tick is 1 s) were simulated, and the execution time of this simulation was 1250 ms for CPU against 527 ms for GPU, getting a speed-up 2.37 and a real-time factor of 1897 [59].
Next, in 2019, Saprykin et al. developed GEMSim (GPU-Enhanced Mobility Simulator), a GPU accelerated multi-modal mobility simulator for large scale scenarios. This was a mesoscopic multi-modal, queue based mobility simulator for public transit systems. Here, the large scale scenario of Switzerland with 513,770 nodes, 1,127,775 road links, 27,873 stops, and 21,847 routes was simulated. The simulation ran for a full day (86400 s), and the execution time was 290 s, equivalent to a real-time ratio of 298 for a population of 5.2 million and a real-time ratio of 1300 for 100,000 population size [13]. The same year, Vinh and Tan created a framework for mesoscopic traffic simulation in GPU tested in an updated Singapore expressways network, which has 3186 nodes, 3386 links, and 9437 lanes, with demand modeled as trips from 4103 origin-destination pairs. Up to 300,000 vehicles were simulated, getting a speed-up of five times against the CPU [56].
For multi-core parallel architecture, first in 2012, Potuzak developed a distributed parallel road traffic simulator for clusters of multi-core computers, tested in regular square grids of 64,256 and 1024 crossroads. The simulations ran for 1 h (3600 s) with no number of vehicles specified with an execution time for the best cases of 22 s for 64 crossroads (real-time factor: 163), 86 s for 256 crossroads (real-time factor: 41), and 245 s for 1024 crossroads (real-time factor: 14) [100]. Then, in 2013, Bruegmann et al. developed an online, real-time traffic information system called OLSIMv4 (OnLine Traffic SIMulation version 4), which used microscopic traffic simulations exploiting the thread level parallelism on multi-core machines using a coarse-grained parallel microscopic simulation model. This simulation ran in the highway network of North Rhine-Westphalia (NRW), Germany. The simulated network contained more than 3000 loop detectors bundled into 1300 measurement cross-sections with an average statistical distance of 3.5 km. The simulation ran for 60 min with 120,000 vehicles with an execution time 60 s, resulting in a real-time factor of 60 [101].
In the same year, Fernandes et al. developed a parallel microscopic simulator capable of simulating metropolitan scale traffic using OpenMP. For the simulation, they used a real-world road network of the San Francisco Bay Area, which comprises 145,665 roads with a total of 27,439 km. The simulation ran in 60 s intervals with a step time of 0.1 s and generating a vehicle in each road every 2 s following a negative exponential distribution, totaling 4,349,130 vehicles. With these parameters, they achieved an execution time of 70 s (real-time factor 0.86) and a speed-up factor of 16 times, using 24 processors against the single processor simulation [102].
Masivo PSC uses a mesoscopic simulation model type, due to the buses’ congestion in the road not being modeled. It is focused on public transit system simulation. It achieved a speed-up factor of 10.2 compared with the simulator model running with one compute unit and a speed-up factor of 278 times faster than the Pure Python validation simulator. Compared with other models, Masivo PSC focused on the buses’ route behavior inside a PTS, letting us define the routes’ stops’ table and frequency; and giving us; as a result, the passengers’ commute time. On the other hand, other implementations for commute or waiting passengers’ time simulation and modeling mentioned in the Introduction used a stochastic collective model for waiting time prediction [44] or a model to predict the waiting time based on the passengers’ learning process and adaptation with respect to waiting time uncertainty and travel information [42].

6. Conclusions

A new simulation model for routes in public transport systems using parallel computing called Masivo was presented. Masivo works with a predefined public transport system conditions, which include the stops’ total number, stops’ capacity, and the OD matrix. This OD matrix can be updated in this model via a CSV file. Masivo was built with three main components. The first one is the Parameters Loading Module (PLM), which is a Python module that loads the stops’ information (OD matrix, stops’ positions, stops’ max capacity) and the routes’ information. The second module is the Parallel Simulation Core (PSC), which was built in OpenCL and contains the new purposed simulation model. The PCS was designed to run in parallel the operations of each stop, including the passengers’ arrival, boarding, and alighting, and to run the buses’ displacement process sequentially over the roads. Finally, the Results Statistics Module (RSM) is a Python tool that ran after the PSC to get and analyze the simulation outputs and the performance results.
Furthermore, for Masivo validation, a Pure Python public transport simulator was built for validation purposes. This simulator performed the arrival operations sequentially for each stop. Then, it ran the boarding and alighting operations of each bus that was currently stooped at a station and, finally, executed the buses’ update position operations. Furthermore, it had a 3D output graphic interface to visualize the movement of the buses through the different stops, the stops, the bus occupancy, and the alighted passengers at each stop. This visualization tool helped to validate the consistent operations of this simulator and the Masivo PSC. With the Pure Python public transport simulator validated, we used it to validate the Masivo PSC in four different scenarios. We ran each scenario with precisely the same condition in both simulators to compare the simulation output results. The simulation output results for validation consisted of the total alighted passengers per stop and for the whole system, as well as the average commute time per stop and for the whole system. We found that the relative error was no higher than 0.7 % in all the tested scenarios.
The performance of Masivo was evaluated with the speed-up and real-time factor indicators. Masivo achieved a speed-up factor of 10.2 compared with the simulator model running with one compute unit and a speed-up factor of 278 times faster than the Pure Python validation simulator. The real-time factor achieved was 3050 times faster than the 10 h simulated duration. The performance test scenario used consisted of a public transport simulation with 300 stops, 2400 buses, and 456,997 passengers. This performance value was compared with the most recent traffic and public transport model that performed the simulation of systems with similar size. We found that, to date, there are no models reported specifically designed for PTS that can achieve the real-time factor that we have achieved in this research.
Future work with this model could integrate the passengers’ interchange between the different public transport modes, such as the train to bus. Furthermore, this model has a fast execution time, making this a high performance solution to use in a public transport optimization resources algorithm.

Author Contributions

Conceptualization, J.R.-R., G.R.-G., and R.K.; formal analysis, J.R.-R.; methodology, G.R.-G. and R.K.; project administration, G.R.-G.; software, J.R.-R. and R.K.; validation, J.R.-R.; visualization, J.R.-R.; writing, review and editing, J.R.-R.

Funding

This work was funded by the Departamento Administrativo de Ciencia, Tecnología e Innovación (647-2014) and by the Universidad del Cauca (501100005682).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. United Nations. World Urbanization Prospects; United Nations: New York, NY, USA, 2014; p. 32. [Google Scholar] [CrossRef] [Green Version]
  2. Ruiz-Rosero, J.; Ramirez-Gonzalez, G.; Williams, J.M.; Liu, H.; Khanna, R.; Pisharody, G. Internet of Things: A Scientometric Review. Symmetry 2017, 9, 301. [Google Scholar] [CrossRef] [Green Version]
  3. Ji, Y.; Mishalani, R.G.; McCord, M.R. Transit passenger origin–destination flow estimation: Efficiently combining onboard survey and large automatic passenger count datasets. Big Data in Transportation and Traffic Engineering. Transp. Res. Part C Emerg. Technol. 2015, 58, 178–192. [Google Scholar] [CrossRef]
  4. Budiawan, D.; Soenandi, I.A.; Marpaung, B. Optimilisasi Jumlah Armada Transjakarta di Koridor-8 Jurusan Harmoni-Lebak Bulus dengan Menggunakan Metode Goal Programming. Tek. Dan Ilmu Komput. 2014, 3, 128–137. [Google Scholar]
  5. Ergun, M.; Kesten, A.S. Alteration of bus routes in large-scale networks. Sci. Res. Essays 2011, 6, 5865–5882. [Google Scholar]
  6. Barceló, J. Models, Traffic Models, Simulation, and Traffic Simulation. In Fundamentals of Traffic Simulation; Springer: New York, NY, USA, 2010; pp. 1–62. [Google Scholar] [CrossRef]
  7. Loder, A.; Ambuehl, L.; Menendez, M.; Axhausen, K.W. Empirics of multi-modal traffic networks—Using the 3D macroscopic fundamental diagram. Transp. Res. Part C Emerg. Technol. 2017, 82, 88–101. [Google Scholar] [CrossRef]
  8. Oskarbski, J.; Birr, K.; Miszewski, M.; Zarski, K. Estimating the Average Speed of Public Transport Vehicles Based on Traffic Control System Data. In Proceedings of the 2015 International Conference on Models and Technologies for Intelligent Transportation Systems (MT-ITS), Budapest, Hungary, 3–5 June 2015. [Google Scholar]
  9. Truong, L.; Currie, G. Macroscopic road safety impacts of public transport: A case study of Melbourne, Australia. Accid. Anal. Prev. 2019, 132, 105270. [Google Scholar] [CrossRef]
  10. Drabicki, A.; Kucharski, R.; Cats, O.; Fonzone, A. Simulating the effects of real-time crowding information in public transport networks. In Proceedings of the 2017 5th IEEE International Conference on Models and Technologies for Intelligent Transportation Systems (MT-ITS), Naples, Italy, 26–28 June 2017. [Google Scholar]
  11. Johnsen, A.; Gundersen, E.; Liang, X.; Kaisar, E.; Scarlatos, P. Emergency evacuation methodologies utilizing public transit with meso-simulation. In Proceedings of the Simulation Interoperability Standards Organization—Spring Simulation Interoperability Workshop 2009, San Diego, CA, USA, 23–27 March 2009. [Google Scholar]
  12. Goh, Y.M.; Love, P.E.D. Methodological application of system dynamics for evaluating traffic safety policy. Saf. Sci. 2012, 50, 1594–1605. [Google Scholar] [CrossRef]
  13. Saprykin, A.; Chokani, N.; Abhari, R.S. GEMSim: A GPU-accelerated multi-modal mobility simulator for large-scale scenarios. Simul. Model. Pract. Theory 2019, 94, 199–214. [Google Scholar] [CrossRef]
  14. Fernandez, R. Modelling public transport stops by microscopic simulation. Transp. Res. Part C Emerg. Technol. 2010, 18, 856–868. [Google Scholar] [CrossRef]
  15. Fernandez, R.; Tyler, N. Effect of passenger-bus-traffic interactions on bus stop operations. Transp. Plan. Technol. 2005, 28, 273–292. [Google Scholar] [CrossRef]
  16. Yatskiv, I.; Pticina, I.; Savrasovs, M. Urban public transport system’s reliability estimation using microscopic simulation. Transp. Telecommun. 2012, 13, 219–228. [Google Scholar] [CrossRef]
  17. Yatskiv (Jackiva), I.; Pticina, I.; Romanovska, K. The Riga Public Transport Service Reliability Investigation Based on Traffic Flow Modelling. In Reliability and Statistics in Transportation and Communication; Springer: Berlin/Heidelberg, Germany, 2018; Volume 36. [Google Scholar] [CrossRef]
  18. Ahmed, B. Exploring new bus priority methods at isolated vehicle actuated junctions. Transp. Res. Procedia 2014, 14, 391–406. [Google Scholar] [CrossRef] [Green Version]
  19. Arasan, V.T.; Vedagiri, P. Micro-simulation study of bus priority on roads carrying highly heterogeneous traffic. In Proceedings of the 22nd European Conference on Modeling and Simulation (ECMS), Nicosia, Cyprus, 3–6 June 2008. [Google Scholar]
  20. Thamizh, A.V.; Vedagiri, P. Microsimulation study of the effect of exclusive bus lanes on heterogeneous traffic flow. J. Urban Plan. Dev. 2010, 136, 50–58. [Google Scholar] [CrossRef]
  21. Chen, X.; Yu, L.; Zhu, L.; Guo, J.; Sun, M. Microscopic traffic simulation approach to the capacity impact analysis of weaving sections for the exclusive bus lanes on an urban expressway. J. Transp. Eng. 2010, 136, 895–902. [Google Scholar] [CrossRef]
  22. Chandrasekar, R.; Cheu, R.; Chin, H. Simulation evaluation of route-based control of bus operations. J. Transp. Eng. 2002, 128, 519–527. [Google Scholar] [CrossRef]
  23. Wang, J.; Chen, S.; He, Y.; Gao, L. Simulation of Transfer Organization of Urban Public Transportation Hubs. J. Transp. Syst. Eng. Inf. Technol. 2006, 6, 96–102. [Google Scholar] [CrossRef]
  24. Zargayouna, M.; Zeddini, B.; Scemama, G.; Othman, A. Agent-Based Simulator for Travelers Multimodal Mobility. In Advanced Methods and Technologies for Agent and Multi-Agent Systems; IOS Press: Amsterdam, The Netherlands, 2013; Volume 252. [Google Scholar] [CrossRef]
  25. Papageorgiou, G.; Damianou, P.; Pitsillides, A.; Aphamis, T.; Charalambous, D.; Ioannou, P. Modelling and Simulation of Transportation Systems: A Scenario Planning Approach. Automatika 2009, 50, 39. [Google Scholar]
  26. Ruiz-Rosero, J.; Ramirez-Gonzalez, G.; Viveros-Delgado, J. Software survey: ScientoPy, a scientometric tool for topics trend analysis in scientific publications. Scientometrics 2019, 121, 1165–1188. [Google Scholar] [CrossRef]
  27. Andrews, J.R.; Morrow, C.; Wood, R. Modeling the Role of Public Transportation in Sustaining Tuberculosis Transmission in South Africa. Am. J. Epidemiol. 2013, 177, 556–561. [Google Scholar] [CrossRef] [Green Version]
  28. Kadiyala, A.; Kumar, A. Multivariate Time Series Models for Prediction of Air Quality Inside a Public Transportation Bus Using Available Software. Environ. Prog. Sustain. Energy 2014, 33, 337–341. [Google Scholar] [CrossRef]
  29. Kadiyala, A.; Kumar, A. Vector time series models for prediction of air quality inside a public transportation bus using available software. Environ. Prog. Sustain. Energy 2014, 33, 1069–1073. [Google Scholar] [CrossRef]
  30. Kadiyala, A.; Kumar, A. Multivariate time series based back propagation neural network modeling of air quality inside a public transportation bus using available software. Environ. Prog. Sustain. Energy 2015, 34, 1259–1266. [Google Scholar] [CrossRef]
  31. Kadiyala, A.; Kumar, A. Univariate Time Series Based Back Propagation Neural Network Modeling of Air Quality Inside a Public Transportation Bus Using Available Software. Environ. Prog. Sustain. Energy 2015, 34, 319–323. [Google Scholar] [CrossRef]
  32. Kadiyala, A.; Kumar, A. Vector-time-series-based back propagation neural network modeling of air quality inside a public transportation bus using available software. Environ. Prog. Sustain. Energy 2016, 35, 7–13. [Google Scholar] [CrossRef]
  33. Kadiyala, A.; Kumar, A. Univariate time series based radial basis function neural network modeling of air quality inside a public transportation bus using available software. Environ. Prog. Sustain. Energy 2016, 35, 320–324. [Google Scholar] [CrossRef]
  34. Jappinen, S.; Toivonen, T.; Salonen, M. Modelling the potential effect of shared bicycles on public transport travel times in Greater Helsinki: An open data approach. Appl. Geogr. 2013, 43, 13–24. [Google Scholar] [CrossRef]
  35. Saghapour, T.; Moridpour, S.; Thompson, R.G. Modeling access to public transport in urban areas. J. Adv. Transp. 2016, 50, 1785–1801. [Google Scholar] [CrossRef] [Green Version]
  36. Nurlaela, S.; Curtis, C. Modeling household residential location choice and travel behavior and its relationship with public transport accessibility. In Proceedings of the 15th Meeting of the Euro-Working-Group-on-Transportation (EWGT), Cite Descartes, Paris, France, 10–13 September 2012; Elsevier Science BV: Amsterdam, The Netherlands, 2012; Volume 54, pp. 56–64. [Google Scholar] [CrossRef] [Green Version]
  37. Fuglsang, M.; Hansen, H.S.; Munier, B. Accessibility Analysis and Modelling in Public Transport Networks—A Raster Based Approach. In Proceedings of the 11th International Conference on Computational Science and Its Applications (ICCSA), Univ Cantabria, Santander, Spain, 20–23 June 2011; Springer: Berlin, Germany, 2011; Volume 6782, pp. 207–224. [Google Scholar]
  38. Schoebel, A. Line planning in public transportation: Models and methods. OR Spectr. 2012, 34, 491–510. [Google Scholar] [CrossRef] [Green Version]
  39. Schmidt, M.; Schoebel, A. The Complexity of Integrating Passenger Routing Decisions in Public Transportation Models. Networks 2015, 65, 228–243. [Google Scholar] [CrossRef]
  40. Schmidt, M.; SchoBel, A. The complexity of integrating routing decisions in public transportation models. In Proceedings of the 10th Workshop on Algorithmic Approaches for Transportation Modelling, Optimization, and Systems, ATMOS 2010, Liverpool, UK, 9–21 September 2010; Volume 14, pp. 156–169. [Google Scholar] [CrossRef]
  41. Abbas-Turki, A.; Grunder, O.; Elmoudni, A. Simulation and optimization of the public transportation connection system. In Proceedings of the 13th European Simulation Symposium, Marseille, France, 18–20 October 2001; pp. 435–439. [Google Scholar]
  42. Cats, O.; Gkioulou, Z. Modeling the impacts of public transport reliability and travel information on passengers’ waiting-time uncertainty. Euro J. Transp. Logist. 2017, 6, 247–270. [Google Scholar] [CrossRef]
  43. Hassannayebi, E.; Zegordi, S.H.; Yaghini, M.; Amin-Naseri, M.R. Timetable optimization models and methods for minimizing passenger waiting time at public transit terminals. Transp. Plan. Technol. 2017, 40, 278–304. [Google Scholar] [CrossRef]
  44. Kieu, L.M.; Cai, C. Stochastic collective model of public transport passenger arrival process. IET Intell. Transp. Syst. 2018, 12, 1027–1035. [Google Scholar] [CrossRef]
  45. Uspalyte-Vitkuniene, R.; Grigonis, V.; Paliulis, G. The Extent Of Influence of O-D Matrix on the Results of Public Transport Modeling. Transport 2012, 27, 165–170. [Google Scholar] [CrossRef]
  46. Kaiyuan, L.; Lifeng, L.; Feigang, T. A scheduling model and its implementation based on intelligent public transportation system. In Proceedings of the 2nd International Conference on Smart City and Systems Engineering (ICSCSE), Changsha, China, 11–12 November 2017; pp. 52–54. [Google Scholar] [CrossRef]
  47. Janoska, Z.; Dvorsky, J. P system based model of passenger flow in public transportation systems: A case study of Prague Metro. In Proceedings of the 13th Annual Workshop on Databases, Texts, Specifications and Objects (DATESO 2013), Pisek, Czech Republic, 17–19 April 2013; Volume 971, pp. 59–69. [Google Scholar]
  48. Yu, H.F.; Qin, Y.; Wang, Z.Y.; Wang, B.; Zhan, M.H. Research on urban mass transit network passenger flow simulation on the basis of multi-agent. In Proceedings of the International Conference on Information Technology and Computer Application Engineering (ITCAE), Hong Kong, China, 27–28 August 2013; CRC Press-Taylor & Francis Group: Boca Raton, FL, USA, 2014; pp. 225–229. [Google Scholar]
  49. Hadas, Y.; Ranjitkar, P. Modeling public-transit connectivity with spatial quality-of-transfer measurements. J. Transp. Geogr. 2012, 22, 137–147. [Google Scholar] [CrossRef]
  50. Ceder, A.; Chowdhury, S.; Taghipouran, N.; Olsen, J. Modelling public-transport users’ behaviour at connection point. Transp. Policy 2013, 27, 112–122. [Google Scholar] [CrossRef]
  51. He, R.; Li, Y.; Zhang, Z. Models and genetic algorithms for the optimal riding routes with transfer times limited in urban public transportation. In Proceedings of the 5th International Symposium on Operations Research and Its Applications, Tibet, China, 8–13 August 2005; Volume 5, pp. 340–348. [Google Scholar]
  52. Debinska, E.; Cichocinski, P. The application of multimodal network for the modeling of movement in public transport. In Proceedings of the 13th International Multidisciplinary Scientific Geoconference, SGEM 2013, Albena, Bulgaria, 16–22 June 2013; pp. 559–563. [Google Scholar]
  53. Rasmusseni, T.K.; Anderson, M.K.; Nielsen, O.A.; Prato, C.G. Timetable-based simulation method for choice set generation in large-scale public transport networks. Eur. J. Transp. Infrastruct. Res. 2016, 16, 467–489. [Google Scholar]
  54. Drabicki, A.; Kucharski, R.; Szarata, A. Modelling the public transport capacity constraints’ impact on passenger path choices in transit assignment models. Arch. Transp. 2017, 43, 7–28. [Google Scholar] [CrossRef] [Green Version]
  55. Fu, Z.; Yu, J.; Sarwat, M. Demonstrating geosparksim: A scalable microscopic road network traffic simulator based on Apache spark. In Proceedings of the 16th International Symposium on Spatial and Temporal Databases, Vienna, Austria, 19–21 August 2019; pp. 186–189. [Google Scholar] [CrossRef]
  56. Vu, V.A.; Tan, G. A Framework for Mesoscopic Traffic Simulation in GPU. IEEE Trans. Parallel Distrib. Syst. 2019, 30, 1691–1703. [Google Scholar] [CrossRef]
  57. Saprykin, A.; Chokani, N.; Abhari, R. Large-scale multi-agent mobility simulations on a GPU: Towards high performance and scalability. Procedia Comput. Sci. 2019, 151, 733–738. [Google Scholar] [CrossRef]
  58. Vu, V.; Tan, G. High-performance mesoscopic traffic simulation with GPU for large scale networks. In Proceedings of the 2017 IEEE/ACM 21st International Symposium on Distributed Simulation and Real Time Applications (DS-RT), Rome, Italy, 18–20 October 2017; Volume 2017, pp. 1–9. [Google Scholar] [CrossRef]
  59. Song, X.; Xie, Z.; Xu, Y.; Tan, G.; Tang, W.; Bi, J.; Li, X. Supporting real-world network-oriented mesoscopic traffic simulation on GPU. Simul. Model. Pract. Theory 2017, 74, 46–63. [Google Scholar] [CrossRef]
  60. Xu, Y.; Tan, G.; Li, X.; Song, X. Mesoscopic Traffic Simulation on CPU/GPU. In Proceedings of the SIGSIM-PADS’14: 2014 Acm Conference on Sigsim Principles of Advanced Discrete Simulation, Denver, CO, USA, 18–21 May 2014; Assoc Computing Machinery: New York, NY, USA, 2014. [Google Scholar]
  61. Xiao, J.; Andelfinger, P.; Eckhoff, D.; Cai, W.; Knoll, A. Exploring Execution Schemes for Agent-Based Traffic Simulation on Heterogeneous Hardware. In Proceedings of the 2018 IEEE/ACM 22nd International Symposium on Distributed Simulation and Real Time Applications (DS-RT), Madrid, Spain, 15–17 October 2018; pp. 243–252. [Google Scholar] [CrossRef]
  62. Janczykowski, M.; Turek, W.; Malawski, M.; Byrski, A. Large-scale urban traffic simulation with Scala and high-performance computing system. J. Comput. Sci. 2019, 35, 91–101. [Google Scholar] [CrossRef]
  63. Turek, W. Erlang-based desynchronized urban traffic simulation for high-performance computing systems. Future Gener. Comput. Syst. 2018, 79, 645–652. [Google Scholar] [CrossRef]
  64. Turek, W.; Siwik, L.; Byrski, A. Leveraging rapid simulation and analysis of large urban road systems on HPC. Transp. Res. Part C: Emerg. Technol. 2018, 87, 46–57. [Google Scholar] [CrossRef]
  65. Fu, Z.; Yu, J.; Sarwat, M. Building a large-scale microscopic road network traffic simulator in apache spark. In Proceedings of the 2019 20th IEEE International Conference on Mobile Data Management (MDM), Hong Kong, China, 10–13 June 2019; Voume 2019, pp. 320–328. [Google Scholar] [CrossRef]
  66. Public-Transport Noun—Definition, Pictures, Pronunciation and Usage Notes: Oxford Advanced Learner’s Dictionary. Available online: OxfordLearnersDictionaries.com (accessed on 1 December 2019).
  67. Desaulniers, G.; Hickman, M.D. Chapter 2 Public Transit. In Transportation. Handbooks in Operations Research and Management Science; Barnhart, C., Laporte, G., Eds.; Elsevier: Amsterdam, The Netherlands, 2007; Volume 14, pp. 69–127. [Google Scholar] [CrossRef]
  68. Barua, B.; Boberg, J.; Hsiao, S.; Zhang, X. Integrating Geographic Information Systems with Transit Survey Methodology. Transp. Res. Rec. 2001, 1753, 29–34. [Google Scholar] [CrossRef]
  69. Kuwahara, M.; Sullivan, E.C. Estimating origin-destination matrices from roadside survey data. Transp. Res. Part B Methodol. 1987, 21, 233–248. [Google Scholar] [CrossRef]
  70. Munizaga, M.A.; Palma, C. Estimation of a disaggregate multimodal public transport Origin–Destination matrix from passive smart card data from Santiago, Chile. Transp. Res. Part C Emerg. Technol. 2012, 24, 9–18. [Google Scholar] [CrossRef]
  71. Farzin, J.M. Constructing an Automated Bus Origin–Destination Matrix Using Farecard and Global Positioning System Data in São Paulo, Brazil. Transp. Res. Rec. 2008, 2072, 30–37. [Google Scholar] [CrossRef]
  72. White, J. Extracting origin destination information from mobile phone data. In Proceedings of the Eleventh International Conference on Road Transport Information and Control, London, UK, 19–21 March 2002; pp. 30–34. [Google Scholar]
  73. Fellendorf, M.; Vortisch, P. Validation of the microscopic traffic flow model VISSIM in different real-world situations. In Proceedings of the Transportation Research Board 80th Annual Meeting, Washington, DC, USA, 7–11 January 2001. [Google Scholar]
  74. Kotusevski, G.; Hawick, K. A Review of Traffic Simulation Software. Res. Lett. Inf. Math. Sci. 2009, 13, 1–19. [Google Scholar]
  75. Burghout, W.; Wahlstedt, J. Hybrid traffic simulation with adaptive signal control. Transp. Res. Rec. J. Transp. Res. Board 2015, 1999, 191–197. [Google Scholar] [CrossRef]
  76. Burghout, W. Mesoscopic Simulation Models For Short-Term Prediction; Royal Institute of Technology: Melbourne, Australia, 2005. [Google Scholar]
  77. Balakrishna, R.; Antoniou, C.; Ben-Akiva, M.; Koutsopoulos, H.; Wen, Y. Calibration of microscopic traffic simulation models: Methods and application. Transp. Res. Rec. J. Transp. Res. Board 2015, 1999, 198–207. [Google Scholar] [CrossRef]
  78. Bu, R. Simulación: Un Enfoque Práctico; Ingenieria Industrial; Publisher Editorial Limusa: Mexico City, Mexico, 1994. [Google Scholar]
  79. Yang, Q.; Koutsopoulos, H.; Ben-Akiva, M. Simulation laboratory for evaluating dynamic traffic management systems. Transp. Res. Rec. J. Transp. Res. Board 2000, 1710, 22–130. [Google Scholar] [CrossRef] [Green Version]
  80. Jayakrishnan, R.; Cortes, C.E.; Lavanya, R.; Pagès, L. Simulation of urban transportation networks with multiple vehicle classes and services: Classifications, functional requirements and general-purpose modeling schemes. In Proceedings of the TRB 2003 Annual Meeting, Washington, DC, USA, 12–16 January 2003. [Google Scholar]
  81. Bazzan, A.L.; Klügl, F. A review on agent-based technology for traffic and transportation. Knowl. Eng. Rev. 2014, 29, 375–403. [Google Scholar] [CrossRef]
  82. Buisson, C.; Lebacque, J.; Lesort, J. STRADA, a discretized macroscopic model of vehicular traffic flow in complex networks based on the Godunov scheme. In Proceedings of the CESA’96 IMACS Multiconference: Computational Engineering in Systems Applications, Lille, France, 9–12 July 1996; pp. 976–981. [Google Scholar]
  83. Haj-Salem, H.; Elloumi, N.; Mammar, S.; Papageorgiou, M.; Chrisoulakis, J.; Middelham, F. Metacor: A macroscopic modelling tool for urban corridor. In Towards An Intelligent Transport System, Proceedings of the First World Congress on Applications of Transport Telematics and Intelligent Vehicle-Highway Systems, Paris, France, 30 November–3 December 1994; TRB: Washington, DC, USA, 1994; Volume 3. [Google Scholar]
  84. PTV. VISUM 11.50 User Manual; PTV: Karlsruhe, Germany, 2011. [Google Scholar]
  85. Inro Software. The World’s Most Trusted Transportation Forecasting Software; Emme: Westmount, QC, Canada, 2015. [Google Scholar]
  86. Behrisch, M.; Bieker, L.; Erdmann, J.; Krajzewicz, D. SUMO–Simulation of Urban MObility. In Proceedings of the The Third International Conference on Advances in System Simulation (SIMUL 2011), Barcelona, Spain, 23–29 October 2011. [Google Scholar]
  87. AG, PTV Planug Trasport Verker. PTV Vissim 6 User Manual; PTV: Karlsruhe, Germany, 2013. [Google Scholar]
  88. Casas, J.; Ferrer, J.L.; Garcia, D.; Perarnau, J.; Torday, A. Traffic simulation with aimsun. In Fundamentals of Traffic Simulation; Springer: Berlin/Heidelberg, Germany, 2010; pp. 173–232. [Google Scholar]
  89. Maerivoet, S. Models in Aid of Traffic Management. In Proceedings of the Seminar slides for ‘Transportmodellen ter ondersteuning van het mobiliteits-en vervoersbeleid, Brussels, Belgium, 3 May 2004. [Google Scholar]
  90. Yang, H.; Cheng, W.; Xiao, H.C.; Pan, Y.W.; Zhang, D.M. Study of Traffic Flow Adjustment Methods to Congestion Area Based on TransModeler. Sci. Technol. Eng. 2011, 8, 022. [Google Scholar]
  91. Suping, L.F.C.X.C. Frequency optimization of bus rapid transit based on cost analysis. J. Southeast Univ. (Natural Sci. Ed.) 2009, 4, 038. [Google Scholar]
  92. Cortés, C.E.; Sáez, D.; Milla, F.; Núñez, A.; Riquelme, M. Hybrid predictive control for real-time optimization of public transport systems’ operations based on evolutionary multi-objective optimization. Transp. Res. Part C Emerg. Technol. 2010, 18, 757–769. [Google Scholar] [CrossRef]
  93. Kwan, R.S.K. Case studies of successful train crew scheduling optimisation. J. Sched. 2011, 14, 423–434. [Google Scholar] [CrossRef]
  94. Michael, R.G.; David, S.J. Computers and Intractability: A Guide to the Theory of NP-Completeness; WH Freeman & Co.: San Francisco, CA, USA, 1979. [Google Scholar]
  95. Lee, D.H.; Chandrasekar, P. A Framework for Parallel Traffic Simulation Using Multiple Instancing of a Simulation Program. J. Intell. Transp. Syst. 2002, 7, 279–294. [Google Scholar] [CrossRef]
  96. Nagel, K.; Rickert, M. Parallel implementation of the TRANSIMS micro-simulation. Parallel Comput. 2001, 27, 1611–1639. [Google Scholar] [CrossRef] [Green Version]
  97. Ruiz-Rosero, J.; Ramirez-Gonzalez, G.; Khanna, R. Field Programmable Gate Array Applications—A Scientometric Review. Computation 2019, 7, 63. [Google Scholar] [CrossRef] [Green Version]
  98. Hansson, A.; Mortveit, H.; Tripp, J.; Gokhale, M. Urban traffic simulation modeling for reconfigurable hardware. In Proceedings of the 3rd Industrial Simulation Conference 2005, Fraunhofer-IPK, Berlin, Germany, 9–11 June 2005; pp. 291–298. [Google Scholar]
  99. Wang, K.; Shen, Z. A GPU based trafficparallel simulation module of artificial transportation systems. In Proceedings of the 2012 IEEE International Conference on Service Operations and Logistics, and Informatics, SOLI 2012, Suzhou, China, 8–10 July 2012. [Google Scholar] [CrossRef]
  100. Potuzak, T. Distributed-Parallel Road Traffic Simulator for Clusters of Multi-core Computers. In Proceedings of the 2012 IEEE/ACM 16th International Symposium on Distributed Simulation and Real Time Applications (DS-RT), Dublin, Ireland, 25–27 October 2012. [Google Scholar] [CrossRef]
  101. Bruegmann, J.; Schreckenberg, M.; Luther, W. Real-time Traffic Information System Using Microscopic Traffic Simulation. In Proceedings of the 2013 8th Eurosim Congress on Modelling and Simulation (EUROSIM), Wales, UK, 10–13 September 2013. [Google Scholar] [CrossRef]
  102. Fernandes, R.; Vieira, F.; Ferreira, M. Parallel Microscopic Simulation of Metropolitan-scale Traffic. In Proceedings of the 46th Annual Simulation Symposium (ANSS 2013)—2013 Spring Simulation Multiconference (Springsim’13), San Diego, CA, USA, 7–10 April 2013; Volume 45. [Google Scholar]
Figure 1. Number of documents related to Public Transport Systems’ (PTS) components simulated or modeled reported by the scientific literature in the WoS and Scopus databases.
Figure 1. Number of documents related to Public Transport Systems’ (PTS) components simulated or modeled reported by the scientific literature in the WoS and Scopus databases.
Electronics 08 01501 g001
Figure 2. Small example of a public transport systems with three stops and two routes.
Figure 2. Small example of a public transport systems with three stops and two routes.
Electronics 08 01501 g002
Figure 3. Masivo main components.
Figure 3. Masivo main components.
Electronics 08 01501 g003
Figure 4. Masivo input parameters.
Figure 4. Masivo input parameters.
Electronics 08 01501 g004
Figure 5. Masivo simulation passenger operations.
Figure 5. Masivo simulation passenger operations.
Electronics 08 01501 g005
Figure 6. Masivo 3D game engine simulation output.
Figure 6. Masivo 3D game engine simulation output.
Electronics 08 01501 g006
Figure 7. 3D visualization for a three stops small public transport system. (a) at 800 s simulation time (b) at 1900 s simulation time (c) at 7200 s end simulation time.
Figure 7. 3D visualization for a three stops small public transport system. (a) at 800 s simulation time (b) at 1900 s simulation time (c) at 7200 s end simulation time.
Electronics 08 01501 g007
Figure 8. Alighted passengers results for a three stop validation system in Pure Python.
Figure 8. Alighted passengers results for a three stop validation system in Pure Python.
Electronics 08 01501 g008
Figure 9. Commute time per stop for a three stop validation system in Pure Python. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Figure 9. Commute time per stop for a three stop validation system in Pure Python. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Electronics 08 01501 g009
Figure 10. Alighted passengers per stop, 30 stops in Scenario 1. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Figure 10. Alighted passengers per stop, 30 stops in Scenario 1. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Electronics 08 01501 g010
Figure 11. Passengers’ commute time per destination stop, 30 stops in Scenario 1. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Figure 11. Passengers’ commute time per destination stop, 30 stops in Scenario 1. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Electronics 08 01501 g011
Figure 12. Alighted passengers per stop, 30 stops in Scenario 2. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Figure 12. Alighted passengers per stop, 30 stops in Scenario 2. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Electronics 08 01501 g012
Figure 13. Passengers’ commute time per destination stop, 30 stops in Scenario 2. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Figure 13. Passengers’ commute time per destination stop, 30 stops in Scenario 2. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Electronics 08 01501 g013
Figure 14. Alighted passengers per stop, 30 stops in Scenario 3. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Figure 14. Alighted passengers per stop, 30 stops in Scenario 3. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Electronics 08 01501 g014
Figure 15. Passengers’ commute time per destination stop, 30 stops in Scenario 3. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Figure 15. Passengers’ commute time per destination stop, 30 stops in Scenario 3. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator. The abbreviation “dest. stop” refers to destination stop, “Pass. direc.” refers to passenger direction, “W-E” refers to West to East direction, and “E-W” refers to East to West direction.
Electronics 08 01501 g015
Figure 16. Alighted passengers per stop, 300 stops in Scenario 4. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Figure 16. Alighted passengers per stop, 300 stops in Scenario 4. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Electronics 08 01501 g016
Figure 17. Passengers’ commute time per destination stop, 300 stops in Scenario 4. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Figure 17. Passengers’ commute time per destination stop, 300 stops in Scenario 4. (a) Results from Masivo PSC. (b) Results from the Pure Python validation simulator.
Electronics 08 01501 g017
Figure 18. Real-time factor vs. simulation time for the Pure Python validation simulator with CPU usage percentage and CPU operation frequency.
Figure 18. Real-time factor vs. simulation time for the Pure Python validation simulator with CPU usage percentage and CPU operation frequency.
Electronics 08 01501 g018
Figure 19. Real-time factor vs. simulation time for Masivo PSC with CPU usage percentage and CPU operation frequency.
Figure 19. Real-time factor vs. simulation time for Masivo PSC with CPU usage percentage and CPU operation frequency.
Electronics 08 01501 g019
Figure 20. Simulation performance indicators vs. number of compute units. (a) Total parallel simulation execution time ( p s t ). (b) Real-time factor ( r t f ). (c) Speed-up factor ( s u f ). (d) Efficiency ( e f ).
Figure 20. Simulation performance indicators vs. number of compute units. (a) Total parallel simulation execution time ( p s t ). (b) Real-time factor ( r t f ). (c) Speed-up factor ( s u f ). (d) Efficiency ( e f ).
Electronics 08 01501 g020
Table 1. System conditions’ definitions and symbols.
Table 1. System conditions’ definitions and symbols.
Variable NameSymbol
Total number of stopsN
Origin-destination matrix OD
OD value for stop i to j D i j
Stops max capacity S C n
Stops X position S P X n
Stops Y position S P Y n
Table 2. Routes variables’ definitions and symbols.
Table 2. Routes variables’ definitions and symbols.
Variable NameSymbol
Total number of routesR
Max buses per routes B R r
Routes frequency f r
Max bus capacity B C
Route stop table array s t o p s _ t a b l e r
Table 3. Simulation output variables’ definitions and symbols.
Table 3. Simulation output variables’ definitions and symbols.
Variable NameSymbol
Departed passengers from stop D P S n
Alighted passengers at stop A P S n
Average passengers commute time A C T
A C T at alight stop n A C T S n
Table 4. Simulation performance variables’ definitions and symbols.
Table 4. Simulation performance variables’ definitions and symbols.
Variable NameSymbol
Total simulation time t s t
Total parallel simulation execution time p s t
Total sequential simulation execution time s s t
Real-time factor r t f
Speed-up factor s u f
Efficiency e f
Number of processing threadsp
Table 5. Origin-Destination Matrix (ODM) CSV example file with 3 stops’ information.
Table 5. Origin-Destination Matrix (ODM) CSV example file with 3 stops’ information.
Stop_NumberStop_Namex_Posy_PosMax_CapacityStop_00Stop_01Stop_02
0Stop_00400100020001020
1Stop_01800100020010010
2Stop_021200100020020100
Table 6. Routes CSV example file with 4 routes’ information. Freq., frequency; Dir., direction.
Table 6. Routes CSV example file with 4 routes’ information. Freq., frequency; Dir., direction.
NumberNameFreq.OffsetBusesDir.NotesStops_Table
0Route_0030010050W-Eall stopsStop_00, Stop_01, Stop_02
1Route_0130010050E-Wall stopsStop_02, Stop_01, Stop_00
2Route_0290010050W-EexpressStop_00, Stop_02
3Route_0390010050E-WexpressStop_02, Stop_00
Table 7. Routes used to validate a small 3 stop public transport system.
Table 7. Routes used to validate a small 3 stop public transport system.
NumberNameFreq.OffsetBusesDir.NotesStops_Table
0Route_0090095050W-Eall stopsStop_00, Stop_01, Stop_02
1Route_0190095050E-Wall stopsStop_02, Stop_01, Stop_00
Table 8. Scenario 1 simulation conditions.
Table 8. Scenario 1 simulation conditions.
ConditionValue
Bus average transit speed (km/h)54
Bus maximum passengers250
Bus stopping time (s)20
End simulation time (s)7200
Passenger total arrival time (s)3600
Total passengers38,721
Total routes2
Total stops30
Table 9. Scenario 2 simulation conditions.
Table 9. Scenario 2 simulation conditions.
ConditionValue
Bus average transit speed (km/h)70
Bus maximum passengers250
Bus stopping time (s)20
End simulation time (s)7200
Passenger total arrival time (s)3600
Total passengers38,721
Total routes2
Total stops30
Table 10. Scenario 3 simulation conditions.
Table 10. Scenario 3 simulation conditions.
ConditionValue
Bus average transit speed (km/h)54
Bus maximum passengers250
Bus stopping time (s)20
End simulation time (s)7200
Passenger total arrival time (s)3600
Total passengers38,721
Total routes4
Total stops30
Table 11. Scenario 1 simulation conditions.
Table 11. Scenario 1 simulation conditions.
ConditionValue
Bus average transit speed (km/h)54
Bus maximum passengers250
Bus stopping time (s)20
End simulation time (s)36,000
Passenger total arrival time (s)3600
Total passengers456,997
Total routes2
Total stops300
Table 12. IONOS dedicated server 4XL specifications.
Table 12. IONOS dedicated server 4XL specifications.
SpecificationValue
TypeDedicated Server 4XL
CPUIntel Xeon Gold 6210U
# of Cores20
# of Threads40
Processor Base Frequency2.50 GHz
Max Turbo Frequency3.90 GHz
Cache27.5 MB
RAM192 GB
HDD2 × 4000 GB Hardware RAID 1
OSUbuntu 16.04
Table 13. Simulation conditions for performance tests, Scenario 4.
Table 13. Simulation conditions for performance tests, Scenario 4.
ConditionValue
Bus average transit speed (km/h)54
Bus maximum passengers250
Bus stopping time (s)20
End simulation time (s)36,000
Passenger total arrival time (s)3600
Total passengers456,997
Total routes2
Total buses2400
Total stops300
Table 14. Pure Python simulator performance outputs for Scenario 4.
Table 14. Pure Python simulator performance outputs for Scenario 4.
Performance IndicatorValue
Total simulation execution time (s)3303.612
Average real-time factor32.76
Average CPU usage (%)2.19
Table 15. Masivo PSC performance outputs for Scenario 4.
Table 15. Masivo PSC performance outputs for Scenario 4.
Performance IndicatorValue
Total simulation execution time (s)11.882
Average real-time factor3050.84
Average CPU usage (%)84.21
Table 16. Documents related to traffic and transit parallel simulation.
Table 16. Documents related to traffic and transit parallel simulation.
Document TitleYearParallel ArchitectureModel TypeSimulation CoreSpeedup FactorReal-Time FactorSimulation ComplexityReference
Urban traffic simulation modeling for reconfigurable hardware2005FPGAMicroscopicRoad traffic4.50Not specified100,000 intersections[98]
A GPU based traffic parallel simulation module of artificial transportation systems2012GPUMicroscopicRoad traffic105.00102.001600 intersections and 5000 vehicles[99]
Mesoscopic traffic simulation on CPU/GPU2014GPUMesoscopicRoad traffic11.202364.0010,201 nodes and 100,000 vehicles[60]
Supporting real-world network oriented mesoscopic traffic simulation on GPU2017GPUMesoscopicRoad traffic2.371897.004106 OD pairs, 100,000 vehicles[59]
GEMSim: A GPU accelerated multi-modal mobility simulator for large scale scenarios2019GPUMesoscopicPublic transit systemNot specified1300.0027,873 stops and 100,000 passengers[13]
A framework for mesoscopic traffic simulation in GPU2019GPUMesoscopicRoad traffic5.00Not specified4103 OD pairs, 300,000 vehicles[56]
Distributed-parallel road traffic simulator for clusters of multi-core computers2012Multi-coreMicroscopicRoad traffic3.32163.001024 Crossroads[100]
Real-time traffic information system using microscopic traffic simulation2013Multi-coreMicroscopicRoad trafficNot specified60.001300 cross-sections and 120,000 vehicles[101]
Parallel microscopic simulation of metropolitan scale traffic2013Multi-coreMicroscopicRoad traffic16.000.86145,665 roads, 4,349,130 vehicles, and 0.1 s step time[102]
Masivo PSC2019Multi-coreMesoscopicPublic transit system10.20/2783000300 stops, 2400 buses, and 456,997 passengers,N/A

Share and Cite

MDPI and ACS Style

Ruiz-Rosero, J.; Ramirez-Gonzalez, G.; Khanna, R. Masivo: Parallel Simulation Model Based on OpenCL for Massive Public Transportation Systems’ Routes. Electronics 2019, 8, 1501. https://doi.org/10.3390/electronics8121501

AMA Style

Ruiz-Rosero J, Ramirez-Gonzalez G, Khanna R. Masivo: Parallel Simulation Model Based on OpenCL for Massive Public Transportation Systems’ Routes. Electronics. 2019; 8(12):1501. https://doi.org/10.3390/electronics8121501

Chicago/Turabian Style

Ruiz-Rosero, Juan, Gustavo Ramirez-Gonzalez, and Rahul Khanna. 2019. "Masivo: Parallel Simulation Model Based on OpenCL for Massive Public Transportation Systems’ Routes" Electronics 8, no. 12: 1501. https://doi.org/10.3390/electronics8121501

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop