# Discrete Event Simulation of Bus Terminals: A Modular Approach with a High Spatial Resolution

Authors: Therese Lindberg; Fredrik Johansson; Anders Peterson; Andreas Tapani
Journal: Journal of Advanced Transportation
 (2021)

---

## Abstract

Interchange stations with their many connecting modes and lines are central for a high-quality public transport system. Bus access at the station needs to operate reliably and efficiently in order to prevent congestion and queues. To this end, a conceptual simulation model for evaluation of bus terminal operations is presented in this paper. It is based on discrete event simulation and able to describe the detailed movements and interactions that occur between vehicles at larger terminals. The model has a modular approach, where common spatial sections at terminals are represented by modules that can be easily combined into many different terminal layouts. An implementation of the model is presented and, as a first sensitivity test, applied in a numerical experiment representing Norrköping interchange station in Sweden. The results indicate that the model can be a useful tool in planning processes.


---

## Body

## 1. Introduction

A high-quality public transport system is becoming increasingly important for cities all over the world hoping to reduce the pollution and congestion caused by car traffic. All parts of such a system need to be well-functioning, and, in particular, its transfer nodes and interchange stations need to have a reliable and efficient operation without introducing unnecessary delays into the system. These nodes and stations have a high impact on the system as a whole since they connect the various lines and modes of the system, facilitate transfers and make it possible to achieve a high degree of connectivity within a city or a region. While this is important, it is also a vulnerability. Delays originating at a station may propagate through the system due to the many intersecting lines, reducing both punctuality and reliability. There is also the fact that while transfers between lines are important to the connectivity and quality of the system, travellers tend to dislike them. It has been shown repeatedly that the time spent in transfer is perceived as significantly less comfortable than in-vehicle time, see [1].An important factor for a reliable and punctual service that facilitates fast transfers is the capacity of the bus terminal, here defined as an area separated from other motorized traffic modes that has two or more bus stops. The capacity is the amount of vehicles that can use the terminal without causing excessive congestion and queues. Too low capacity results in delays and an unreliable service. In practice, terminals are not always planned with sufficient capacity. This is the case in many metropolitan regions, such as the Stockholm region in Sweden [2]. Insufficient capacity can be due to an increase in traffic volumes over time but also a result of the common requirement of compact terminals that do not occupy large areas. Besides the bus terminal, there are typically also train platforms, waiting areas, and commercial facilities competing for the limited space. Compact terminals with short walking distances are also in the interest of the travellers since this reduces the time spent in transfer.In order to evaluate the trade-off between capacity and size and plan for efficient terminals, good evaluation methods are needed. Terminal design guidelines and capacity handbooks, such as the Public Transport Interchange Design Guidelines [3], the Geometric Design Guide for Transit Facilities on Highways and Streets [4], and the Transit Capacity and Quality of Service Manual [5], give analytic capacity formulas for individual bus stops and small stations as well as approximate estimates on the number of stops needed at a terminal. These methods are less suitable for larger terminals with their many interactions between vehicles and between the vehicles and the system. Many of these interactions may also vary from time to time in a way that can be difficult to capture with an analytical model. This argument is also put forward by Al-Mudhaffar et al. [2], who state that deterministic methods can only be used for very simple cases and not for larger bus terminals. In this paper, we propose a discrete event simulation model for terminal capacity analysis. With a simulation approach, various situations can be tested, and the many interactions and statistical variations of the system captured. A bus terminal simulation model can be used to test and compare various solutions in the planning processes. This can be invaluable in projects where there is a big risk of congestion and many factors to consider. In the rebuilding project of Slussen in central Stockholm, for instance, the new bus terminal is only one part of the bigger project with limited space available. The old terminal was congested, and simulation studies are absolutely necessary to ensure the functionality of this new terminal. Simulation studies require large amounts of data, however, a common drawback of such models. For bus terminals, this is less of a problem nowadays due to the increasing use of automatic data gathering technologies within public transport, such as automatic vehicle location, automatic passenger counting, and automated fare collection systems.Discrete event simulation makes use of the fact that a bus terminal can be described based on a set of clearly defined events, for example, driving to a stop and dwelling, together with their interdependencies. In many bus terminals, vehicles can be expected to follow the rules and regulations and have predictable interactions, which makes discrete event simulation a suitable approach. It has previously been tested on a small system consisting of a combined bus and tram stop [6]. Previous terminal simulation studies either use models with an event-based approach or a time-based one, where the time-based models typically use existing traffic simulation software. The traffic simulation programs focus on road traffic and vehicle interactions such as car-following and lane-changing. This focus makes them difficult to use at bus terminals with their specific properties and behaviour, such as scheduling of lines, blocking, and queuing, and interactions between vehicles at the terminal. The limitations have been discussed by Kramer [7] and Askerud and Wall [8]. Previous event-based models, on the other hand, typically model terminals explicitly. To our knowledge, there is no such model that include interactions between vehicles in such a way that queues and congestion can be properly captured, however. These models also tend to be formulated for a specific bus terminal, rather than having a more general approach.In this paper, a conceptual bus terminal simulation model is formulated, implemented in a simulation environment and demonstrated in a real-world example as an initial test of the modelling approach. The objective of the study is to develop a flexible discrete event microsimulation model describing vehicle movements and interactions at bus terminals of various kinds. The model should be able to evaluate a wide range of terminal designs and traffic scenarios by having a modular approach where modules representing spatial parts of a terminal can be combined into various constellations. The focus of the model should be on the vehicles, their movements, and when and where blocking between vehicles takes place. The latter is an important requirement for an accurate representation of congestion since queues may block the access to stops and various sections of the terminal. The contribution of the study is the development and implementation of a bus terminal simulation model meeting these requirements.The rest of this paper is organised as follows. Section2 presents the background and previous work within the field of bus terminal simulation. The conceptual model is presented in detail in Section 3–5 and its implementation in Section 6. It is followed by a presentation of the case study in Section 7 and the results of the case study in Section 8. Conclusions and future work conclude the paper in Section 9.


## 2. Simulation of Bus Terminals

In this section, studies into terminal and stop simulation are presented and key components of the applied models identified. Each of the identified components is then discussed and gaps in the previous models presented.


### 2.1. Simulation Studies of Terminals and Stops

Previously proposed models of bus terminals vary in size and modelling approach. Seriani and Fernández use a time-based approach and existing traffic simulation software both for traffic and pedestrian simulation [9]. The software is used to evaluate pedestrian traffic management measures at a new type of two stop bus rapid transit bus station. Another approach can be found in [10, 11], who both use an event-based stop simulation model, which was first presented in [12]. Fernández et al. integrate the model with an existing, time-based traffic simulation software and apply it to several cases, including a ten-stop interchange station partly integrated with road traffic [10]. A smaller three-stop bus terminal is studied by Adhvaryu, who investigates ways to improve the terminal by comparing three layout alternatives [11]. Liang and Wang develop their own event-based model of a five-stop terminal in order to optimize the bus dispatch scheme [13]. An event-based model is also developed by Figueras Jové and Casanovas-García as they analyse the operations of a system consisting of shuttle buses connecting a cruise terminal to an intermobility centre where passengers transfer to taxis [14]. The results include the number of needed bus stops for the suggested design.Simulation of single bus stops is closely related to terminal simulation. Such stops are generally integrated or in close proximity to the road traffic and lack the interactions associated with having several stops gathered in a terminal. Stop simulation models range from smaller dedicated models to models of larger systems. Some focus on improving stop modelling in a road traffic simulation model [15]; others simulate larger public transport systems [16, 17] or focus on modelling the stop itself [18, 19].A number of components used in terminal simulation can be identified from the presented studies. Both stop and terminal models typically calculate a dwell time based on the number of alighting and boarding passengers and some include simulation of the passengers and the surrounding road traffic. While none of the terminal articles goes into details of the modelling of bus arrivals, this is another component needed for terminal simulation. Interactions between the buses are included to varying degrees, while the routing of vehicles through the terminal is included at some level in all terminal simulation studies.


### 2.2. Terminal Modelling Components

Dwell-time modelling has been an ongoing field of research for decades due to its impact on the average speed of the vehicles and the travel time of the passengers. The dwell time depends on a number of factors, the most important being the number of passengers boarding and alighting. Various functions can be formulated with varying functional forms and number of factors included. Common varieties are linear in form and include the number of boarding and alighting passengers together with constants specifying the number of doors, time per boarding or alighting, and the dead time, which is the time needed for opening and closing of doors and other activities not dependent on the number of passengers [9, 20]. Some studies include more factors or use more complex functional forms [18, 21].Modelling of passengers in terminal and stop simulation can be included with various degree of detail, from pedestrian simulation [9], to versions where passengers are simply represented as numbers that are to board/alight. The latter can be found from probability distributions describing either the number of passengers for each departure or the arrival of passengers [18].Surrounding traffic can also be modelled in various degree of detail, from the detailed descriptions in microscopic traffic simulation software to simple probability distributions at entries and exits.Vehicle arrivals need to be modelled if the simulation is delimited to the terminal itself. This can be included in various ways depending on the system that is to be modelled. For high-frequency bus lines, modelling of arrivals may be based on the headways between arrivals [22], while for lines with lower frequency or irregular headways, a timetable based approach may be more appropriate [23].Vehicle interactions are important to capture since congestion and queues can cause delays. To our understanding, only the stop and terminal simulation studies that use traffic simulation software include driving activities with a sufficient spatial resolution and in that way capture congestion and queueing throughout the systems. The vehicle interactions at a terminal differ from road traffic, however, with other priority rules that need to be properly captured.Routing of vehicles through the system is needed for all models and increases in complexity for larger terminals. This can be challenging when using traffic simulation models since rules and behaviour at the terminal differ from road traffic. Examples from the terminal simulation studies of terminal specific routing include routing vehicles to different stops and selecting between routes depending on whether or not a stop is occupied.


### 2.3. Deficiencies in Previously Proposed Models

As has been presented in this section, many of the components needed for terminal simulation have been studied previously. There is, however, a need to improve the modelling of interactions between vehicles. When generic traffic simulation models have been used in the context of bus terminals, these interactions follow the rules of ordinary road traffic. Terminals are significantly different from road systems, however, with different behaviour and rules related to routing and vehicle priority. Generic traffic simulation models can also be quite complex with functionality and parameters that may not be relevant to terminal simulation. This can make adaptations and analyses of results unnecessarily difficult. A dedicated terminal simulation model can include vehicle interactions, while at the same time reduce the complexity in relation to a traffic simulation model by focusing on the aspects important for terminals. To our knowledge, proper modelling of vehicle interactions and the resulting queues and congestion are not included in any previous dedicated terminal simulation model.Another observation is the fact that dedicated terminal simulation models typically model a specific terminal. This makes it difficult to adapt the models to other terminals. To our knowledge, no previous study incorporates the concept of modules presented in this paper. Having such an approach allows the model to be easily applied to various terminal designs.


## 2.1. Simulation Studies of Terminals and Stops

Previously proposed models of bus terminals vary in size and modelling approach. Seriani and Fernández use a time-based approach and existing traffic simulation software both for traffic and pedestrian simulation [9]. The software is used to evaluate pedestrian traffic management measures at a new type of two stop bus rapid transit bus station. Another approach can be found in [10, 11], who both use an event-based stop simulation model, which was first presented in [12]. Fernández et al. integrate the model with an existing, time-based traffic simulation software and apply it to several cases, including a ten-stop interchange station partly integrated with road traffic [10]. A smaller three-stop bus terminal is studied by Adhvaryu, who investigates ways to improve the terminal by comparing three layout alternatives [11]. Liang and Wang develop their own event-based model of a five-stop terminal in order to optimize the bus dispatch scheme [13]. An event-based model is also developed by Figueras Jové and Casanovas-García as they analyse the operations of a system consisting of shuttle buses connecting a cruise terminal to an intermobility centre where passengers transfer to taxis [14]. The results include the number of needed bus stops for the suggested design.Simulation of single bus stops is closely related to terminal simulation. Such stops are generally integrated or in close proximity to the road traffic and lack the interactions associated with having several stops gathered in a terminal. Stop simulation models range from smaller dedicated models to models of larger systems. Some focus on improving stop modelling in a road traffic simulation model [15]; others simulate larger public transport systems [16, 17] or focus on modelling the stop itself [18, 19].A number of components used in terminal simulation can be identified from the presented studies. Both stop and terminal models typically calculate a dwell time based on the number of alighting and boarding passengers and some include simulation of the passengers and the surrounding road traffic. While none of the terminal articles goes into details of the modelling of bus arrivals, this is another component needed for terminal simulation. Interactions between the buses are included to varying degrees, while the routing of vehicles through the terminal is included at some level in all terminal simulation studies.


## 2.2. Terminal Modelling Components

Dwell-time modelling has been an ongoing field of research for decades due to its impact on the average speed of the vehicles and the travel time of the passengers. The dwell time depends on a number of factors, the most important being the number of passengers boarding and alighting. Various functions can be formulated with varying functional forms and number of factors included. Common varieties are linear in form and include the number of boarding and alighting passengers together with constants specifying the number of doors, time per boarding or alighting, and the dead time, which is the time needed for opening and closing of doors and other activities not dependent on the number of passengers [9, 20]. Some studies include more factors or use more complex functional forms [18, 21].Modelling of passengers in terminal and stop simulation can be included with various degree of detail, from pedestrian simulation [9], to versions where passengers are simply represented as numbers that are to board/alight. The latter can be found from probability distributions describing either the number of passengers for each departure or the arrival of passengers [18].Surrounding traffic can also be modelled in various degree of detail, from the detailed descriptions in microscopic traffic simulation software to simple probability distributions at entries and exits.Vehicle arrivals need to be modelled if the simulation is delimited to the terminal itself. This can be included in various ways depending on the system that is to be modelled. For high-frequency bus lines, modelling of arrivals may be based on the headways between arrivals [22], while for lines with lower frequency or irregular headways, a timetable based approach may be more appropriate [23].Vehicle interactions are important to capture since congestion and queues can cause delays. To our understanding, only the stop and terminal simulation studies that use traffic simulation software include driving activities with a sufficient spatial resolution and in that way capture congestion and queueing throughout the systems. The vehicle interactions at a terminal differ from road traffic, however, with other priority rules that need to be properly captured.Routing of vehicles through the system is needed for all models and increases in complexity for larger terminals. This can be challenging when using traffic simulation models since rules and behaviour at the terminal differ from road traffic. Examples from the terminal simulation studies of terminal specific routing include routing vehicles to different stops and selecting between routes depending on whether or not a stop is occupied.


## 2.3. Deficiencies in Previously Proposed Models

As has been presented in this section, many of the components needed for terminal simulation have been studied previously. There is, however, a need to improve the modelling of interactions between vehicles. When generic traffic simulation models have been used in the context of bus terminals, these interactions follow the rules of ordinary road traffic. Terminals are significantly different from road systems, however, with different behaviour and rules related to routing and vehicle priority. Generic traffic simulation models can also be quite complex with functionality and parameters that may not be relevant to terminal simulation. This can make adaptations and analyses of results unnecessarily difficult. A dedicated terminal simulation model can include vehicle interactions, while at the same time reduce the complexity in relation to a traffic simulation model by focusing on the aspects important for terminals. To our knowledge, proper modelling of vehicle interactions and the resulting queues and congestion are not included in any previous dedicated terminal simulation model.Another observation is the fact that dedicated terminal simulation models typically model a specific terminal. This makes it difficult to adapt the models to other terminals. To our knowledge, no previous study incorporates the concept of modules presented in this paper. Having such an approach allows the model to be easily applied to various terminal designs.


## 3. Conceptual Model

In this section, a conceptual model for generic bus terminals is presented. The basic structure of the model consists of a set of modules, where each module represents a physical section of a bus terminal, and a set of functions used to calculate the time a vehicle spends in various parts of a terminal. The modular structure makes it possible to adapt the model to various bus terminals and layouts. Figure1 shows the path of one vehicle through the modules of the model. The various parts of the figure will be explained in the coming sections, after giving a more overview description within this section. This includes presentations of the modelling approach, the events, and network description that form the basis of the modules, the modular approach itself, and some details of the modelling of the driving and vehicle interactions.Figure 1
The path of one vehicle through the modules of the model. The vehicle is generated in one of the entry modules, pass through a series of driving and stop modules (this may include path choices where there are branching present) and leave the simulation at one of the exit modules. Each module uses a set of functions to determine the duration of activities. These functions include interactions with other vehicles and the environment.


### 3.1. Modelling Approach and Delimitations

The simulation model presented in this paper is based on discrete event simulation. In this approach, the state of a system is updated at discrete points in time as anevent occurs (see [24] for an introduction to discrete event simulation). This can be contrasted to the time-based approach common in road traffic simulation where the system is updated with fixed time intervals (see [25] for a presentation of this simulation approach). The model is discrete not only in time but also in space and divides a terminal into cells. These are small enough for a vehicle to occupy several cells simultaneously. By keeping track of the occupation of the cells, interactions in the form of vehicles blocking each other can be modelled and included. This makes it possible to get a sufficient spatial resolution to capture congestion. The modelled system is delimited to the terminal itself and the vehicles at the terminal. While outside road traffic at entrances and exits is not included, passengers are included indirectly by affecting dwell times as well as waiting times at pedestrian crossings. With the focus of the model being on queues and blockages between vehicles, several simplifications are made in respect to acceleration behaviour and differences between vehicles. All vehicles are assumed to be driving at the same constant speed and having the same minimum time distance to any vehicle driving in front. The cell length puts restraints on all lengths of a terminal, as well as the length of vehicles, which all need to be an integer number of cells.In the following subsections, a network description of a terminal will first be presented together with the events associated with a terminal. This is followed by a presentation of the modular approach of the model.


### 3.2. Events and Network Representation

A bus passing through a terminal will experience a number of events and activities. First, there is the event of arriving at the terminal, then the one of starting to drive to some new position, followed by the arrival to this position. Each of these is instant event that change the state of the system. In between events, there may be activities associated with a time duration, such as driving to the new position in the previous example. In an event-based description, these activities do not change the state of the system. Using this description of events and activities, a terminal can be represented by a network where the nodes are associated with events changing the state of the system, while the arcs represent the activities and thus have a time duration. A small example network is given in Figure2. One node may be associated with several events, and all events are related to a particular position at the terminal (e.g., where a vehicle starts to drive into a stop).Figure 2
An example network representing part of a terminal. The arcs represent activities and the nodes events. The time of a process is denotedT, with the type of activity and the start and end node in superscript and subscript, respectively.In order to formulate a terminal model using the presented network description, the various events and activities of a terminal need to be defined. The activities of the model are driving through the cells of the terminal, dwelling at a stop, waiting at a pedestrian crossing, and waiting at an exit. Added to the listed activities is the event of a vehicle arriving at the terminal. For each of these, a function can be formulated that can calculate the time duration of each process, and in the case of arrivals, the time between vehicle arrival events. These calculations can vary from simple probability distributions to more complex calculations that take many factors into regard. All functions proposed in this study will be discussed in more detail inSection 4.


### 3.3. Modular Approach

As described in the previous section, a terminal simulation model can be described by a set of events. In this subsection, the organization of events into modules is presented. By formulating a set of modules that can be combined in numerous ways, diverse terminals can be modelled and simulated. This idea is based on the terminal property of repeating sections. In general, a terminal will consist of a limited number of sections repeated throughout the terminal, such as a particular type of stop or a driving section. This property can be incorporated by constructing modules based on common sections that may be present at terminals.Here, four types of modules have been identified; entry, exit, driving section, and stop, where each type of stop needs a separate module. Each module is associated with a set of events and activities. A terminal entry, for example, has a set of vehicle generation related events and is considered a single point where the vehicles arrive at the terminal. A stop, on the other hand, will have an extension in space and events related to dwell time and entering and leaving the stop. Figure3 shows how one module, in this case a simplified driving module, relates to the cells of a terminal and to the network description (the full driving module is presented in Section 5.3). The modules can be combined in various ways in order to simulate a range of layouts and terminals. An example flow chart of a terminal with four stops constructed from these modules can be seen in Figure 4, and the general path of one vehicle through the modules of a terminal could be seen in Figure 1. The four types of modules and the main events and activities associated with them are shown in Figure 5. Each module will be presented in more detail in Section 5.Figure 3
One module representing a simplified driving section with five cells. At arrival to the module at node (i), the activity of driving is initiated.Figure 4
(a) An example terminal with four stops. (b) Flowchart of this terminal constructed from the entry, exit, driving section, and stop modules.
(a)(b)Figure 5
The four types of modules and their main events and activities.When a module initializes an event, the time of the event or the duration of the associated activity is needed. These can be found from the functions presented inSection 3.2. The connections between the various modules and the functions can be seen in Figure 1.


### 3.4. Driving and Vehicle Interactions

As presented previously, a terminal can be constructed from the proposed modules. Vehicles are routed from event to event through the networks of the modules as point particles. Interactions between vehicles can only occur when a vehicle is driving (or trying to, but blocked) and thus only during the driving activity. For this reason, all vehicle interactions can be modelled in the driving-time function and included by affecting the driving times of the vehicles. The modelling is based on the idea that interactions can be included by storing cell occupation time windows. Each cell in a driving section can either be occupied by a vehicle or free at any point in time. Various vehicle interactions can be modelled by checking which cells are occupied by other vehicles. When a vehicle is to drive through a specific cell, its occupation time interval is stored, so that other vehicles can react to it at a later stage. This is presented in more detail inSection 4.2.In the cell-based modelling approach presented, one driving activity would in general correspond to driving through one cell. In order to have generalizable modules where the length of driving sections can vary, this is simplified so that the cells of a driving section without any branching are combined into one driving activity. To get the driving time, the current state of each cell of the section is checked and the time needed to wait on blocking vehicles and drive through the cells is calculated. Only the state of the first cell can be known to stay fixed during the combined activity, however, since all information needed to calculate the driving times through later cells are not yet known. When reaching cells further ahead, the situation may have changed (e.g., a vehicle in front may have stopped). If the initially calculated time of the activity is incorrect, this is updated and adjusted after the activity has finished. Figure6 shows a network description of the two activities representing driving through a section. First, a nominal driving activity is initiated based on the initial state. This is followed by an additional driving activity which is iterated until there is no need for further adjustments. The additional activity is made possible by continuously keeping track of any vehicle’s effect on neighbouring vehicles and the associated extra waiting times of these. The additional driving-time activity is iterated until there is no stored extra waiting time.Figure 6
Network representations of the two activities representing driving through a section. At nodei, a nominal driving activity is initiated. At j, an additional (iterative) driving activity is initiated to account for any adjustment of the initial calculation.


## 3.1. Modelling Approach and Delimitations

The simulation model presented in this paper is based on discrete event simulation. In this approach, the state of a system is updated at discrete points in time as anevent occurs (see [24] for an introduction to discrete event simulation). This can be contrasted to the time-based approach common in road traffic simulation where the system is updated with fixed time intervals (see [25] for a presentation of this simulation approach). The model is discrete not only in time but also in space and divides a terminal into cells. These are small enough for a vehicle to occupy several cells simultaneously. By keeping track of the occupation of the cells, interactions in the form of vehicles blocking each other can be modelled and included. This makes it possible to get a sufficient spatial resolution to capture congestion. The modelled system is delimited to the terminal itself and the vehicles at the terminal. While outside road traffic at entrances and exits is not included, passengers are included indirectly by affecting dwell times as well as waiting times at pedestrian crossings. With the focus of the model being on queues and blockages between vehicles, several simplifications are made in respect to acceleration behaviour and differences between vehicles. All vehicles are assumed to be driving at the same constant speed and having the same minimum time distance to any vehicle driving in front. The cell length puts restraints on all lengths of a terminal, as well as the length of vehicles, which all need to be an integer number of cells.In the following subsections, a network description of a terminal will first be presented together with the events associated with a terminal. This is followed by a presentation of the modular approach of the model.


## 3.2. Events and Network Representation

A bus passing through a terminal will experience a number of events and activities. First, there is the event of arriving at the terminal, then the one of starting to drive to some new position, followed by the arrival to this position. Each of these is instant event that change the state of the system. In between events, there may be activities associated with a time duration, such as driving to the new position in the previous example. In an event-based description, these activities do not change the state of the system. Using this description of events and activities, a terminal can be represented by a network where the nodes are associated with events changing the state of the system, while the arcs represent the activities and thus have a time duration. A small example network is given in Figure2. One node may be associated with several events, and all events are related to a particular position at the terminal (e.g., where a vehicle starts to drive into a stop).Figure 2
An example network representing part of a terminal. The arcs represent activities and the nodes events. The time of a process is denotedT, with the type of activity and the start and end node in superscript and subscript, respectively.In order to formulate a terminal model using the presented network description, the various events and activities of a terminal need to be defined. The activities of the model are driving through the cells of the terminal, dwelling at a stop, waiting at a pedestrian crossing, and waiting at an exit. Added to the listed activities is the event of a vehicle arriving at the terminal. For each of these, a function can be formulated that can calculate the time duration of each process, and in the case of arrivals, the time between vehicle arrival events. These calculations can vary from simple probability distributions to more complex calculations that take many factors into regard. All functions proposed in this study will be discussed in more detail inSection 4.


## 3.3. Modular Approach

As described in the previous section, a terminal simulation model can be described by a set of events. In this subsection, the organization of events into modules is presented. By formulating a set of modules that can be combined in numerous ways, diverse terminals can be modelled and simulated. This idea is based on the terminal property of repeating sections. In general, a terminal will consist of a limited number of sections repeated throughout the terminal, such as a particular type of stop or a driving section. This property can be incorporated by constructing modules based on common sections that may be present at terminals.Here, four types of modules have been identified; entry, exit, driving section, and stop, where each type of stop needs a separate module. Each module is associated with a set of events and activities. A terminal entry, for example, has a set of vehicle generation related events and is considered a single point where the vehicles arrive at the terminal. A stop, on the other hand, will have an extension in space and events related to dwell time and entering and leaving the stop. Figure3 shows how one module, in this case a simplified driving module, relates to the cells of a terminal and to the network description (the full driving module is presented in Section 5.3). The modules can be combined in various ways in order to simulate a range of layouts and terminals. An example flow chart of a terminal with four stops constructed from these modules can be seen in Figure 4, and the general path of one vehicle through the modules of a terminal could be seen in Figure 1. The four types of modules and the main events and activities associated with them are shown in Figure 5. Each module will be presented in more detail in Section 5.Figure 3
One module representing a simplified driving section with five cells. At arrival to the module at node (i), the activity of driving is initiated.Figure 4
(a) An example terminal with four stops. (b) Flowchart of this terminal constructed from the entry, exit, driving section, and stop modules.
(a)(b)Figure 5
The four types of modules and their main events and activities.When a module initializes an event, the time of the event or the duration of the associated activity is needed. These can be found from the functions presented inSection 3.2. The connections between the various modules and the functions can be seen in Figure 1.


## 3.4. Driving and Vehicle Interactions

As presented previously, a terminal can be constructed from the proposed modules. Vehicles are routed from event to event through the networks of the modules as point particles. Interactions between vehicles can only occur when a vehicle is driving (or trying to, but blocked) and thus only during the driving activity. For this reason, all vehicle interactions can be modelled in the driving-time function and included by affecting the driving times of the vehicles. The modelling is based on the idea that interactions can be included by storing cell occupation time windows. Each cell in a driving section can either be occupied by a vehicle or free at any point in time. Various vehicle interactions can be modelled by checking which cells are occupied by other vehicles. When a vehicle is to drive through a specific cell, its occupation time interval is stored, so that other vehicles can react to it at a later stage. This is presented in more detail inSection 4.2.In the cell-based modelling approach presented, one driving activity would in general correspond to driving through one cell. In order to have generalizable modules where the length of driving sections can vary, this is simplified so that the cells of a driving section without any branching are combined into one driving activity. To get the driving time, the current state of each cell of the section is checked and the time needed to wait on blocking vehicles and drive through the cells is calculated. Only the state of the first cell can be known to stay fixed during the combined activity, however, since all information needed to calculate the driving times through later cells are not yet known. When reaching cells further ahead, the situation may have changed (e.g., a vehicle in front may have stopped). If the initially calculated time of the activity is incorrect, this is updated and adjusted after the activity has finished. Figure6 shows a network description of the two activities representing driving through a section. First, a nominal driving activity is initiated based on the initial state. This is followed by an additional driving activity which is iterated until there is no need for further adjustments. The additional activity is made possible by continuously keeping track of any vehicle’s effect on neighbouring vehicles and the associated extra waiting times of these. The additional driving-time activity is iterated until there is no stored extra waiting time.Figure 6
Network representations of the two activities representing driving through a section. At nodei, a nominal driving activity is initiated. At j, an additional (iterative) driving activity is initiated to account for any adjustment of the initial calculation.


## 4. Time of Events and Activity Duration Functions

In this section, the functions of the conceptual model calculating time duration of activities and time between events are presented.


### 4.1. Vehicle Generation Function

The vehicle generation function calculates the intergeneration time between vehicle arrivals. This can be done in various ways depending on the system that is to be modelled. For high-frequency bus lines, a headway probability distribution might be appropriate, for example, the Poisson distribution. For lines with lower frequencies, the arrival time is instead related to the timetable. To include the variability inherent to the process, a probability distribution can be added. The intergeneration time between vehiclek−1 and k then becomes(1)Tkgen=tktimetable_arr−tk−1actual_arr+Xgen−a,where tktimetable_arr is the planned arrival time for vehicle k, tk−1actual_arr is the simulated arrival time of the previous vehicle, and a is a parameter used to allow for negative adjustment of the departure time if the distribution does not allow for negative values (e.g., the lognormal and gamma distributions). Xgen is a random variable with, for instance, a lognormal, gamma, or normal distribution.


### 4.2. Driving-Time Function

The driving-time function calculates the driving time through (parts of) a module. The interactions and time calculations differ for different types of driving activities. These activities are driving through the section (drive through each cell of the module when they are unoccupied), driving into a stop (drive to the stop and enter when it is free), dwelling at a stop, driving out from a stop (drive through the cells adjacent to the stop with any need to wait on passing vehicles taken into account), and driving through a junction (drive through when the junction and the road on the other side are unoccupied).The two main tasks of the driving-time function are to calculate the driving time and to keep track of the occupation of cells. By storing occupation time windows for both cells and stops together with vehicle ID and length and using this to check which ones are occupied by other vehicles, various vehicle interactions can be modelled. As a vehicle is to drive through a section, the state of each cell is checked, any need to wait is determined, and occupation time windows is calculated. This may include checking more cells than the one the vehicle is about to enter in order to determine priority between vehicles. The occupation time window of a cell corresponds to the time from the arrival of the front of a vehicle to the departure of its rear end.When calculating the arrival and departure times from a cell, two assumptions are made. First, any need to wait in cells further ahead is not included. This means that if the vehicle does need to wait further ahead, the departure time of all cells it presently occupies needs to be updated. Second, since the driving times through all cells of the section are calculated at once, the future state of all cells is assumed to be known when arriving at the first one (this was previously discussed inSection 3.4). When a vehicle stops, any following vehicles may be affected and need to stop too. When this happens, their departure times and arrival times to cells they have not yet arrived at are updated. This extra waiting time is also stored so that it can be retrieved by the followers after they have finished their current activity. The presented methodology for calculating the driving time through the cells of a section is summarized in Algorithm 1.Algorithm 1.Driving through the cells of a section.
for Each cell in section doif Cell is free thenCalculate departure timeelseCalculate new arrival timeCalculate departure timefor Each previous cell occupied by vehicle doDelay departure timeend forfor Each following vehicle that will be delayed dofor Each cell follower occupies or have future arrival time to doif Follower not already in cell thenDelay arrival time of followerend ifDelay departure time of followerend forStore the delay of followerend forend ifStore arrival and departure times calculate preliminary arrival time to next cellend forAfter having determined the arrival and departure times from all cells, the total driving time through the section can be calculated.


### 4.3. Dwell-Time Function

The dwell-time function calculates the time needed for boarding and alighting processes. As previously discussed inSection 2, dwell time can be modelled in various ways with increasing complexity. Here, a version with a set of simple linear functions is presented. This is similar to other linear models, such as in [9], the difference being how the doors of the vehicle are used. There are three variants of the dwell-time function depending on whether the bus is to let passengers alight, board, or both. Boarding passengers are assumed to only use the door in the front, while alighting passengers are assumed to spread evenly over the rest (a minimum of two doors are required). If the bus is only letting passengers alight, the dwell time between node i and j can be calculated from(2)TijDT,alight=t0+talightnalightndoors−1,where t0 is the dead time, a constant that captures the time a vehicle is dwelling at a stop without letting passengers board or alight (including opening and closing of the doors), talight is the time per alighting passenger, nalight is the number of alighting passengers, and ndoors is the number of doors. The dwell time for a bus only letting passengers board is(3)TijDT,board=maxtto_dep,t0+tboardnboard,where tto_dep is the time until the planned departure time, tboard is the time per boarding passenger, and nboard is the number of boarding passengers. If both boarding and alighting are to take place, the dwell time is(4)TijDT,both=maxtto_dep,t0+maxtboardnboard,nalightndoors−1.Needed for the dwell-time calculations are the number of boarding or alighting passengers,nboard/alight. This can be found from an appropriate probability distribution.An alternative to calculating the dwell time from functions such as the ones presented is to use a probability distribution. This can be appropriate in cases when the data required for dwell-time functions is lacking but data for distribution parameter estimation are available.


### 4.4. Waiting Time Functions

There are two waiting time functions, delay at an exit and at a pedestrian crossing. These can be modelled in various ways depending on the system, for instance, whether there is a traffic signal or not. Here, modelling of one version of a pedestrian crossing and two versions of exits will be presented.For an unsignalized pedestrian crossing or exit, the need to wait first needs to be determined. One way is to simply assign a probabilityp for needing to wait. If it is needed, this is followed by a calculation of the waiting time, which can be modelled with a probability distribution. The waiting time then becomes(5)Tijd=0,with probability1−pXdwith probabilityp,where Tijd is the waiting time, either at a pedestrian crossing, d=wait_ped, or at an unsignalized exit, d=wait_unsign_exit, and Xd is a random variable with, for instance, a normal, lognormal, or gamma distribution.Another alternative exit is one controlled by a vehicle actuated traffic signal, where the signal is red until a vehicle is detected. There will always be a waiting time at such traffic signals, unless a vehicle arrives when it has just been activated by another vehicle. This waiting time can also be modelled with a probability distribution.


## 4.1. Vehicle Generation Function

The vehicle generation function calculates the intergeneration time between vehicle arrivals. This can be done in various ways depending on the system that is to be modelled. For high-frequency bus lines, a headway probability distribution might be appropriate, for example, the Poisson distribution. For lines with lower frequencies, the arrival time is instead related to the timetable. To include the variability inherent to the process, a probability distribution can be added. The intergeneration time between vehiclek−1 and k then becomes(1)Tkgen=tktimetable_arr−tk−1actual_arr+Xgen−a,where tktimetable_arr is the planned arrival time for vehicle k, tk−1actual_arr is the simulated arrival time of the previous vehicle, and a is a parameter used to allow for negative adjustment of the departure time if the distribution does not allow for negative values (e.g., the lognormal and gamma distributions). Xgen is a random variable with, for instance, a lognormal, gamma, or normal distribution.


## 4.2. Driving-Time Function

The driving-time function calculates the driving time through (parts of) a module. The interactions and time calculations differ for different types of driving activities. These activities are driving through the section (drive through each cell of the module when they are unoccupied), driving into a stop (drive to the stop and enter when it is free), dwelling at a stop, driving out from a stop (drive through the cells adjacent to the stop with any need to wait on passing vehicles taken into account), and driving through a junction (drive through when the junction and the road on the other side are unoccupied).The two main tasks of the driving-time function are to calculate the driving time and to keep track of the occupation of cells. By storing occupation time windows for both cells and stops together with vehicle ID and length and using this to check which ones are occupied by other vehicles, various vehicle interactions can be modelled. As a vehicle is to drive through a section, the state of each cell is checked, any need to wait is determined, and occupation time windows is calculated. This may include checking more cells than the one the vehicle is about to enter in order to determine priority between vehicles. The occupation time window of a cell corresponds to the time from the arrival of the front of a vehicle to the departure of its rear end.When calculating the arrival and departure times from a cell, two assumptions are made. First, any need to wait in cells further ahead is not included. This means that if the vehicle does need to wait further ahead, the departure time of all cells it presently occupies needs to be updated. Second, since the driving times through all cells of the section are calculated at once, the future state of all cells is assumed to be known when arriving at the first one (this was previously discussed inSection 3.4). When a vehicle stops, any following vehicles may be affected and need to stop too. When this happens, their departure times and arrival times to cells they have not yet arrived at are updated. This extra waiting time is also stored so that it can be retrieved by the followers after they have finished their current activity. The presented methodology for calculating the driving time through the cells of a section is summarized in Algorithm 1.Algorithm 1.Driving through the cells of a section.
for Each cell in section doif Cell is free thenCalculate departure timeelseCalculate new arrival timeCalculate departure timefor Each previous cell occupied by vehicle doDelay departure timeend forfor Each following vehicle that will be delayed dofor Each cell follower occupies or have future arrival time to doif Follower not already in cell thenDelay arrival time of followerend ifDelay departure time of followerend forStore the delay of followerend forend ifStore arrival and departure times calculate preliminary arrival time to next cellend forAfter having determined the arrival and departure times from all cells, the total driving time through the section can be calculated.


## 4.3. Dwell-Time Function

The dwell-time function calculates the time needed for boarding and alighting processes. As previously discussed inSection 2, dwell time can be modelled in various ways with increasing complexity. Here, a version with a set of simple linear functions is presented. This is similar to other linear models, such as in [9], the difference being how the doors of the vehicle are used. There are three variants of the dwell-time function depending on whether the bus is to let passengers alight, board, or both. Boarding passengers are assumed to only use the door in the front, while alighting passengers are assumed to spread evenly over the rest (a minimum of two doors are required). If the bus is only letting passengers alight, the dwell time between node i and j can be calculated from(2)TijDT,alight=t0+talightnalightndoors−1,where t0 is the dead time, a constant that captures the time a vehicle is dwelling at a stop without letting passengers board or alight (including opening and closing of the doors), talight is the time per alighting passenger, nalight is the number of alighting passengers, and ndoors is the number of doors. The dwell time for a bus only letting passengers board is(3)TijDT,board=maxtto_dep,t0+tboardnboard,where tto_dep is the time until the planned departure time, tboard is the time per boarding passenger, and nboard is the number of boarding passengers. If both boarding and alighting are to take place, the dwell time is(4)TijDT,both=maxtto_dep,t0+maxtboardnboard,nalightndoors−1.Needed for the dwell-time calculations are the number of boarding or alighting passengers,nboard/alight. This can be found from an appropriate probability distribution.An alternative to calculating the dwell time from functions such as the ones presented is to use a probability distribution. This can be appropriate in cases when the data required for dwell-time functions is lacking but data for distribution parameter estimation are available.


## 4.4. Waiting Time Functions

There are two waiting time functions, delay at an exit and at a pedestrian crossing. These can be modelled in various ways depending on the system, for instance, whether there is a traffic signal or not. Here, modelling of one version of a pedestrian crossing and two versions of exits will be presented.For an unsignalized pedestrian crossing or exit, the need to wait first needs to be determined. One way is to simply assign a probabilityp for needing to wait. If it is needed, this is followed by a calculation of the waiting time, which can be modelled with a probability distribution. The waiting time then becomes(5)Tijd=0,with probability1−pXdwith probabilityp,where Tijd is the waiting time, either at a pedestrian crossing, d=wait_ped, or at an unsignalized exit, d=wait_unsign_exit, and Xd is a random variable with, for instance, a normal, lognormal, or gamma distribution.Another alternative exit is one controlled by a vehicle actuated traffic signal, where the signal is red until a vehicle is detected. There will always be a waiting time at such traffic signals, unless a vehicle arrives when it has just been activated by another vehicle. This waiting time can also be modelled with a probability distribution.


## 5. Modules of the Model

In this section, the four modules of the conceptual model are presented. A wide range of designs can conveniently be constructed by arranging and connecting these modules. The modules and their network description are, to a degree, straightforward to implement in a discrete event simulation software.


### 5.1. Entry Module

The entry module handles arrivals of vehicles to the terminal. Here, buses can be generated iteratively with intergeneration times found from the vehicle generation function (Section 4.1). A network representation of the entry module can be seen in the left part of Figure 7. It has one single node where vehicles are generated before being forwarded to the next module.Figure 7
Network representations of the entry module (a) and the exit module (b). At nodei in the entry module, vehicles are generated. At node j in the exit module, a vehicle will initiate a combined waiting and driving activity. The waiting time is denoted Wjkexit.


### 5.2. Exit Module

The exit module handles departures of vehicles from the terminal. The module includes a short stretch of driving and a vehicle may need to wait on a traffic light or outside traffic. The driving time can be retrieved from the driving-time function (Section 4.2) and the waiting time from the waiting time at exit function (Section 4.4). The right part of Figure 7 shows a network representation of the exit module. There are two nodes, one that initiates the combined activity of waiting at the exit and driving, and one that removes the vehicle.


### 5.3. Driving Section Module

A driving section module represents a stretch of the terminal roadway without any branching and merging within the section (this is instead modelled by combining driving sections). There are three versions of this module for slightly varying situations; a general driving module, the first driving section module after vehicle generation, and a junction module. The general module allows for a pedestrian crossing in the beginning of the road stretch. The first driving section module needs to be able to handle vehicles arriving from generation when the road ahead is blocked. A junction can be used whenever driving paths cross each other. This is modelled with one module for each combination of origin and destination in the junction.Figure8 shows network representations of the three versions of the driving section module. In the general module, vehicles may need to wait on pedestrians before driving through the section. These two activities are merged into one activity (possible since there is no decision point in between). The time of the activities are given by the driving time and the waiting time at pedestrian crossing functions (Sections 4.2 and 4.4). At the end of the activity, at node j, there may be a need to adjust the initially calculated nominal driving time, as discussed previously in Section 3.4. The other two driving section modules are similar to the general module. They do not allow for pedestrian crossings, but both can have other waiting times. The first driving section module after generation starts with a queue where vehicles waits if the road into the terminal is not clear. The junction module starts with an iterative waiting activity until the junction is free. Vehicles are assumed not to enter the junction if another vehicle is already driving through it or if the vehicle will need to stop in the middle of the crossing due to a vehicle standing still on the other side. Since the waiting time depends on the state of cells, this is calculated in the driving-time function. Another important behavioural aspect for driving sections, both for junctions and for merging of two driving section modules, is the question of priority. For simplicity, vehicles are here assumed to follow a first arrival drive first principle.Figure 8
Network representations of the three versions of the driving module: (a) a general driving section, (b) the first driving section after generation, and (c) a junction. All start with waiting time, then a nominal driving time (for a general driving section, these are combined into one activity). The last activity is an additional (iterative) driving activity that accounts for any adjustment needed of the initial driving time calculation.
(a)(b)(c)


### 5.4. Stop Module for Independent Linear Bus Stop with Adjacent Driving Lane

A stop module represents one stop at the terminal together with adjacent roadways. Different stop layouts need to be modelled differently, and the presented module represents two very similar types of stops. These have either a linear or a sawtooth design and consist of one berth with an adjacent driving lane, possibly with a pedestrian crossing before the stop, see Figure9 for the linear type. The stop operates independently, meaning that a vehicle wanting to enter or leave the stop can do so even if there is an occupied stop in the front or in the back. The module includes the stop itself, the adjacent driving lane, and the driving section before the stop (for a row of stops this will be the driving section between stops).Figure 9
An independent linear bus stop with an adjacent driving lane and a pedestrian crossing. The dashed rectangle marks the part included in one module.A network representation of the stop module can be seen in Figure10. At node i, which corresponds to the left border of the rectangle in Figure 9, the vehicle may need to wait on a pedestrian crossing and then either drives past the stop or to the front of the stop. At node j, there is a possibility to (iteratively) adjust the time of the initial driving-time calculation if this was too short (as previously described in Section 3.4). A dwell-time activity then initiates at k, corresponding to the front of the stop, followed by a new driving activity at l as the vehicle drives out from the stop. At m, there is, again, a possibility to adjust the driving-time calculation. These adjustments finish at n, corresponding to the right border of the rectangle in Figure 9. The time of activities are found from the dwell time, driving time, and waiting time at pedestrian crossing functions (Sections 4.2–4.4).Figure 10
Network representations of the stop module. At nodei and l, nominal driving activities are initiated, and at j and m, additional driving-time activities are iterated until the additional time is equal to 0. At k, a dwell-time activity is initiated.The behaviour of the buses and their drivers will have an effect on the events of the module. A number of assumptions are made, based on qualitative terminal observations and reasonable assumptions. First, if a vehicle is to enter a stop that is already occupied, it will wait behind the bus in the stop and block the way for any bus wanting to drive past. Second, a bus entering a stop will be completely out of the driving lane when the back of the vehicle enters the stop. Third, a vehicle will not let passengers board and alight while waiting to enter an already occupied stop. Fourth, when there is a conflict between a bus wanting to leave a stop and another bus wanting to drive past, the passing bus will drive first if its front is parallel with the stop; otherwise, the bus in the stop will drive first. All of these vehicle interactions are handled when calculating the driving times in the driving-time function.


## 5.1. Entry Module

The entry module handles arrivals of vehicles to the terminal. Here, buses can be generated iteratively with intergeneration times found from the vehicle generation function (Section 4.1). A network representation of the entry module can be seen in the left part of Figure 7. It has one single node where vehicles are generated before being forwarded to the next module.Figure 7
Network representations of the entry module (a) and the exit module (b). At nodei in the entry module, vehicles are generated. At node j in the exit module, a vehicle will initiate a combined waiting and driving activity. The waiting time is denoted Wjkexit.


## 5.2. Exit Module

The exit module handles departures of vehicles from the terminal. The module includes a short stretch of driving and a vehicle may need to wait on a traffic light or outside traffic. The driving time can be retrieved from the driving-time function (Section 4.2) and the waiting time from the waiting time at exit function (Section 4.4). The right part of Figure 7 shows a network representation of the exit module. There are two nodes, one that initiates the combined activity of waiting at the exit and driving, and one that removes the vehicle.


## 5.3. Driving Section Module

A driving section module represents a stretch of the terminal roadway without any branching and merging within the section (this is instead modelled by combining driving sections). There are three versions of this module for slightly varying situations; a general driving module, the first driving section module after vehicle generation, and a junction module. The general module allows for a pedestrian crossing in the beginning of the road stretch. The first driving section module needs to be able to handle vehicles arriving from generation when the road ahead is blocked. A junction can be used whenever driving paths cross each other. This is modelled with one module for each combination of origin and destination in the junction.Figure8 shows network representations of the three versions of the driving section module. In the general module, vehicles may need to wait on pedestrians before driving through the section. These two activities are merged into one activity (possible since there is no decision point in between). The time of the activities are given by the driving time and the waiting time at pedestrian crossing functions (Sections 4.2 and 4.4). At the end of the activity, at node j, there may be a need to adjust the initially calculated nominal driving time, as discussed previously in Section 3.4. The other two driving section modules are similar to the general module. They do not allow for pedestrian crossings, but both can have other waiting times. The first driving section module after generation starts with a queue where vehicles waits if the road into the terminal is not clear. The junction module starts with an iterative waiting activity until the junction is free. Vehicles are assumed not to enter the junction if another vehicle is already driving through it or if the vehicle will need to stop in the middle of the crossing due to a vehicle standing still on the other side. Since the waiting time depends on the state of cells, this is calculated in the driving-time function. Another important behavioural aspect for driving sections, both for junctions and for merging of two driving section modules, is the question of priority. For simplicity, vehicles are here assumed to follow a first arrival drive first principle.Figure 8
Network representations of the three versions of the driving module: (a) a general driving section, (b) the first driving section after generation, and (c) a junction. All start with waiting time, then a nominal driving time (for a general driving section, these are combined into one activity). The last activity is an additional (iterative) driving activity that accounts for any adjustment needed of the initial driving time calculation.
(a)(b)(c)


## 5.4. Stop Module for Independent Linear Bus Stop with Adjacent Driving Lane

A stop module represents one stop at the terminal together with adjacent roadways. Different stop layouts need to be modelled differently, and the presented module represents two very similar types of stops. These have either a linear or a sawtooth design and consist of one berth with an adjacent driving lane, possibly with a pedestrian crossing before the stop, see Figure9 for the linear type. The stop operates independently, meaning that a vehicle wanting to enter or leave the stop can do so even if there is an occupied stop in the front or in the back. The module includes the stop itself, the adjacent driving lane, and the driving section before the stop (for a row of stops this will be the driving section between stops).Figure 9
An independent linear bus stop with an adjacent driving lane and a pedestrian crossing. The dashed rectangle marks the part included in one module.A network representation of the stop module can be seen in Figure10. At node i, which corresponds to the left border of the rectangle in Figure 9, the vehicle may need to wait on a pedestrian crossing and then either drives past the stop or to the front of the stop. At node j, there is a possibility to (iteratively) adjust the time of the initial driving-time calculation if this was too short (as previously described in Section 3.4). A dwell-time activity then initiates at k, corresponding to the front of the stop, followed by a new driving activity at l as the vehicle drives out from the stop. At m, there is, again, a possibility to adjust the driving-time calculation. These adjustments finish at n, corresponding to the right border of the rectangle in Figure 9. The time of activities are found from the dwell time, driving time, and waiting time at pedestrian crossing functions (Sections 4.2–4.4).Figure 10
Network representations of the stop module. At nodei and l, nominal driving activities are initiated, and at j and m, additional driving-time activities are iterated until the additional time is equal to 0. At k, a dwell-time activity is initiated.The behaviour of the buses and their drivers will have an effect on the events of the module. A number of assumptions are made, based on qualitative terminal observations and reasonable assumptions. First, if a vehicle is to enter a stop that is already occupied, it will wait behind the bus in the stop and block the way for any bus wanting to drive past. Second, a bus entering a stop will be completely out of the driving lane when the back of the vehicle enters the stop. Third, a vehicle will not let passengers board and alight while waiting to enter an already occupied stop. Fourth, when there is a conflict between a bus wanting to leave a stop and another bus wanting to drive past, the passing bus will drive first if its front is parallel with the stop; otherwise, the bus in the stop will drive first. All of these vehicle interactions are handled when calculating the driving times in the driving-time function.


## 6. Model Implementation

In this section, details of the model implementation and how the model can be adapted to various systems will be presented.


### 6.1. Modules, Functions, and Routing

The model has been implemented in SimEvents, a discrete event simulation engine and component library developed by MathWorks [26]. In the implementation, the modules are constructed from components in the SimEvents component library, and the functions consist of MATLAB functions accessible from the SimEvents model. The implemented modules closely follow the presented network descriptions of each module, together with various logical components. These are used for vehicle routing through the system. A vehicle carries a set of parameters and variables that can be used for routing purposes.


### 6.2. Parameters

Parameters of the implemented model can be divided into three categories, local module parameters, global parameters accessible to all modules and functions, and vehicle-specific parameters.Local module parameters are kept to a minimum in order to keep the modules general. These include module identification number, module variant (if there are different versions of the module), and parameters specifying how the module is situated in relation to other modules and routing parameters (e.g., which lines are to use a stop). Most parameters specifying a module are instead global parameters accessible through the module identification number.Global parameters include cell length, dwell-time parameters (e.g., time per boarding and alighting passenger), parameters controlling driving behaviour (e.g., vehicle speed and minimum time gap between vehicles), planning parameters (e.g., line numbers and timetable), distribution parameters for time calculations, relations between modules parameters, and module length parameters.Vehicle-specific parameters are associated with vehicles at generation through the vehicle generation function. These include vehicle parameters (e.g., length and type), planning parameters (e.g., line number and individual timetable), dwell-time-related parameters (e.g., number of doors and board or alight), and routing parameters (e.g., if the vehicle will use a layover area and which exit to use). Added to the vehicle-specific parameters is a set of variables that are used for statistics (e.g., the driving delay of a vehicle) and routing (e.g., where a vehicle should be going next). Saving statistics is handled by the exit module at vehicle termination.


### 6.3. Time Calculations

The time duration of activities can be calculated in various ways, as presented in Sections4.1–4.4. Some of these alternatives have been implemented in the model. When selecting the probability distributions to implement, the lognormal distribution has in most cases been selected due to being a well-known distribution with a right tail. The various modelled time durations can be expected to have such a tail with most measurements centred around a value and with some outliers representing extraordinary delays. The lognormal distribution has, for instance, been used for arrival delay [23] and dwell time [27]. In the absence of an asymmetric right tail, the normal distribution can often be a good choice. The choices of distributions are discussed in relation to empirical measurements in Section 7.The arrival delay in calculations of vehicle intergeneration time, see equation (1), is modelled with a lognormal distribution with parameters μgen and σgen:(6)Xgen∼Lognormalμgen,σgen2.This distribution has been used, for instance, by Rietveld et al., who showed that the lognormal distribution had the best fit to their data of interurban bus arrivals of the tested distributions [23].Two versions of dwell-time modelling have been implemented, the linear equations presented in equations (2)–(4) and a simpler alternative in the form of a lognormal distribution with parameters μDT and σDT:(7)TijDT=XDT,XDT∼LognormalμDT,σDT2.The waiting time at a pedestrian crossing is implemented with a probability of having to wait and a distribution modelling the waiting time, as in equation (5). The implemented distribution is the lognormal distribution with parameters μwait_ped and σwait_ped:(8)Xwait_ped∼Lognormalμwait_ped,σwait_ped2.The waiting time at an exit has two versions implemented, an unsignalized exit and a vehicle actuated traffic signal. The unsignalized exit is modelled in the same way as the pedestrian crossing with a probability to wait and a lognormal distribution for the waiting time with parametersμwait_unsign_exit and σwait_unsign_exit:(9)Xwait_unsign_exit∼Lognormalμwait_unsign_exit,σwait_unsign_exit2.The vehicle actuated traffic signal is implemented with a lognormal probability distribution and parametersμwait_sign_exit and σwait_sign_exit:(10)Tijwait_sign_exit=Xwait_sign_exit,Xwait_sign_exit∼Lognormalμwait_sign_exit,σwait_sign_exit2.The number of boarding and alighting passengers is modelled with two normal distributions, rounded up to the nearest integer, with parametersμboarding, σboarding, μaligting, and σaligting:(11a)nboarding=Xboarding,Xboarding∼Nμboarding,σboarding2,(11b)naligting=Xaligting,Xaligting∼Nμaligting,σaligting2.


### 6.4. Adapting the Model

The basic idea of the presented model is to be as general as possible in order to be easily adaptable to various terminals. The modules make it possible to construct and evaluate various systems, timetables, and traffic planning. Here, the steps taken to adapt the model to a specific system will be presented.First, the system needs to be studied to identify the modules needed and how to order them. The modules are then added to an adapted simulation model and numbered, and, when there are alternatives, variants are selected. The modules are also connected to each other and their order and connections are described as global parameters in order to be accessible to the functions. Added is also a number of logical components that handles vehicle routing. These are modified as needed for the vehicles to be routed to the right positions. A switch could, for instance, send a vehicle with the exit parameter equal to 1 in one direction and one with exit parameter equal to 2 in another direction. The presented functions are also added and for those with alternative modelling, one approach is selected.Added to the routing and variant parameters, all other parameters presented inSection 6.2 need to be set. Terminal dimensions and planning and vehicle parameters may be known to operators or public transport authorities. The dwell time and behaviour parameters are typically not known; however, distribution parameters can be estimated from empirical data, if such is available (e.g., the arrival delay can be estimated from empirical measurements of arrival times together with the planned arrival times).Depending on the terminal, the modelled modules and functions may be insufficient to describe the system. There may be other types of stops or other priority rules, for instance. In these cases, new modules or variants of modules need to be constructed. Due to the modular approach, these can easily be added to the model.


## 6.1. Modules, Functions, and Routing

The model has been implemented in SimEvents, a discrete event simulation engine and component library developed by MathWorks [26]. In the implementation, the modules are constructed from components in the SimEvents component library, and the functions consist of MATLAB functions accessible from the SimEvents model. The implemented modules closely follow the presented network descriptions of each module, together with various logical components. These are used for vehicle routing through the system. A vehicle carries a set of parameters and variables that can be used for routing purposes.


## 6.2. Parameters

Parameters of the implemented model can be divided into three categories, local module parameters, global parameters accessible to all modules and functions, and vehicle-specific parameters.Local module parameters are kept to a minimum in order to keep the modules general. These include module identification number, module variant (if there are different versions of the module), and parameters specifying how the module is situated in relation to other modules and routing parameters (e.g., which lines are to use a stop). Most parameters specifying a module are instead global parameters accessible through the module identification number.Global parameters include cell length, dwell-time parameters (e.g., time per boarding and alighting passenger), parameters controlling driving behaviour (e.g., vehicle speed and minimum time gap between vehicles), planning parameters (e.g., line numbers and timetable), distribution parameters for time calculations, relations between modules parameters, and module length parameters.Vehicle-specific parameters are associated with vehicles at generation through the vehicle generation function. These include vehicle parameters (e.g., length and type), planning parameters (e.g., line number and individual timetable), dwell-time-related parameters (e.g., number of doors and board or alight), and routing parameters (e.g., if the vehicle will use a layover area and which exit to use). Added to the vehicle-specific parameters is a set of variables that are used for statistics (e.g., the driving delay of a vehicle) and routing (e.g., where a vehicle should be going next). Saving statistics is handled by the exit module at vehicle termination.


## 6.3. Time Calculations

The time duration of activities can be calculated in various ways, as presented in Sections4.1–4.4. Some of these alternatives have been implemented in the model. When selecting the probability distributions to implement, the lognormal distribution has in most cases been selected due to being a well-known distribution with a right tail. The various modelled time durations can be expected to have such a tail with most measurements centred around a value and with some outliers representing extraordinary delays. The lognormal distribution has, for instance, been used for arrival delay [23] and dwell time [27]. In the absence of an asymmetric right tail, the normal distribution can often be a good choice. The choices of distributions are discussed in relation to empirical measurements in Section 7.The arrival delay in calculations of vehicle intergeneration time, see equation (1), is modelled with a lognormal distribution with parameters μgen and σgen:(6)Xgen∼Lognormalμgen,σgen2.This distribution has been used, for instance, by Rietveld et al., who showed that the lognormal distribution had the best fit to their data of interurban bus arrivals of the tested distributions [23].Two versions of dwell-time modelling have been implemented, the linear equations presented in equations (2)–(4) and a simpler alternative in the form of a lognormal distribution with parameters μDT and σDT:(7)TijDT=XDT,XDT∼LognormalμDT,σDT2.The waiting time at a pedestrian crossing is implemented with a probability of having to wait and a distribution modelling the waiting time, as in equation (5). The implemented distribution is the lognormal distribution with parameters μwait_ped and σwait_ped:(8)Xwait_ped∼Lognormalμwait_ped,σwait_ped2.The waiting time at an exit has two versions implemented, an unsignalized exit and a vehicle actuated traffic signal. The unsignalized exit is modelled in the same way as the pedestrian crossing with a probability to wait and a lognormal distribution for the waiting time with parametersμwait_unsign_exit and σwait_unsign_exit:(9)Xwait_unsign_exit∼Lognormalμwait_unsign_exit,σwait_unsign_exit2.The vehicle actuated traffic signal is implemented with a lognormal probability distribution and parametersμwait_sign_exit and σwait_sign_exit:(10)Tijwait_sign_exit=Xwait_sign_exit,Xwait_sign_exit∼Lognormalμwait_sign_exit,σwait_sign_exit2.The number of boarding and alighting passengers is modelled with two normal distributions, rounded up to the nearest integer, with parametersμboarding, σboarding, μaligting, and σaligting:(11a)nboarding=Xboarding,Xboarding∼Nμboarding,σboarding2,(11b)naligting=Xaligting,Xaligting∼Nμaligting,σaligting2.


## 6.4. Adapting the Model

The basic idea of the presented model is to be as general as possible in order to be easily adaptable to various terminals. The modules make it possible to construct and evaluate various systems, timetables, and traffic planning. Here, the steps taken to adapt the model to a specific system will be presented.First, the system needs to be studied to identify the modules needed and how to order them. The modules are then added to an adapted simulation model and numbered, and, when there are alternatives, variants are selected. The modules are also connected to each other and their order and connections are described as global parameters in order to be accessible to the functions. Added is also a number of logical components that handles vehicle routing. These are modified as needed for the vehicles to be routed to the right positions. A switch could, for instance, send a vehicle with the exit parameter equal to 1 in one direction and one with exit parameter equal to 2 in another direction. The presented functions are also added and for those with alternative modelling, one approach is selected.Added to the routing and variant parameters, all other parameters presented inSection 6.2 need to be set. Terminal dimensions and planning and vehicle parameters may be known to operators or public transport authorities. The dwell time and behaviour parameters are typically not known; however, distribution parameters can be estimated from empirical data, if such is available (e.g., the arrival delay can be estimated from empirical measurements of arrival times together with the planned arrival times).Depending on the terminal, the modelled modules and functions may be insufficient to describe the system. There may be other types of stops or other priority rules, for instance. In these cases, new modules or variants of modules need to be constructed. Due to the modular approach, these can easily be added to the model.


## 7. Case Study

The model is tested and evaluated in a case study of the bus terminal at Norrköping interchange station in Sweden. A number of scenarios are simulated and evaluated for the afternoon peak period between 3 and 5 pm. In this section, the bus terminal of the case study will be presented, followed by details of the model implementation, the performance measures, and the data used.


### 7.1. Norrköping Bus Terminal

Norrköping interchange station is a multimodal station with over 6000 boarding passengers each day and expected increases in demand over the coming years. The bus terminal of the station consists of 18 bus stops (14 in use during normal operations) and is used by several types of bus lines, both regional and long-distance. The stops are arranged in three rows with six sawtooth bus stops each (Figure11). On the south-east side there is a combined entry and exit connected to a roundabout and on the south-west side, there is an exit regulated by a vehicle actuated traffic light. Next to the two rows of stops at the top is a driving lane for buses going from east to west. The third row of stops has two adjacent lanes, making it possible to drive in both directions. To the north-east, there is a layover area used when buses need to wait between arrival and departure from the terminal. The lengths of various parts of the terminal are determined by taking measurements of a terminal drawing.Figure 11
The bus terminal at Norrköping interchange station. The filled squares, both dark and light grey show stops currently in use during normal operations. The dark grey filled squares show the stops in use in the reallocation of lines to stops scenario.


### 7.2. Model Adaptation

The terminal is modelled with 47 modules: 1 entry module, 2 exit modules, 18 stop modules, and 26 driving section modules, including two sets of junction modules used on the east side of the terminal were many routes intersect. Since observations of the terminal have made it obvious that there are very few interactions between pedestrians and vehicles, no pedestrian crossings are included. This means that pedestrians are assumed to cross when no vehicle will be affected. The layover area is considered to be outside of the terminal and is modelled as a simple waiting time activity. Routing of vehicles is based on the line number of the vehicle (each stop associated with one or more line number), the time between arrival and new departure (for layover operations) and which exit to use. The cell size is set to 1 meter. The rest of the parameters and the data used to estimate them will be presented in the following sections.


### 7.3. Performance Measures Used in the Case Study

There are a great variety of public transport performance measures used by the many service providers throughout the world. A guidebook for developing a transit performance-measurement system [28] presents a huge number of measures within a large number of categories. Several of these relate to bus stops, bus terminals, and operation of the buses, including capacity of individual bus stops and reliability related measures such as the on-time performance (punctuality) and the headway regularity. Punctuality and regularity have also been pointed out by other studies as the relevant time reliability metrics of bus stops [29]. In this case study, we use the average deviation from the planned departure time in the timetable, the lateness, to represent the punctuality. This shows the effects of delays and congestion on the passengers. The metric does not only depend on the situation on the terminal but also on delays originating outside of the terminal. Since it is defined as the lateness at departure from the stop, it does not include any delays occurring as vehicles leave the terminal. The lateness is calculated based on the simulated departure time from the stop, tkactual_dep_stop, and the planned departure time, tktimetable_dep_stop:(12)Tlateness_avg=∑k=1mtkactual_dep_stop−tktimetable_dep_stopm.For bus terminals, it is also of interest to know how the functioning of the terminal itself is affecting the vehicles. Two more performance measures are used to this regard. The first is the driving delay, the time spent waiting at blocking vehicles. Near or over capacity, one can expect more time spent waiting in this way for each individual vehicle. This measure does not include delay at arrival, layover time, or lateness in relation to the timetable and thus indicates how well the terminal itself is functioning. For a total ofm vehicles, the average driving delay is(13)Tdriving_delay_avg=∑k=1m∑qTk,qdriving_delaym,where Tk,qdriving_delay is the driving delay of vehicle k for each situation it has been delayed (waiting in a queue or on a blocking vehicle), denominated as q.The third performance measure is the terminal time, which is the time from arrival to departure from the terminal. It includes both delays, planned processes, and planned waiting times. It can, together with the other two metrics, give a deeper understanding of the functioning of the terminal. The average terminal time is calculated based on the arrival time to the terminal entry,tkactual_arr, and the departure time from the exit, tkactual_dep_term:(14)Tterminal_time_avg=∑k=1mtkactual_dep_term−tkactual_arrm.


### 7.4. Timetables, Vehicles, and Vehicle Arrivals

Timetables for spring 2018 are used in the case study. These include 21 regional lines with up to six arrivals and departures to the terminal during the time period, between 3 and 5 pm. Additional arrivals and departures are also used during a 30 minutes warm-up period before 3 pm. The arrival times are used in equation (1) for assigning values to ttimetable_arr,k. Each line always uses the same stop, both for alighting and boarding, as well as the same exit. Most of the lines have the terminal as the start or end of their route and a vehicle arriving as one line may depart as another one. The time between arrival and departure varies and vehicles with longer waiting times drive to the layover area in order to not occupy a stop. In accordance with regulations, these vehicles need to drive back to the departure stop five minutes before departure. For this reason, the time limit for when the layover area is used is set to 6 minutes until the departure time.Four different bus types stop at the terminal, one of these being a double-decker bus. The buses are of low-floor type and have lengths between 12 and 15 meters and two doors. Boarding is only allowed at the front door and alighting at the back door, except for the double-decker bus where both processes are allowed at both doors. Aside from the regional bus lines, there are also a total of 13 long-distance departures. These do not use the layover area. No empirical data have been available for the long-distance lines, and for this reason, these are assumed to behave as the regional ones. Their lengths are assumed to be 15 meters.For the regional lines, data of vehicle arrivals for a period of close to five weeks during January and February 2018 have been received from Östgötatrafiken, the regional public transport authority responsible for Norrköping. This data give the arrival time to the stop and have been adjusted to the terminal entry by using the distances between stops and entry and the same speed as the one used in the simulations. Incomplete data points were removed, together with arrivals registered incorrectly (not registered until the time of their new departure). This leaves 1188 measurements with an average arrival time of 0.63 minutes before the planned arrival time. Using the gathered data and the maximum likelihood method, the parameters of the lognormal probability distribution, see equation (6), was then estimated. This distribution was a good candidate since plots of the data had a similar form with a right tail. The same distribution was used for all lines. In the estimation, all values were shifted to positive values (needed for the lognormal distribution) and not too close to 0 (forces a rapid increase of the lognormal distribution which gives a bad fit to the data). We calculate this shift, a, from(15)a=tsmallest_meas_arr+tlargest_meas_arr−tsmallest_meas_arr5,where the first term shifts the data so that the smallest value, tsmallest_meas_arr, is moved to 0. The second term shifts the measurements further from 0 based on the difference of the largest measurement, tlargest_meas_arr, and the smallest together with a scaling factor. The parameter values are given in Table 1.Table 1
The probability distributions used in the case study and their parameter values.
DistributionParameter 1Parameter 2Parameter 3Lateness at arrival (min)Lognormalμ=2.97σ=0.26a=−20.8No. of passengersNormalμ=10.7σ=0.82West exit delay-uncongested (s)Lognormalμ=1.43σ=0.65a=1West exit delay-congested (s)Lognormalμ=4.07σ=0.22a=0East exit delay (s)Lognormalμ=1.10σ=0.61a=0


### 7.5. Dwell-Time-Related Data

The dwell time is calculated using the linear formulas in equations (2)–(4) and the normal distribution for the number of boarding and alighting passengers. The parameters needed include the normal probability distribution parameters, the time per boarding passenger, tboard, the time per alighting passenger, talight, and the deadtime, t0. Here, dwell-time function parameters from Tirachini are used [21]. Boarding time per passenger is set to 4.6 s, alighting time to 1.3 s, and dead time to 5.2 s. This corresponds to a low-floor bus, payment using a magnetic strip prepaid card at the front door and alighting at the back door. The same values are used for all bus types, including the double-decker.For the estimation of the number of boarding passenger distribution parameters, registered smart card passenger boardings have been available for a period of almost six weeks with a total of 1392 measurements. The average number of boardings per departure was calculated for each line and a normal probability distribution was estimated using the maximum likelihood method (Table1). While the number of boarding passengers is discrete, the general form of the distribution is appropriate. The number of boardings is simulated using the same distribution for all lines. This distribution is expected to slightly underestimate real values since boarding passengers can pay not only by smart card but also with a credit and a mobile app. The boarding data are thus incomplete, but since boardings during the period in question largely consist of commuters, smart card is expected to be the most common means of payment. As for alighting passengers, no data were available and the same estimated distribution as for boarding passengers was used as a simple approximation.


### 7.6. Exits and Driving Parameters

Delays at the two exits of the terminal are controlled by probability distributions. At the west exit, with a vehicle actuated signal, vehicles always need to wait until the signal changes unless they have been waiting in a queue at the exit. This is usually only a short delay, but sometimes vehicles experience longer delays due to congestion on the road outside of the terminal. When this happens, the signal only lets one vehicle through at a time and queuing vehicles get more delay at the signal. The congested situation is not included in the base scenario but in a separate one (Section 8.2). Both these situations are modelled with the lognormal distribution in equation (10) with parameters estimated from empirical measurements at the west exit during two time periods (two days). Plots of the data have a tail to the right, making the lognormal distribution suitable. The maximum likelihood method was used in the estimation. For the uncongested case, the smallest values come too close to 0 for a good fit. A small shift of the measurements is for this reason used. At the east exit, with a roundabout, vehicles will not always need to wait. Both the likelihood of having to wait, p, and the parameters of the probability distribution for the waiting time in equation (5) need to be estimated. Empirical measurements of one time period have been carried out for this purpose. Again, plots show a right tail and the lognormal distribution is used. The parameter estimation is based on the maximum likelihood method. The probability of having to wait is 37.5%, and all exit delay distribution parameters can be found in Table 1.The driving parameters are the speed of the vehicles and the minimum time gap between vehicles. The former is set to a value suggested by a practitioner, 5.6 m/s, and the latter is taken from measurements of stop-and-go road traffic in Neubert et al. and set to 1.8 s [30].


## 7.1. Norrköping Bus Terminal

Norrköping interchange station is a multimodal station with over 6000 boarding passengers each day and expected increases in demand over the coming years. The bus terminal of the station consists of 18 bus stops (14 in use during normal operations) and is used by several types of bus lines, both regional and long-distance. The stops are arranged in three rows with six sawtooth bus stops each (Figure11). On the south-east side there is a combined entry and exit connected to a roundabout and on the south-west side, there is an exit regulated by a vehicle actuated traffic light. Next to the two rows of stops at the top is a driving lane for buses going from east to west. The third row of stops has two adjacent lanes, making it possible to drive in both directions. To the north-east, there is a layover area used when buses need to wait between arrival and departure from the terminal. The lengths of various parts of the terminal are determined by taking measurements of a terminal drawing.Figure 11
The bus terminal at Norrköping interchange station. The filled squares, both dark and light grey show stops currently in use during normal operations. The dark grey filled squares show the stops in use in the reallocation of lines to stops scenario.


## 7.2. Model Adaptation

The terminal is modelled with 47 modules: 1 entry module, 2 exit modules, 18 stop modules, and 26 driving section modules, including two sets of junction modules used on the east side of the terminal were many routes intersect. Since observations of the terminal have made it obvious that there are very few interactions between pedestrians and vehicles, no pedestrian crossings are included. This means that pedestrians are assumed to cross when no vehicle will be affected. The layover area is considered to be outside of the terminal and is modelled as a simple waiting time activity. Routing of vehicles is based on the line number of the vehicle (each stop associated with one or more line number), the time between arrival and new departure (for layover operations) and which exit to use. The cell size is set to 1 meter. The rest of the parameters and the data used to estimate them will be presented in the following sections.


## 7.3. Performance Measures Used in the Case Study

There are a great variety of public transport performance measures used by the many service providers throughout the world. A guidebook for developing a transit performance-measurement system [28] presents a huge number of measures within a large number of categories. Several of these relate to bus stops, bus terminals, and operation of the buses, including capacity of individual bus stops and reliability related measures such as the on-time performance (punctuality) and the headway regularity. Punctuality and regularity have also been pointed out by other studies as the relevant time reliability metrics of bus stops [29]. In this case study, we use the average deviation from the planned departure time in the timetable, the lateness, to represent the punctuality. This shows the effects of delays and congestion on the passengers. The metric does not only depend on the situation on the terminal but also on delays originating outside of the terminal. Since it is defined as the lateness at departure from the stop, it does not include any delays occurring as vehicles leave the terminal. The lateness is calculated based on the simulated departure time from the stop, tkactual_dep_stop, and the planned departure time, tktimetable_dep_stop:(12)Tlateness_avg=∑k=1mtkactual_dep_stop−tktimetable_dep_stopm.For bus terminals, it is also of interest to know how the functioning of the terminal itself is affecting the vehicles. Two more performance measures are used to this regard. The first is the driving delay, the time spent waiting at blocking vehicles. Near or over capacity, one can expect more time spent waiting in this way for each individual vehicle. This measure does not include delay at arrival, layover time, or lateness in relation to the timetable and thus indicates how well the terminal itself is functioning. For a total ofm vehicles, the average driving delay is(13)Tdriving_delay_avg=∑k=1m∑qTk,qdriving_delaym,where Tk,qdriving_delay is the driving delay of vehicle k for each situation it has been delayed (waiting in a queue or on a blocking vehicle), denominated as q.The third performance measure is the terminal time, which is the time from arrival to departure from the terminal. It includes both delays, planned processes, and planned waiting times. It can, together with the other two metrics, give a deeper understanding of the functioning of the terminal. The average terminal time is calculated based on the arrival time to the terminal entry,tkactual_arr, and the departure time from the exit, tkactual_dep_term:(14)Tterminal_time_avg=∑k=1mtkactual_dep_term−tkactual_arrm.


## 7.4. Timetables, Vehicles, and Vehicle Arrivals

Timetables for spring 2018 are used in the case study. These include 21 regional lines with up to six arrivals and departures to the terminal during the time period, between 3 and 5 pm. Additional arrivals and departures are also used during a 30 minutes warm-up period before 3 pm. The arrival times are used in equation (1) for assigning values to ttimetable_arr,k. Each line always uses the same stop, both for alighting and boarding, as well as the same exit. Most of the lines have the terminal as the start or end of their route and a vehicle arriving as one line may depart as another one. The time between arrival and departure varies and vehicles with longer waiting times drive to the layover area in order to not occupy a stop. In accordance with regulations, these vehicles need to drive back to the departure stop five minutes before departure. For this reason, the time limit for when the layover area is used is set to 6 minutes until the departure time.Four different bus types stop at the terminal, one of these being a double-decker bus. The buses are of low-floor type and have lengths between 12 and 15 meters and two doors. Boarding is only allowed at the front door and alighting at the back door, except for the double-decker bus where both processes are allowed at both doors. Aside from the regional bus lines, there are also a total of 13 long-distance departures. These do not use the layover area. No empirical data have been available for the long-distance lines, and for this reason, these are assumed to behave as the regional ones. Their lengths are assumed to be 15 meters.For the regional lines, data of vehicle arrivals for a period of close to five weeks during January and February 2018 have been received from Östgötatrafiken, the regional public transport authority responsible for Norrköping. This data give the arrival time to the stop and have been adjusted to the terminal entry by using the distances between stops and entry and the same speed as the one used in the simulations. Incomplete data points were removed, together with arrivals registered incorrectly (not registered until the time of their new departure). This leaves 1188 measurements with an average arrival time of 0.63 minutes before the planned arrival time. Using the gathered data and the maximum likelihood method, the parameters of the lognormal probability distribution, see equation (6), was then estimated. This distribution was a good candidate since plots of the data had a similar form with a right tail. The same distribution was used for all lines. In the estimation, all values were shifted to positive values (needed for the lognormal distribution) and not too close to 0 (forces a rapid increase of the lognormal distribution which gives a bad fit to the data). We calculate this shift, a, from(15)a=tsmallest_meas_arr+tlargest_meas_arr−tsmallest_meas_arr5,where the first term shifts the data so that the smallest value, tsmallest_meas_arr, is moved to 0. The second term shifts the measurements further from 0 based on the difference of the largest measurement, tlargest_meas_arr, and the smallest together with a scaling factor. The parameter values are given in Table 1.Table 1
The probability distributions used in the case study and their parameter values.
DistributionParameter 1Parameter 2Parameter 3Lateness at arrival (min)Lognormalμ=2.97σ=0.26a=−20.8No. of passengersNormalμ=10.7σ=0.82West exit delay-uncongested (s)Lognormalμ=1.43σ=0.65a=1West exit delay-congested (s)Lognormalμ=4.07σ=0.22a=0East exit delay (s)Lognormalμ=1.10σ=0.61a=0


## 7.5. Dwell-Time-Related Data

The dwell time is calculated using the linear formulas in equations (2)–(4) and the normal distribution for the number of boarding and alighting passengers. The parameters needed include the normal probability distribution parameters, the time per boarding passenger, tboard, the time per alighting passenger, talight, and the deadtime, t0. Here, dwell-time function parameters from Tirachini are used [21]. Boarding time per passenger is set to 4.6 s, alighting time to 1.3 s, and dead time to 5.2 s. This corresponds to a low-floor bus, payment using a magnetic strip prepaid card at the front door and alighting at the back door. The same values are used for all bus types, including the double-decker.For the estimation of the number of boarding passenger distribution parameters, registered smart card passenger boardings have been available for a period of almost six weeks with a total of 1392 measurements. The average number of boardings per departure was calculated for each line and a normal probability distribution was estimated using the maximum likelihood method (Table1). While the number of boarding passengers is discrete, the general form of the distribution is appropriate. The number of boardings is simulated using the same distribution for all lines. This distribution is expected to slightly underestimate real values since boarding passengers can pay not only by smart card but also with a credit and a mobile app. The boarding data are thus incomplete, but since boardings during the period in question largely consist of commuters, smart card is expected to be the most common means of payment. As for alighting passengers, no data were available and the same estimated distribution as for boarding passengers was used as a simple approximation.


## 7.6. Exits and Driving Parameters

Delays at the two exits of the terminal are controlled by probability distributions. At the west exit, with a vehicle actuated signal, vehicles always need to wait until the signal changes unless they have been waiting in a queue at the exit. This is usually only a short delay, but sometimes vehicles experience longer delays due to congestion on the road outside of the terminal. When this happens, the signal only lets one vehicle through at a time and queuing vehicles get more delay at the signal. The congested situation is not included in the base scenario but in a separate one (Section 8.2). Both these situations are modelled with the lognormal distribution in equation (10) with parameters estimated from empirical measurements at the west exit during two time periods (two days). Plots of the data have a tail to the right, making the lognormal distribution suitable. The maximum likelihood method was used in the estimation. For the uncongested case, the smallest values come too close to 0 for a good fit. A small shift of the measurements is for this reason used. At the east exit, with a roundabout, vehicles will not always need to wait. Both the likelihood of having to wait, p, and the parameters of the probability distribution for the waiting time in equation (5) need to be estimated. Empirical measurements of one time period have been carried out for this purpose. Again, plots show a right tail and the lognormal distribution is used. The parameter estimation is based on the maximum likelihood method. The probability of having to wait is 37.5%, and all exit delay distribution parameters can be found in Table 1.The driving parameters are the speed of the vehicles and the minimum time gap between vehicles. The former is set to a value suggested by a practitioner, 5.6 m/s, and the latter is taken from measurements of stop-and-go road traffic in Neubert et al. and set to 1.8 s [30].


## 8. Results

A number of scenarios have been simulated as a first test of the model and how it can be used to evaluate the operations of a terminal. The first scenario investigates a possible future where there is an increase in the number of passengers. In the second scenario, the effect of increased traffic at the south-west exit is investigated by increasing the exit delay. In the last scenario, the bus lines have been reallocated in order to use fewer stops. This investigates the effect of reducing the size of the terminal. All scenarios have been simulated with 100 replications, where each of these has between 46 and 55 observations (i.e., vehicles leaving the terminal).


### 8.1. Increased Number of Passengers

In this scenario, the effect of an increase in the number of passengers is simulated. The expected values of the normal distributions determining the number of boarding and alighting passengers are increased to four and ten times the current number of passengers (from 10.7 to 42.8 and 107). The terminal in question has few departures in relation to its size and large increases in demand are expected to have little effect on its operation. The results for driving delay, lateness, and terminal time are shown in Table2 in the form of averages of the results from individual iterations of the simulation with 95% confidence intervals. The driving delay is almost identical to the base case at four times the number of passengers and higher at ten times the number. Increased dwell times thus result in more and longer driving delay.Table 2
Results for the increased number of passengers scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)1x passengers19.5± 2.412.6± 0.10.741± 0.0644x passengers19.7± 2.513.1± 0.11.21± 0.0810x passengers44.1± 5.917.1± 0.15.38± 0.12The driving delay can be set in relation to the total time vehicles spend on the terminal, the terminal time. It is evident from Table2 that the effect on this metric is smaller when increasing the number of passengers. The terminal time includes planned layover time (the average time between arrival and departure is 12 minutes). Neither the driving delay nor the terminal time tells anything of a vehicle’s lateness at departure, which instead is given by the third metric. As expected, increased dwell times result in more lateness, almost twice as high for four times the number of passengers and over seven times as high for ten times as many. These values do not include any blockages occurring between the stop and the terminal exit. The presented results indicate that the number of passengers can be greatly increased, at least four times the present number, with very little effect on the vehicles. It should be pointed out, however, that an increase in the number of passengers may also affect pedestrian crossings. Here, it has been assumed that the passengers still only cross the roads when no vehicle needs to wait, as in the base case. If the vehicles need to wait on crossing pedestrians, all three metrics would likely increase.


### 8.2. Longer Delay at the South-West Exit

The situation with outside congestion at the south-west exit is examined in this scenario. The parameters of the probability distribution controlling delay at this exit are estimated from a congested situation instead of an uncongested one (Table1). This will affect not only vehicles that are to use this exit but may also affect other vehicles. If more than one vehicle is waiting on the exit, the return lane used to get to the other exit, the layover area, and to return to another stop will be blocked. The results for driving delay, lateness, and terminal time are shown in Table 3. Again, in the form of averages of the results from individual iterations of the simulation with 95% confidence intervals, the average driving delay has increased substantially, even though it does not include the delay at the exit. While the terminal time includes the delay at the exit, it is still only slightly increased. The lateness is almost not affected by the situation at the exit at all. All of this means that a queue is indeed forming at the exit at times, blocking vehicles that need to drive past to return to the other side. This delay is still small enough, however, to be absorbed into the layover time before departure and much smaller than the terminal time.Table 3
Results for the longer delay at the south-west exit scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)No extra delay19.5± 2.412.6± 0.10.741± 0.064Extra delay105± 414.7± 0.10.746± 0.064


### 8.3. Reallocation of Lines to Stops

In this last scenario, the lines have been allocated differently to the stops in order to reduce the number of stops needed. Out of the 18 stops, 14 are used in the base case (see the solid squares in Figure11). In the reallocation scenario, a number of these have been merged without introducing conflicts (if the vehicles would arrive and depart according to the planned times). This results in only 9 stops being used (see the dark grey filled squares in Figure 11). The reduction in the number of stops is expected to worsen the situation, but this may not necessarily be the case since the departures per stop are still relatively few. The results for this scenario can be seen in Table 4 in the form of averages of the individual iterations with 95% confidence intervals. The average driving delay is almost the same and so is the average time spent at the terminal and the deviation from the timetable at departure. This indicates that the Norrköping terminal is greatly overdimensioned in relation to the current amount of traffic at the terminal and could operate sufficiently with much fewer stops.Table 4
Results for the reallocation of lines to stops scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)Base allocation19.5± 2.412.6± 0.10.741± 0.064Reduced number of stops22.8± 2.512.8± 0.10.773± 0.068


### 8.4. Discussion of the Discrete Event Approach

A number of lessons can be learnt from the modelling process and the case study. The discrete event modelling approach has been well-suited to capture the important events of a terminal and their connections to physical locations. This forms a good basis to construct terminal modules. The modules themselves have proven a useful and flexible way to model a terminal. They form a good basis to add upon as modelling of new terminal sections or behaviour is needed.A disadvantage with the discrete event approach is the non-straightforward way to handle the spatially distributed vehicle interactions that can occur at any point at the terminal. The approach presented here, with cells that are either free or occupied, has been able to capture such interactions with a resolution dependant on the size of the cells. This makes it possible to adjust the resolution to the adaptation and the modelled layout. Driving through the cells of a section was merged into one activity in order to let the number of cells be easily changeable and in that way facilitate modularity (Sections3.4 and 4.2). Since this relies on future states of the system, it results in a need to continuously update the driving times. This process is complex to implement and slows down simulations. Alternative ways to model the driving activity without relying on future states, but still retain the modularity and capture the vehicle interactions, can be of interest to explore further.The case study has shown that the approach is promising for evaluations and comparisons of terminals and scenarios. Validation studies of the model are needed, however, in order to test how accurate it can represent reality. For such a study, a more congested terminal than the Norrköping bus terminal is needed. An important aspect to take into consideration is the often limited amount of empirical data available for terminals and if this is sufficient for calibration and validation of the model. This is investigated in Lindberg et al. [31].


## 8.1. Increased Number of Passengers

In this scenario, the effect of an increase in the number of passengers is simulated. The expected values of the normal distributions determining the number of boarding and alighting passengers are increased to four and ten times the current number of passengers (from 10.7 to 42.8 and 107). The terminal in question has few departures in relation to its size and large increases in demand are expected to have little effect on its operation. The results for driving delay, lateness, and terminal time are shown in Table2 in the form of averages of the results from individual iterations of the simulation with 95% confidence intervals. The driving delay is almost identical to the base case at four times the number of passengers and higher at ten times the number. Increased dwell times thus result in more and longer driving delay.Table 2
Results for the increased number of passengers scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)1x passengers19.5± 2.412.6± 0.10.741± 0.0644x passengers19.7± 2.513.1± 0.11.21± 0.0810x passengers44.1± 5.917.1± 0.15.38± 0.12The driving delay can be set in relation to the total time vehicles spend on the terminal, the terminal time. It is evident from Table2 that the effect on this metric is smaller when increasing the number of passengers. The terminal time includes planned layover time (the average time between arrival and departure is 12 minutes). Neither the driving delay nor the terminal time tells anything of a vehicle’s lateness at departure, which instead is given by the third metric. As expected, increased dwell times result in more lateness, almost twice as high for four times the number of passengers and over seven times as high for ten times as many. These values do not include any blockages occurring between the stop and the terminal exit. The presented results indicate that the number of passengers can be greatly increased, at least four times the present number, with very little effect on the vehicles. It should be pointed out, however, that an increase in the number of passengers may also affect pedestrian crossings. Here, it has been assumed that the passengers still only cross the roads when no vehicle needs to wait, as in the base case. If the vehicles need to wait on crossing pedestrians, all three metrics would likely increase.


## 8.2. Longer Delay at the South-West Exit

The situation with outside congestion at the south-west exit is examined in this scenario. The parameters of the probability distribution controlling delay at this exit are estimated from a congested situation instead of an uncongested one (Table1). This will affect not only vehicles that are to use this exit but may also affect other vehicles. If more than one vehicle is waiting on the exit, the return lane used to get to the other exit, the layover area, and to return to another stop will be blocked. The results for driving delay, lateness, and terminal time are shown in Table 3. Again, in the form of averages of the results from individual iterations of the simulation with 95% confidence intervals, the average driving delay has increased substantially, even though it does not include the delay at the exit. While the terminal time includes the delay at the exit, it is still only slightly increased. The lateness is almost not affected by the situation at the exit at all. All of this means that a queue is indeed forming at the exit at times, blocking vehicles that need to drive past to return to the other side. This delay is still small enough, however, to be absorbed into the layover time before departure and much smaller than the terminal time.Table 3
Results for the longer delay at the south-west exit scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)No extra delay19.5± 2.412.6± 0.10.741± 0.064Extra delay105± 414.7± 0.10.746± 0.064


## 8.3. Reallocation of Lines to Stops

In this last scenario, the lines have been allocated differently to the stops in order to reduce the number of stops needed. Out of the 18 stops, 14 are used in the base case (see the solid squares in Figure11). In the reallocation scenario, a number of these have been merged without introducing conflicts (if the vehicles would arrive and depart according to the planned times). This results in only 9 stops being used (see the dark grey filled squares in Figure 11). The reduction in the number of stops is expected to worsen the situation, but this may not necessarily be the case since the departures per stop are still relatively few. The results for this scenario can be seen in Table 4 in the form of averages of the individual iterations with 95% confidence intervals. The average driving delay is almost the same and so is the average time spent at the terminal and the deviation from the timetable at departure. This indicates that the Norrköping terminal is greatly overdimensioned in relation to the current amount of traffic at the terminal and could operate sufficiently with much fewer stops.Table 4
Results for the reallocation of lines to stops scenario in the form of average values with 95% confidence intervals.
Driving delay (s)Terminal time (min)Lateness (min)Base allocation19.5± 2.412.6± 0.10.741± 0.064Reduced number of stops22.8± 2.512.8± 0.10.773± 0.068


## 8.4. Discussion of the Discrete Event Approach

A number of lessons can be learnt from the modelling process and the case study. The discrete event modelling approach has been well-suited to capture the important events of a terminal and their connections to physical locations. This forms a good basis to construct terminal modules. The modules themselves have proven a useful and flexible way to model a terminal. They form a good basis to add upon as modelling of new terminal sections or behaviour is needed.A disadvantage with the discrete event approach is the non-straightforward way to handle the spatially distributed vehicle interactions that can occur at any point at the terminal. The approach presented here, with cells that are either free or occupied, has been able to capture such interactions with a resolution dependant on the size of the cells. This makes it possible to adjust the resolution to the adaptation and the modelled layout. Driving through the cells of a section was merged into one activity in order to let the number of cells be easily changeable and in that way facilitate modularity (Sections3.4 and 4.2). Since this relies on future states of the system, it results in a need to continuously update the driving times. This process is complex to implement and slows down simulations. Alternative ways to model the driving activity without relying on future states, but still retain the modularity and capture the vehicle interactions, can be of interest to explore further.The case study has shown that the approach is promising for evaluations and comparisons of terminals and scenarios. Validation studies of the model are needed, however, in order to test how accurate it can represent reality. For such a study, a more congested terminal than the Norrköping bus terminal is needed. An important aspect to take into consideration is the often limited amount of empirical data available for terminals and if this is sufficient for calibration and validation of the model. This is investigated in Lindberg et al. [31].


## 9. Conclusions

In this study, a conceptual discrete event simulation model of bus terminals has been formulated and implemented. A modular structure allows for easy adaptations to various terminal layouts, which was demonstrated in a numerical experiment. The model was able to capture blockages and queues by modelling spatially distributed vehicle interactions. This has, to our knowledge, not been included in previous event-based terminal simulation models. A set of performance measures are also formulated, which were used to analyse different aspects of the performance of the case terminal. Driving delay showed the time spent blocked or queuing, terminal time showed the full time through the terminal, including driving times and planned waiting times, and lateness at departure showed the effects on the individual vehicles. The numerical experiment verified that the important events on a terminal could be simulated. It also demonstrated the potential of the modelling approach where various scenarios could be compared and analysed. This could be very useful in planning processes of new terminals or redesign of existing ones. The modelling approach was also analysed where some important lessons learned include the straightforward way to model events and structure these into modules and the challenge to model the vehicle interactions and blockages that can occur at any point at the terminal.Future work includes validation of the model using data for a more congested case terminal as well as case studies of both new terminals and exiting ones. An open question is if data gathered from automatic data sources are enough for model calibration and validation or if manual measurements are needed. The model can also be extended to include more performance measures and types of stops, as well as other dwell-time formulas and probability distributions for vehicle arrivals. There are several ways the model can be further developed, including introducing heterogeneous vehicle movements where vehicles can differ in their speed or distance to a leading vehicle. Of interest is also to study how to plan the allocation of lines to stops at the terminal.



---

*Source: 8862893-2021-01-27.xml*