# An Agent-Based Fleet Management Model for
First- and Last-Mile Services

Saumya Bhatnagar  Centre for infrastructure, Sustainable Transportation and
Urban Planning (CiSTUP), Indian Institute of Science (IISc), Bengaluru, India
Tarun Rambha  Centre for infrastructure, Sustainable Transportation and Urban
Planning (CiSTUP), Indian Institute of Science (IISc), Bengaluru, India Civil
Engineering, Indian Institute of Science (IISc), Bengaluru, India
Gitakrishnan Ramadurai  Department of Civil Engineering, Indian Institute of
Technology Madras (IITM), Chennai, India

###### Abstract

With the growth of cars and car-sharing applications, commuters in many
cities, particularly developing countries, are shifting away from public
transport. These shifts have affected two key stakeholders: transit operators
and first- and last-mile (FLM) services. Although most cities continue to
invest heavily in bus and metro projects to make public transit attractive,
ridership in these systems has often failed to reach targeted levels. FLM
service providers also experience lower demand and revenues in the wake of
shifts to other means of transport. Effective FLM options are required to
prevent this phenomenon and make public transport attractive for commuters.
One possible solution is to forge partnerships between public transport and
FLM providers that offer competitive joint mobility options. Such solutions
require prudent allocation of supply and optimised strategies for FLM
operations and ride-sharing. To this end, we build an agent- and event-based
simulation model which captures interactions between passengers and FLM
services using statecharts, vehicle routing models, and other trip matching
rules. An optimisation model for allocating FLM vehicles at different transit
stations is proposed to reduce unserved requests. Using real-world metro
transit demand data from Bengaluru, India, the effectiveness of our approach
in improving FLM connectivity and quantifying the benefits of sharing trips is
demonstrated.

Keywords: first- and last-mile services, agent-based modelling, multimodal
transport, public transit, shared mobility

##  1 Introduction

Despite the growth of mass rapid transit systems, a large segment of commuters
continues to travel by personal vehicles in many metropolitan cities.
According to a study by World Resources Institute and Toyota Mobility
Foundation—STation Access and Mobility Program (STAMP)—one of the significant
challenges commuters face while using transit, such as metro trains, is the
lack of first- and last-mile (FLM) connectivity (STAMP, 2017). Moreover, due
to ride-hailing alternatives such as Uber, DiDi, and Ola, there has been a
significant mode shift from public transportation to personalised door-to-door
services. These shifts have not only resulted in an increase in the usage of
motorised vehicles but have also reduced revenue streams for FLM services and
have led to the under-utilisation of public transport. Therefore, to improve
transit ridership and make it more accessible to users, seamless integration
with efficient FLM services is paramount.

While extensive work has been carried out to evaluate on-demand autonomous
vehicle (AV) services as an alternative to public transit (Winter et al.,
2018; Berrada and Poulhès, 2021), work on FLM connectivity between public
transport and on-demand services is relatively limited. Network- and agent-
based simulation studies by Mueller and Sgouridis (2011), Martinez et al.
(2015), and Fagnant and Kockelman (2018) propose models for personal rapid
transit systems and ride-sharing but do not offer insights on improving the
efficiency of integrated public transport and FLM mobility services. Our
current work aims to bridge this gap.

This research aims to build a multimodal simulation system that addresses
critical planning and operational questions related to FLM connectivity. We
demonstrate the benefits of this simulator using a detailed case study of
metro networks and on-demand taxi-like FLM services such as auto-rickshaws
that are popular in many developing countries, including India. The city of
Bengaluru, for instance, had nearly 220,000 registered auto-rickshaws as of
May 2020 (GoK, 2020). Many private companies such as Cab4You, Tummoc, and
Rapido offer app-based on-demand services in Bengaluru, which can be used for
FLM connectivity (Cab4u, 2021; Jha, 2021). Our proposed approach, however, is
not specific to the type of FLM vehicles and can also be used for cars and
vans. A commercial software AnyLogic is employed with an additional customised
codebase written for the fleet management problem and is tested using real-
world data. The proposed simulation platform has the following features:

  * •

We fuse entry and exit hourly-ridership data from stations of Bengaluru metro,
arrival schedules of trains, OpenStreetMaps (OSM), and population
characteristics to approximate potential origins and destinations of
travellers.

  * •

The simulator uses a combination of agent- and event-based modelling. Event-
based models replicate train and passenger arrivals. On the other hand, agent-
based models help create passenger and FLM agents and simulate their behaviour
using statecharts. Statecharts codify rules that allow the system and the
agents to transition from one state to another.

  * •

The simulator is designed to provide various performance metrics such as lost
demand and utilisation rates at fine spatio-temporal scales that can be used
to find planning and operational strategies that improve the system’s
efficiency.

Our simulation platform addresses FLM connectivity problems by answering two
main questions.

  * •

Planning Problem—How can the FLM fleet be optimally allocated across the
network to improve system performance, such as lost demand?

At the planning stage, we suppose that a fixed number of FLM vehicles, pre-
assigned to a particular station, serve only those customers who board and
deboard at that station and travel from/to nearby locations. Imposing such
operational restrictions on FLM services avoids supply imbalances created due
to the accumulation of FLM vehicles at metro stations with higher footfall and
limits the empty miles travelled. Figuring out how many such vehicles to
assign at each station is of interest to service providers and transit
operators to minimise lost demand and consequently improve ridership and
revenue. We estimate the lost demand based on the number of passengers who
have to wait beyond a certain threshold due to the unavailability of an FLM
vehicle. Additionally, the solution to this stage also helps to set aside
parking spaces. To solve this problem, one could use optimisation engines that
are integrated with simulation software (e.g., OptQuest in AnyLogic). However,
such off-the-shelf tools would take several hours to evaluate the performance
of a single feasible solution, especially when ride-sharing is allowed.
Instead, we exploit the fact that the problem can be decomposed by stations
and propose a simple but effective knapsack-like formulation with an
approximate piecewise linear objective. The computational tractability of the
optimisation formulation was improved using an iterative scheme which
adaptively refines the feasible region. In addition, we also estimate the FLM
service provider’s revenue under different trip- and distance-based pricing
schemes and comment on the parking needs at different stations.

  * •

Operational Problem—How do operational strategies pertaining to sharing FLM
rides impact key performance metrics?

Sharing rides, in theory, can improve vehicle utilisation and the number of
requests served. To quantify these benefits, we also simulate scenarios where
FLM trips are shared and compare the lost demand with the no-sharing case. For
the last-mile setting, FLM vehicles are assumed to pick up passengers from
metro stations and drop them off at their respective destinations. Since
passenger arrivals occur in batches, we formulate this scenario as a
capacitated vehicle routing problem (CVRP) where each FLM vehicle is assumed
to have a capacity of three. On the other hand, sharing of first-mile trips is
more dynamic and is assumed to occur in a First-In-First-Out (FIFO) manner
where a new request is inserted only after the pickup of the current request
and if a detour time threshold is not exceeded.

The rest of the paper is structured as follows. Section 2 summarises related
literature on multimodal transport and FLM connectivity. In Section 3, we
describe the proposed architecture. An agent-based approach is presented with
different modelling constructs for passenger and FLM agents and the
optimisation model for resource allocation. We carry out a thorough evaluation
of various performance indicators to measure the effectiveness of our approach
in Section 4. Section 5 concludes this paper and provides directions for
building on this research.

##  2 Literature Review

Shared transport services can be broadly categorised into Fixed Transit (FT)
and Demand Responsive Transport (DRT). FT uses high-capacity public transport
services that follow fixed schedules and routes. They are, therefore, known to
be cost-effective. However, in many cases, they are less convenient from a
passenger’s standpoint as the FLM legs of the main-haul trip need to be
undertaken by other modes, such as bicycles, walking, or other personal
vehicles. DRT, on the other hand, provides door-to-door services to individual
passengers and has a flexible schedule and route.

The third kind of hybrid transport system that integrates FT with DRT has the
potential to offer advantages of both services (Lucken et al., 2019). In such
systems, the main part of the journey is carried out via a bus or a high-speed
train, while the FLM part of the trip is done using demand-responsive
vehicles. An assessment framework to evaluate the increase in accessibility
when DRT is used in the first/last leg of an FT journey was provided by
Alonso-González et al. (2018). For feeder transit services, Li and
Quadrifoglio (2010) proposed simulation and analytical models that planners
can use to decide when FT and DRT policies should be used. The policy choice
is based on service quality that includes passenger waiting, walking, and ride
time. Edwards and Watkins (2013) developed comparison techniques to determine
scenarios in which demand-responsive feeder services can be utilised
effectively to lower operating costs and increase customer satisfaction.
Analytical methods have also been proposed by Chang and Schonfeld (1991),
Aldaihani et al. (2004), and Goswami et al. (2021) to integrate fixed route
services with flexible demand-responsive services.

Several studies have also been conducted on multimodal transport systems.
Shaheen and Chan (2016) provided a detailed analysis of different shared
mobility modes, including on-demand rides, and their potential impact on
vehicle miles travelled. Kanuri et al. (2019) demonstrated significant time
savings and modal shift from personal vehicles by integrating public transport
with feeder services that improve last-mile connectivity. A study comparing
the competing and complementing nature of taxi trips and public transit was
done by Wang and Ross (2019). Their findings suggest that taxis compete with
transit in areas with good public transportation, whereas a complementary
effect can be observed in peripheral areas with low population density.

A few studies have also explored how emerging mobility modes such as electric
and AVs can enhance multimodal travel. Shen et al. (2018) proposed a system
that integrates AVs and public transport based on the demand characteristics
of Singapore. They use an agent-based model for first-mile service simulation
and evaluate the effectiveness of their approach by varying fleet size and
sharing preferences. Key performance measures in their work include out-of-
vehicle travel time, passenger car unit kilometres, operating cost, and
revenue. Their findings indicate that such a system could be beneficial for
low-demand bus routes, and as the demand increases, the system performance
could worsen. Another related research was conducted by Scheltes and de
Almeida Correia (2017), where they designed a system called automated last-
mile transport, consisting of electric vehicles that cater to last-mile
connectivity of train trips. Their results show a reduction in travel time and
waiting time with strategies such as intermediate charging of electric
vehicles, short-term pre-booking, and relocating empty vehicles. Leffler et
al. (2021) described a simulation framework for autonomous vehicles that
integrates DRT with FT. They proposed a heuristic to rank trip plans based on
cumulative passenger waiting times and the number of requests assigned. The
operational cost and the level of service for passengers were also evaluated.
Another study by Stiglic et al. (2018) showed a reduction in total vehicle
kilometres travelled when ride-sharing services are used in conjunction with
mass transit.

A related problem to FLM routing is that of taxi dispatching and management of
on-demand vehicle fleets. For shared taxi services, Martinez et al. (2015)
proposed an agent-based simulation model where a central dispatching algorithm
matches incoming requests with available taxis to minimise extra travel time
and waiting time, and maximise the revenue of taxis per kilometre travelled.
Mueller and Sgouridis (2011) analysed the impact of different demand profiles
and operational strategies for improving energy consumption, fleet
utilisation, and system costs using a discrete-event personal rapid transport
simulation model. Fagnant and Kockelman (2018) extended agent- and network-
based simulations to include dynamic ride-sharing in shared AVs and studied
its role in reducing average service time and travel costs. Hartleb et al.
(2021) proposed efficient heuristics for a fleet-sizing problem that serves
demand estimated from a macroscopic model.

Grahn et al. (2021) proposed a heuristic-based approach for demand matching
and vehicle routing to cater to on-demand FLM requests. They evaluated their
model using different operational policies and performance measures such as
travel time and reliability. Kumar and Khani (2021) proposed a rolling
horizon-based optimisation method to solve the ride-sharing matching problem
in multimodal network settings. They maximised the number of matches between
riders and drivers and the savings in the total vehicle hours. An FLM
connectivity case study for Austin light rail with shared AVs was proposed by
Huang et al. (2021). A simulation toolkit was developed along with an
implementation of a nested logit model for different mode choices such as
walking, private cars, and walk-and-ride. Other related work includes
simulation-based studies by Costa et al. (2021) and Lau and Susilawati (2021)
that focus on improving FLM connectivity of public transit systems by
integrating them with DRT. A simulation-based decision support tool was also
proposed by Segui-Gasco et al. (2019), which combines demand generation models
and a fleet simulator. The impact of various operational factors, such as
vehicle fleet size, occupancy, and service levels, including passenger wait
time and detour time, were studied.

Many of these agent-based studies do not consider the complete integration of
public transport, particularly the schedules, for improving FLM connectivity.
Moreover, they evaluate various scenarios to answer what-if questions but do
not use optimisation to improve performance measures. In this study, we use
real-world metro transit and census data of Bengaluru city and capture time-
of-day variations in schedules and ridership. Our model also incorporates
stochasticity in the number of passengers arriving at every station (based on
historical data), passenger origins, and destinations. We also formulate an
optimisation model to determine the optimal allocation of vehicles at
different metro stations such that the number of unserved passenger trip
requests is minimised under different ride-sharing scenarios.

##  3 Methodology

###  3.1 Dataset and Network Structure

The data used in this study is from the Bengaluru city metro transit network
that consists of 40 stations on the East-West corridor (Purple Line) and the
North-South corridor (Green Line). The East-West corridor extends from
Baiyappanahalli in the East to Mysore Road terminal in the West, while the
North-South corridor extends from Nagasandra in the North to Yelachenahalli in
the South as shown in Figure 1. The data includes train start times at these
four reference stations and headway that varies by the time of the day. Using
this information and the time taken for a train to travel from one station to
the next, we estimate the train arrival times at every station. During peak
hours, the frequency of metro trains is in the range of 3–6 minutes, while the
off-peak frequency is 15–30 minutes. The average ridership per day is
approximately 726,000 (pre-COVID).

Figure 1: Metro transit network and Voronoi regions. The EBs and the Bengaluru
city boundary are shown in the background.

The transit demand data consists of monthly count of passengers entering and
exiting these 40 stations for different hours of the day, from 5 AM to 11 PM.
We first compute the number of passengers alighting at a station from each
train by dividing the demand data by the number of days in the month. We
assume that 10% of this demand equals the mean value of the last-mile
passenger count. The actual number of last-mile passengers arriving at
different stations is simulated according to a Poisson distribution. For the
first-mile scenario, we use 10% of the hourly count of passengers entering the
metro stations (as obtained from historical data) and generate their departure
times within each hour using a uniform distribution. For passenger origins and
destinations, we use census data of Bengaluru consisting of enumeration blocks
(EBs) and their population. The centroids of these EBs serve as proxies for
locations of first- and last-mile trips, respectively. The probability of
choosing a location (centroid) is assumed to be proportional to the population
of the EB to which it belongs. Currently, there are no centralised FLM
providers, and hence we did not have data on the exact percentage of riders
who might be interested in such services. We also could not simulate different
trip types (e.g., work-based, recreational), which produce different patterns
for FLM demand and their origin/destination locations. In the future, this
kind of data could be sourced from surveys to get more realistic estimates.

Only those EBs in Voronoi regions within a radius of 500 m to 5 km from the
metro stations are considered. The Voronoi polygon of a particular station
contains points closest to it (measured using the haversine distance) compared
to any other station. If the roadway network is sparse, the shortest path
lengths along the network could be used instead of haversine distances while
constructing the Voronoi regions. For distances less than 500 m, we assume
that passengers prefer walking, and for locations farther than 5 km,
passengers are assumed to use other direct modes of travel. FLM vehicles
assigned to a metro station are only assumed to serve locations in the
corresponding Voronoi polygon.

We extract the metro network, i.e., the two transit lines and 40 metro
stations, using the Overpass API of OpenStreetMap, and convert it into GeoJSON
and shapefiles. Figure 1 shows a QGIS snapshot of the Bengaluru metro transit
network and the Voronoi regions along the Purple and Green Line. The
enumeration blocks are shown in grey colour. The outer boundary on the map
indicates the city planning limits. The Nagasandra station, located at the end
of the North-South corridor, can serve more demand from the city’s suburbs,
but the EB data was available only within the city limits.

Figure 2 shows a screenshot of the AnyLogic simulator. The FLM vehicles are
routed using the shortest paths from the OSM server. The travel times on the
road network are assumed constant based on the average speed of vehicles in
Bengaluru and the length of the links.

Figure 2: AnyLogic simulator showing the OSM network and Voronoi regions.
Purple and green lines are the metro routes, and red dots represent centroids
of EBs, which are potential origins/destinations. The circles indicate regions
which are within 500 m.

We currently do not assume time-of-day variations in network travel times. The
waiting time calculation begins when a passenger makes an FLM request until a
vehicle is available for boarding. Walking time to the parking lot is ignored.
However, extending the simulator to capture these features using more
realistic data is straightforward.

###  3.2 Modelling Framework

This section describes the model components of the proposed simulator. We use
a combination of agent-based and discrete-event modelling paradigms. Agent-
based modelling involves multiple decentralised entities (called agents) who
interact with each other within a simulation environment (Crooks and
Heppenstall, 2012). These agents represent real-world entities and can either
be fixed in position (such as metro stations) or exhibit movement (such as
people and vehicles). Agent behaviour is modelled using statecharts where each
state represents a situation during the life cycle of an agent (Greenlaw and
Liang, 2003). When an agent is in a specific state, it can perform a certain
action(s) or wait for an event or timeout. The properties of agents can be
specified using parameters and variables. Any action agents take within a
state can be modelled using functions. A state change occurs at the onset of a
certain event or when a certain condition holds and is modelled using
transitions. Transitions can be triggered by a timeout, rate, message, agent
arrival, or when a certain user-defined condition is true. Communication
between agents is modelled using messages. The message object and destination
agent to whom the message is to be sent must be provided while designing the
state chart. As soon as the destination agent receives the message, a set of
necessary actions can also be specified. Additional details specific to
AnyLogic are provided in Appendix A.

Figure 3 shows an overview of the simulation architecture, including the
different data sources used and the flow of execution for both first- and
last-mile scenarios. Table 1 gives a brief summary of agents used in the
proposed model. All agents reside in Main, which can be viewed as the top-
level agent. For the last-mile scenario, we define the timestamps at which
trains arrive at the reference stations. At each of these timestamps, an event
eventTrainArrival is triggered, which creates an instance of the agent type
MetroTrain. This event can occur at an absolute model time or a specific date
and time, as in our case. Next, an event eventPassengerArrival gets triggered
at each subsequent metro station at the specified arrival time. For the first-
mile case, the eventPassengerArrival is triggered randomly on an hourly basis.

Figure 3: Process Overview

We now describe the Vehicle and LastMilePassenger agents in detail, along with
their statecharts. The statechart for first-mile passengers is modelled
similarly.

Table 1: Model agents Agent |  Description
---|---
Main |  Top-level agent where other agents reside
Vehicle |  Contains information on vehicle fleet
such as origin station and Voronoi region
LastMilePassengers |  Contains properties of last-mile passengers
such as their last-mile origin station and destination
FirstMilePassengers |  Contains properties of first-mile passengers
such as their origin and first-mile destination station
MetroStation |  Stores metro station information including latitude and longitude
MetroTrain |  Contains code to trigger events eventTrainArrival
and eventPassengerArrival
PassengerDestination |  Stores latitude and longitude of last-mile passenger destinations
FirstMileOrigin |  Stores latitude and longitude of first-mile passenger origins
LastMileTrip |  Contains last-mile trip information such as
passenger’s last-mile origin station and destination
FirstMileTrip |  Contains first-mile trip information such as
passenger’s origin and first-mile destination station

Vehicle agent: Figure 4 describes the statechart of a Vehicle agent.
Initially, all FLM vehicle agents are positioned at the metro stations. We
first describe the last-mile scenario. A state transition from AtMetroStation
state to MovingToDestination happens when the FLM vehicle agent receives a
message of the type LastMileTrip that stores information on the last-mile
passenger, including their origin station and destination. After receiving
this information, the FLM vehicle agent moves to the corresponding destination
along the OSM road network, and the vehicle is in the MovingToDestination
state. A transition to the Offboarding state occurs by the transition type
agent_arrival, which signifies that the FLM vehicle agent has reached the
passenger’s last-mile destination. Following a timeout, the FLM vehicle agent
moves back to the station in the MovingToStation state. State transition from
MovingToStation to AtMetroStation occurs via agent_arrival transition type.

For the first-mile scenario, state transitions take place from AtMetroStation
state to MovingToOrigin when a FLM vehicle receives a message of the type
FirstMileTrip. On arriving at the origin of a first-mile passenger, the FLM
vehicle goes into the Pickup state. Once the first-mile passenger has been
picked up, the FLM vehicle agent transitions to the MovingToStationFull state
and then back to the AtMetroStation state.

Figure 4: FLM vehicle statechart for the no-sharing scenario

Passenger agent: Last-mile passengers alighting at metro stations are modelled
as LastMilePassenger agents. Their behaviour is captured using the passenger
statechart shown in Figure 5. After alighting from the train, each last-mile
passenger requests an FLM vehicle in the GenerateVehicleRequest state, and the
associated timestamp is recorded. We also maintain a station-wise FIFO queue
of passengers containing those who request an FLM service. A decision branch
checks the availability of FLM vehicles at the metro station.

If a vehicle is available, the passenger enters the TripRequestAccepted state.
In this state, the passenger is removed from the request queue, and the event
eventTrip gets triggered. eventTrip creates an instance of a LastMileTrip
agent, assigns vehicles to passengers in a FIFO manner, and sends a message
containing the passenger origin station and destination information to the
Vehicle agent. The Vehicle agent receives this message through its
connections, and the message is then forwarded to its statechart. The
passenger then goes into the Travelling state until their destination is
reached.

If an FLM vehicle is unavailable, the passenger goes into the
WaitForAssignment state. If the total waiting time exceeds a threshold
parameter maxWaitingTime, it is marked as lost demand, and the passenger is
removed from the request queue. Otherwise, they retry requesting a vehicle and
go to the GenerateVehicleRequest state again, and the process is repeated.

Figure 5: Last-mile passenger statechart

###  3.3 Simulating Shared Rides

The scenario described thus far where rides are not shared is considered the
base case. Additionally, we model and simulate situations where passenger
requests can be pooled together, and an FLM vehicle can serve multiple
passengers in a single trip. The following subsections describe these
scenarios in detail.

####  3.3.1 Last-mile Shareability Case

For the last-mile shareability problem, we pool passengers offboarding at a
station. Since multiple passengers arrive at the station simultaneously, we
have a sufficient lead time for optimisation and can batch-process their
requests. To determine which passengers are to be served in a single trip and
the order in which they should be dropped off, we formulate a Capacitated
Vehicle Routing Problem (CVRP) (Toth and Vigo, 2002) and solve it using
Google’s OR-Tools (OR-Tools, 2022). The capacity of each FLM vehicle is set to
three. The left panel of Figure 6 shows the FLM vehicle statechart used. After
a last-mile passenger has been offboarded, the control goes from the
Offboarding state to the decision branch can_serve_another_LM_request. Based
on the CVRP solution, if there are more passengers to be offboarded, the FLM
vehicle goes to the MovingToDestination state of the next passenger. Else, the
vehicle goes to the MovingToStation state. In this scenario, we disallow
sharing of first-mile trips. In other words, FLM vehicles making a first-mile
trip start from the station, pick up a first-mile passenger, and drop them off
back at the station.

(a) Last-mile shareability (b) First-mile shareability

Figure 6: FLM vehicle statechart for the shareability scenario

####  3.3.2 First-mile Shareability Case

In the first-mile shareability scenario, we allow multiple first-mile
passengers to be served by the same FLM vehicle in a single trip, while last-
mile requests are served one at a time. The right panel of Figure 6 shows the
FLM vehicle statechart. After a first-mile passenger is picked up by the FLM
vehicle in the state Pickup, the control goes to a decision branch
can_serve_another_FM_request. Here, we check the first-mile request queue and
pick the passenger whose waiting time is within a threshold. We also ensure
that the detour time incurred by the passengers currently on board due to
picking up subsequent passengers does not exceed a pre-defined parameter
called maxDetourTime threshold. If such a request exists, the FLM vehicle goes
to the MovingToOrigin state; else it goes to the MovingToStationFull state. In
our experiments, an FLM vehicle is assumed to serve up to three first-mile
passengers in a single trip.

####  3.3.3 Joint FLM Shareability Case

The joint FLM shareability case combines the scenarios mentioned in
Subsections 3.3.1 and 3.3.2. The FLM vehicle statechart shown in Figure 7
describes this case. After all last-mile requests are served, the FLM vehicle
goes to the LMRequestsServed state. Instead of heading back to the station
empty, we introduce a decision branch can_serve_FM_request that checks for
first-mile requests that can be served, provided the waiting time is within
the threshold. If such a request exists, the vehicle goes to the
MovingToOrigin state; else it heads to the MovingToStation state.

Figure 7: Joint FLM shareability vehicle statechart

###  3.4 Integer Linear Programming Model

We develop an optimisation model for the no-sharing case using the Custom
Experiment functionality in AnyLogic and implement it using its Java API and
the OptQuest optimisation engine. Custom Experiment offers flexibility for
setting up model parameters, seed value, solver run time, and simulation run
properties such as start and stop time. During a simulation-based optimisation
experiment, multiple simulation runs are carried out by varying the values of
decision variables while respecting the specified constraints. For
reproducible model runs, it is necessary to reset the seed to a fixed value at
the beginning of every iteration.

The objective in our model was to minimise the total expected lost demand
$l_{s}$ as shown in Equation (1). Here, $S$ denotes the set of metro stations,
and $s$ represents the index of a station. The decision variables are the
number of FLM vehicles assigned to each station, represented by $x_{s}$. We
assume a fixed fleet size, and hence the total number of FLM vehicles cannot
exceed $a^{total}$ as shown in (2). Equation (3) specifies the upper and lower
bounds on the number of vehicles positioned at individual stations, denoted by
$a_{s}^{min}$ and $a_{s}^{max}$, respectively. Such bounds could be imposed
for reasons associated with parking and equity.

$\displaystyle\min\quad$ $\displaystyle\sum_{s\in S}l_{s}(x_{s})$ (1) s.t.
$\displaystyle\sum_{s\in S}{x}_{s}\leq a^{total}$ (2) $\displaystyle
a_{s}^{min}\leq{x}_{s}\leq a_{s}^{max}$ $\displaystyle\forall\,\,s\in S$ (3)
$\displaystyle x_{s}\in\mathbb{Z}_{+}$ $\displaystyle\forall\,\,s\in S$ (4)

We observed that the time taken by OptQuest to complete a single iteration
increases substantially in the last-mile and joint shareability case due to
function calls to OR-Tools for solving the CVRP. However, note that the
objective function can be decomposed by stations, and only Constraint (2)
binds the decision variables. It is expected that as the number of FLM
vehicles assigned to a station increases, the lost demand will decrease. Thus,
this relationship is likely to be decreasing (and in most cases convex, with
diminishing returns for every extra vehicle).

Figure 8: Approximation of the lost demand curve for a metro station $s$

At each station, we interpolate the expected lost demand using simulation runs
performed at uniformly discretised supply values (or break points) as shown in
Figure 8. With such lost demand curves for each station as problem input, we
propose a piecewise linear cost approximation for the objective and formulate
it as an Integer Linear Program (ILP), which is solved using CPLEX. The ILP
model uses auxiliary variables and has an objective that is separable with
respect to the supply at stations.

Let the piecewise linear function of station $s$ be described using function
values $l_{s}(a_{is})$, where $a_{is}$ is the $i^{th}$ break point at which
the simulation is performed. Let the number of pieces in the lost demand curve
for station $s$ be $k_{s}-1$. Define $\lambda_{is}$ as the weight placed on
the break point $a_{is}$. Let $y_{is}$ be one if the optimal solution for
station $s$ lies in piece $i$.

$\displaystyle\min$ $\displaystyle\,\,\sum_{s\in
S}\sum_{i=1}^{k_{s}}\lambda_{is}l_{is}(a_{is})$ (5) s.t.
$\displaystyle\,\,\sum_{s\in S}\sum_{i=1}^{k_{s}}\lambda_{is}a_{is}\leq
a^{total}$ (6) $\displaystyle\,\,\sum_{i=1}^{k_{s}-1}y_{is}=1$
$\displaystyle\forall s\in S$ (7)
$\displaystyle\,\,\sum_{i=1}^{k_{s}}\lambda_{i}=1$ $\displaystyle\forall s\in
S$ (8) $\displaystyle\,\,\lambda_{1s}\leq y_{1s}$ $\displaystyle\forall s\in
S$ (9) $\displaystyle\,\,\lambda_{is}\leq y_{i-1,s}+y_{is}$
$\displaystyle\forall s\in S,i=2,\ldots,k_{s}-1$ (10)
$\displaystyle\,\,\lambda_{k_{s},s}\leq y_{k_{s}-1,s}$ $\displaystyle\forall
s\in S$ (11) $\displaystyle\,\,\lambda_{is}\geq 0$ $\displaystyle\forall s\in
S,i=1,\ldots,k_{s}$ (12) $\displaystyle\,\,y_{is}\in\\{0,1\\}$
$\displaystyle\forall s\in S,i=1,\ldots,k_{s}-1$ (13)

The number of FLM vehicles assigned to a station $s$ is represented as
$\sum_{i=1}^{k_{s}}\lambda_{is}a_{is}$ and hence Constraint (6) ensures that
the total supply is not exceeded. The optimal supply for a station $s$ must
lie in one of the pieces, which is enforced by (7). The actual supply value is
determined by a convex combination of the $\lambda$s using (8). If the $y$
variable is 1, only the $\lambda$s associated with its endpoints must take
non-negative values. This constraint is enforced by (9)–(11). Finally, (12)
and (13) impose bounds and integrality constraints. We do not require
constraints to model (3) in this formulation because they are implicitly set
by $a_{1s}$ and $a_{k_{s},s}$.

Figure 9: Adaptive refinement of the feasible region

The proposed ILP can be solved reasonably quickly using off-the-shelf solvers.
However, the major bottleneck is in estimating the lost demand at the break
points using simulation. This problem can be addressed by starting with a
coarse set of break points and iteratively generating new ones. To illustrate
this idea, consider the example in Figure 9. Suppose that for a station $s$,
the lost demand was estimated at two break points $a_{1s}$ and $a_{6s}$. We
approximate the lost demand curve as shown by the thick line segments in the
left panel. Suppose the resulting optimal ILP solution lies in the interval
$[a_{3s},a_{4s}]$. Additional simulations are then run to estimate the lost
demand at the endpoints $a_{3s}$ and $a_{4s}$, and the lost demand curve is
updated with more pieces as shown in the right panel. If both endpoints of the
optimal solution are already explored, we stop. If not, we perform new
simulations at new break points, update lost demand curves, and repeat. If the
ILP solution coincides with the break point, say $a_{3s}$, we explore its
neighbours $a_{2s}$ and $a_{4s}$. This adaptive procedure was found to reduce
the number of break points and simulations by nearly 50%.

##  4 Experiments and Results

One day of Bengaluru metro operations was simulated using train schedules,
which included trips starting between 5 AM–11 PM and passenger boarding and
alighting information from January 2018. Based on data on ride-sharing trips
in Bengaluru, the threshold for maximum waiting time and detour time was set
to 7 minutes (Philip, 2020). If trip requests are not served within this time,
they are counted as lost demand. FLM vehicles are assumed to maintain a
uniform speed of 21.2 kmph, the average speed of motorised vehicles in
Bengaluru (AutoCarReport, 2019). The total number of FLM vehicles $a_{total}$
is fixed at 1200, and the lower and upper bounds at each station $s$,
$a_{s}^{min}$ and $a_{s}^{max}$, are set to 5 and 60, respectively. The Java
code from AnyLogic and the CVRP Python functions can be found at
github.com/transnetlab/agent-based-fleet-management for reference.

###  4.1 Lost Demand

We benchmark our proposed method for fleet allocation by comparing it with two
baseline strategies and the OptQuest solver.

Baseline Strategies: Two simple strategies that could be used by an operator
in the absence of an optimisation model were simulated. In the first strategy
(proportional to demand), we try to achieve a supply allocation proportional
to the total first- and last-mile demand. However, since the number of
vehicles allowed at each station is capped at 60, vehicles in excess of this
value are again redistributed among the remaining stations, proportional to
their corresponding demand and the process is repeated until all 1200 vehicles
are assigned. In the second case (equal supply), we simply allocate an equal
number of FLM vehicles (i.e., 1200/40 = 30) at each metro station. The results
for all four shareability scenarios are shown in the first two columns of
Table 2. The values in brackets show percentage benefit compared with the
proportional to demand strategy. Assigning an equal number of vehicles across
stations resulted in higher lost demand in all shareability scenarios.

OptQuest: The optimal fleet allocation problem was also solved using
AnyLogic’s in-built OptQuest solver with a time budget of 24 hours. The solver
was initialised with 30 vehicles at each station. For the no sharing case, a
total of 1235 iterations were simulated, but the best-found solution’s
objective was 17,854, which was 19.4% worse compared to the proportional to
demand case. The quality of solutions discovered for the shareability
scenarios was also poorer compared with the proportional to demand case,
mainly because each of these iterations runs slower when sharing is involved.
Hence, only a limited portion of the feasible region is explored.

Table 2: Comparison of objective values for no-sharing versus shareability scenarios Scenario | Proportional to demand |  Equal supply | OptQuest |  ILP Model
---|---|---|---|---
No sharing | 14,957 |  21,785 (-45.7%) | 17,854 (-19.4%) |  14,379 (3.9%)
Last-mile shareability | 11,539 |  17,265 (-49.6%) | 17,109 (-48.3%) |  10,903 (5.5%)
First-mile shareability | 9,597 |  16,783 (-74.9%) | 16,375 (-70.6%) |  8,821 (8.1%)
Joint FLM shareability | 3,655 |  7,738 (-111.7%) | 7779 (-112.8%) |  2,714 (25.7%)

ILP Model: As described in Section 3.4, we discretised the feasible region and
ran simulations by varying the number of vehicles at each station from 5 to 60
in increments of 5 and estimated the expected lost demand. For the adaptive
piecewise approximation method, only 247 out of 480 simulations (40 stations
with 12 break points at each station) were needed to find the optimum supply
values. Figure 10 compares the lost demand for different shareability
scenarios for one of the metro stations – Indiranagar. The joint FLM
shareability case results in significantly lower lost demand for all supply
values. Similar trends were observed at other stations. The average number of
simulated first- and last-mile passengers in this scenario was 36,664 and
36,994, respectively.

These curves were used as input to the ILP formulation (5)–(13), which was
solved using CPLEX. The optimal decision variables, i.e., the number of FLM
vehicles at every station, were passed to the AnyLogic simulation, the results
of which are shown in the last column of Table 2. The CPLEX runtimes in all
four shareability scenarios were less than a minute. The estimated lost demand
for the baseline strategies and ILP model are average values from five
simulation runs.

Figure 10: Lost demand comparison for a metro station – Indiranagar – under
different shareability scenarios  Figure 11: Spatio-temporal distribution of
lost demand

Overall, the ILP model solution consistently resulted in lower lost demand and
outperformed the other allocation methods for all shareability scenarios.
Specifically, for the joint FLM shareability case, improvements of 65% and 26%
were observed over the baseline strategies, showcasing the potential of our
work in improving FLM connectivity. The rest of this section analyses the
solutions from the proposed ILP method for the joint FLM shareability scenario
in greater detail.

The optimal number of vehicles at each station and the lost demand percentage,
calculated with respect to the total demand on an hourly and station-wise
basis, are shown in Figure 11. The bar plots on the top and right indicate the
cumulative lost demand percentages for each hour and each station,
respectively. Lost demand is highest in the time window 7 PM–8 PM, followed by
9 AM–10 AM. As expected, the off-peak morning hours 5 AM–8 AM record the
lowest lost demand percentage. For most metro stations, the percentage of lost
demand is less than 5%. Three out of four ends of the metro lines are assigned
the maximum number of FLM vehicles allowed because of their large Voronoi
regions. Among them, Baiyyappanahalli (label #17), one of the endpoints on the
East-West line, has the highest lost demand (see Figure 12, which shows the
locations of the lost demand). As mentioned earlier, Nagasandra station in the
North also has a sizeable Voronoi region, but the complete EB data was
unavailable. The lost demand at the other two terminal stations – Mysore Road
and Yelachenahalli – is relatively much lower because the passenger demand at
these stations is nearly half that at Baiyyappanahalli. The overall difference
between the number of last- and first-mile lost demand across all stations for
this instance was found to be 413.

Figure 12: Locations of lost demand for a single simulation run. Last-mile
lost demand locations are shown in orange, while blue dots denote first-mile
lost demand locations.

Table 3 shows the top five metro stations with the highest lost demand, their
LM and FM demand, the number of FLM vehicles in the optimal solution, and LM
and FM lost demand. Their rank based on the total lost demand is also
indicated in Figure 12. Despite having a significant share of lost demand, the
stations Majestic and Dr. BR Ambedkar Station (labels # 8 and #10) are not
assigned more FLM vehicles because the marginal effect of adding an extra
vehicle at these stations was found to be very low. The number of unserved
first-mile requests in the case of Baiyyappanahalli is higher because the
detour times are longer compared with other stations with a high passenger
volume, such as Majestic.

Table 3: Top five stations with highest lost demand S.No. | Station | LM demand | FM demand | # Vehicles | LM lost demand | FM lost demand
---|---|---|---|---|---|---
1 | Baiyyappanahalli | 2888 | 2750 | 60 | 724 | 1025
2 | Majestic | 3153 | 3083 | 40 | 350 | 2
3 | Dr. BR Ambedkar Stn | 897 | 881 | 30 | 182 | 2
4 | Sir MV Central Clg | 1173 | 1133 | 30 | 48 | 0
5 | Mahatma Gandhi Rd | 1642 | 1587 | 55 | 35 | 1

To test the sensitivity of the optimal solution with respect to the total
number of vehicles, we ran a few additional scenarios. Specifically, we set
the number of vehicles to 800, 1200, and 1600. The percentage of lost demand
in these instances was 10.7%, 3.7%, and 3.5%, respectively.

###  4.2 Vehicle Utilisation

We also compared utilisation statistics of FLM vehicles in the system. The
line chart associated with the secondary axis in Figure 13 shows the average
unit utilisation of vehicles assigned to different stations. Unit utilisation
values indicate the percentage of time the vehicle was busy. The highest (82%)
and lowest (44%) utilisation percentages were found to correspond to stations
Baiyyappanahalli (label #17) and Mahakavi Kuvempu Road (label #28),
respectively, and are correlated with the supply and demand at these stations.
Knowing utilisation percentages can help reserve downtime of the vehicle fleet
if needed (e.g., for maintenance, refuelling, and recharging/battery swapping
in the case of an electric fleet).

Vehicle utilisation statistics are also a measure of the number of idle
vehicles that require parking at stations. Figure 13 shows a box plot in which
the number of vehicles parked at different stations estimated at a one-minute
frequency makes up the data points. As expected, stations with high
utilisation, such as Baiyyappanahalli, Majestic, and Yeshwantpura, have low
median values. These percentile measures can be used to design appropriate
parking infrastructure.

Figure 13: Box plot showing the number of vehicles parked at different
stations. The line chart shows the percentage vehicle utilisation.

Parking requirements are not usually uniform and mirror the demand
distribution. Figure 14 shows temporal variations in the number of idle FLM
vehicles for two stations – Indiranagar and Majestic. The parking requirements
are lowest during the morning (9 AM–11 AM) and evening peak hours (6 PM–8 PM),
but the off-peak requirements can be significantly different across stations,
as seen from the figure.

(a) Indiranagar station (b) Majestic station

Figure 14: Time series plots showing the number of vehicles parked at the
metro stations at different hours of the day.

###  4.3 Shareability

Figure 15 shows the percentage of trips that involve transporting a single
passenger and ride-sharing with two or three passengers on board. The
superimposed line plot indicates the total number of trips. Recall that in the
joint shareability model (see Figure 7), FLM vehicles first serve last-mile
demand and switch to picking up first-mile passengers (if available and if
waiting/detour time thresholds are met). The FLM vehicle can serve multiple
passengers on the last-mile leg but may pick up only one passenger on its way
back. Hence, classifying a trip based on the number of passengers served can
lead to some ambiguity. We, therefore, do not define trips as segments that
start and end at the metro station but count them separately for the first-
and last-mile legs. In other words, trips are passenger-serving segments
between instances where the FLM vehicles are empty. The average number of
trips serving one, two, and three passengers across all stations was found to
be 777, 175, and 215, respectively.

Figure 15: Percentage of trips with 1, 2, and 3 passengers. Single-passenger,
2-sharing, and 3-sharing trips are represented by blue, yellow, and green
bars, respectively. The line plot shows the average number of trips for each
station.

FLM vehicles at stations such as Baiyyappanahalli, Majestic, and Indiranagar
make a greater fraction of shared trips than the others. These stations have a
high demand for boarding and alighting passengers, making it easier to pool
rides. On the other hand, stations such as Peenya, Peenya Industry, and
Goraguntepalya witness a lower fraction of shared trips because of their
elongated Voronoi regions, which makes it difficult to pool rides. Sharing
rides leads to lower lost demand, as demonstrated in Table 2. In addition,
they also result in fewer vehicle kilometres travelled. Serving the passenger
demand met in the joint FLM scenario using only single rides would have
resulted in 406,434 vehicle km but allowing sharing reduces this to 295,036
vehicle km, a 27% decrease, which decreases both congestion and emissions.

###  4.4 Pricing Models

The simulation framework proposed in this paper can also help analyse
different pricing models, such as distance- and trip-based pricing schemes. In
the following discussion, we compare revenue, assuming that the demand is
captive and insensitive to the fare. The numbers used in this section are
representative of auto-rickshaw operations in India. All calculations are
estimated on a per-day basis.

Distance-based pricing model: To calculate the revenues, we first add up the
fares paid by the set of passengers served at station $i$, $P(i)$. Passenger
$p$ is assumed to be charged an amount $D_{ip}$ that depends on the direct
distance between their origin/destination and the metro station. Metered auto-
rickshaw fares in Bengaluru are of threshold type with a fixed base rate
$\alpha$ up to 2 km and a distance-based price $\beta$ for subsequent
kilometres travelled. Thus, the revenue from a passenger $p$ can be expressed
as $R_{ip}=\alpha+\beta\max(D_{ip}-2,0)$, where $\alpha$ and $\beta$ were set
to 30 and 15, respectively (IndianExpress, 2021).

Let $D_{iv}$ be the distance travelled during an entire day by a vehicle $v$
assigned to station $i$. The operating cost is defined as
$D_{iv}(\phi/\mu)+C_{f}$, where $\mu$ denotes vehicle mileage and $\phi$ is
fuel price, set to 25 km per litre and 100 per litre, respectively. Operators
are also assumed to incur a fixed cost $C_{f}$ set to 102 per vehicle per day
(GoM, 2022), which includes depreciation and maintenance. For simplicity,
$C_{f}$ is kept constant but may, in practice, depend on vehicle utilisation
and age. Thus, the overall profit for FLM vehicles at station $i$ can be
expressed as $P_{i}=\sum_{p\in
P(i)}R_{ip}-\sum_{v=1}^{x_{i}}\left(D_{iv}(\phi/\mu)+C_{f}\right)$.

Figure 16: Revenues under distance- and trip-based pricing.

The top panel in Figure 16 shows the profit per vehicle at different metro
stations under this pricing scheme. The average profit across all vehicles was
found to be 1623\. The line plot corresponding to the secondary axis shows the
average distance travelled by the FLM vehicles. Compared to the daily earnings
of 800–1200 reported in previous studies on auto-rickshaw drivers in Bengaluru
city (Ramachander et al., 2015), we observe that serving metro passengers
through a centralised service provider can yield higher profits. The estimated
profits per vehicle at metro stations Baiyyappanahalli and Majestic are the
highest as expected due to high passenger demand, vehicle utilisation, and
degree of ride-sharing. Among all stations, Majestic has the smallest Voronoi
region and, consequently, shorter average distances. However, since the
pricing scheme has a base fare (independent of distance) for trips shorter
than 2 km, the overall profits are considerably higher. On the other hand,
Peenya Industry has the lowest profit per vehicle despite serving passengers
with longer distances to the metro station. This result is possibly because
Peenya Industry has the least passenger demand among all stations and a high
share of single-passenger trips (see Figure15).

Trip-based pricing model: We also estimated the profits from a trip-based
pricing model where passengers are charged a flat fee of $R_{ip}=$ 30,
irrespective of the distance they travel. The operating costs are assumed to
be the same as before. As seen from the bottom panel of Figure 16, the profit
values are lower compared to the distance-based model. The average profit per
vehicle was found to be 766, which is less than half of that in the distance-
based case. At a fixed price of 44, the trip-based profits per vehicle become
nearly equal to the estimates from the distance-based pricing model. Two metro
stations – Jalahalli and Peenya Industry – have negative revenues due to a
lower number of trips (see the line plot on the secondary axis). Setting a
higher fixed fare for FLM vehicles at such stations could resolve this issue.

###  4.5 Policy Implications

Based on the above analysis, the following list summarises a few possible
policy implications.

  * •

The marginal benefit of adding FLM vehicles to a station drops beyond a
threshold. This threshold is different for each station and depends on the
size and demand of the region it serves. Hence, service operators must
determine an optimal number based on the trade-off between operating costs and
net revenue.

  * •

Since vehicle utilisation rates and profits vary significantly across
stations, a policy of rotating vehicle assignments to stations may be required
to provide equitable earnings to all drivers.

  * •

There are temporal variations in lost demand, with peak hours witnessing three
to four-times higher percentage of lost demand than off-peak hours.
Considering the importance of public transit in reducing congestion,
especially during peak periods, it is imperative to manage peak-period lost
demand more efficiently. Ensuring maximum vehicle availability, augmenting the
fleet size, and operating larger vehicles could reduce the demand lost during
peak hours.

##  5 Conclusions

The first- and last-mile parts of a trip are often inconvenient to commuters,
which in turn results in low utilisation of public transport. One could
develop a multimodal simulation for FLM connectivity to address this problem
and test various improvement strategies before implementing such systems in
the field. These simulations involve modelling the behaviour and interaction
of agents such as passengers and FLM vehicles, arrival of metro trains,
movement of vehicles on the road network, and pooling multiple passenger
requests when shareability is allowed.

We proposed a combination of agent- and event-based modelling and simulation
approach to study a planning and an operational problem. At a planning level,
we tried to improve the resource allocation of FLM services at different metro
stations. We modelled the FLM vehicles and passengers as agents and described
their behaviour using statecharts. Vehicles are assumed to be initially parked
at metro stations, and routing is done using deterministic shortest paths. We
developed an optimisation model that minimises the number of unserved trip
requests (lost demand) by decomposing the problem by stations and formulating
a knapsack-like problem with an approximate piecewise linear objective. We
applied our model to the Bengaluru city metro transit network and carried out
a day’s simulation using real-world train schedules and passenger demand data.

For the planning problem, our proposed method could allocate resources more
efficiently, leading to a 26% improvement in the objective compared to the
best benchmark strategy. At an operational level, we tested different
shareability scenarios and were able to quantify the benefits of sharing
rides. For instance, an integrated FLM shareability scenario could reduce the
lost demand by nearly 81% and the vehicle km travelled by 27%. Several other
key performance indicators, such as percentage of lost demands on hourly and
station-wise basis and fleet utilisation were explored, and suggestions for
setting FLM fares were also made.

While this research focuses on supply aspects and provides a framework for
managing FLM fleet, many extensions that relax some assumptions can be
conceived. First, the quality of FLM demand estimates and their
origins/destinations can be improved with data on land use and employment
characteristics; and trip types and their distribution during peak and off-
peak periods. Second, modelling the effects of pricing and waiting times on
multimodal demand is critical. In the context of pricing, many cities are
exploring new forms of payment mechanisms, such as bundle pricing and revenue
sharing, which can make multimodal journeys attractive. In addition,
passengers could be given discounts for sharing rides; setting these fares at
profitable levels is worthy of study. Capturing heterogeneity in waiting time
depending on the alternate options available to passengers in different
geographical areas of a city can also improve model fidelity. Third, while
zonal restrictions for FLM vehicles alleviate the need for rebalancing, a
certain degree of optimality is lost when there are opportunities to share
trips by passengers close to the boundaries. Understanding these trade-offs
without making the simulation unmanageable is another promising direction for
future research. Fourth, incorporating time-of-day changes in traffic and
congestion effects can improve the estimates of ride-sharing benefits. Since
our results indicate significant differences in vehicle utilisation across the
day, one could also explore dynamic supply allocation strategies to optimise
expenditure. Finally, anticipating the electrification of shared vehicle
fleets, adjusting FLM operations to accommodate recharging or battery swapping
can broaden the applicability of this decision support simulator.

## Acknowledgements

This study is supported by IMPacting Research, INnovation and Technology
(IMPRINT), Department of Science and Technology (DST), India (Project no.
IMP/2018/001850). The authors thank Bangalore Metro Rail Corporation Limited
(BMRCL) for sharing their data. Assistance from Ms. Deepa L on collating
census data is also appreciated.

This preprint has not undergone peer review or any post-submission
improvements or corrections. The Version of Record of this article is
published in Transportation, and is available online at
https://doi.org/10.1007/s11116-022-10363-z.

## References

  * Aldaihani et al. (2004) Aldaihani, M. M., L. Quadrifoglio, M. M. Dessouky, and R. Hall (2004).  Network design for a grid hybrid transit service.  Transportation Research Part A: Policy and Practice 38(7), 511–530.
  * Alonso-González et al. (2018) Alonso-González, M. J., T. Liu, O. Cats, N. Van Oort, and S. Hoogendoorn (2018).  The potential of demand-responsive transport as a complement to public transport: An assessment framework and an empirical evaluation.  Transportation Research Record 2672(8), 879–889.
  * AutoCarReport (2019) AutoCarReport (2019).  Retrieved from https://www.autocarpro.in/news-national/ola-clocks-highest-average-speed-of-248kph-in-hyderabad-45053. Accessed April 23, 2021.
  * Berrada and Poulhès (2021) Berrada, J. and A. Poulhès (2021).  Economic and socioeconomic assessment of replacing conventional public transit with demand responsive transit services in low-to-medium density areas.  Transportation Research Part A: Policy and Practice 150, 317–334.
  * Borshchev and Filippov (2004) Borshchev, A. and A. Filippov (2004).  From system dynamics and discrete event to practical agent based modeling: reasons, techniques, tools.  In Proceedings of the 22nd International Conference of the System Dynamics Society, Volume 22, pp. 25–29.
  * Cab4u (2021) Cab4u (2021).  Retrieved from https://www.cmacgroup.com/technology/first-and-last-mile. Accessed September 6, 2021.
  * Chang and Schonfeld (1991) Chang, S. K. and P. M. Schonfeld (1991).  Integration of fixed-and flexible-route bus systems.  Transportation Research Record 1308, 51–57.
  * Costa et al. (2021) Costa, P. C., C. B. Cunha, and R. O. Arbex (2021).  A simulation-optimization model for analyzing a demand responsive transit system for last-mile transportation: A case study in São Paulo, Brazil.  Case Studies on Transport Policy 9(4), 1707–1714.
  * Crooks and Heppenstall (2012) Crooks, A. T. and A. J. Heppenstall (2012).  Introduction to Agent-Based Modelling, pp. 85–105.  Dordrecht: Springer Netherlands.
  * Edwards and Watkins (2013) Edwards, D. and K. Watkins (2013).  Comparing fixed-route and demand-responsive feeder transit systems in real-world settings.  Transportation Research Record 2352(1), 128–135.
  * Fagnant and Kockelman (2018) Fagnant, D. J. and K. M. Kockelman (2018).  Dynamic ride-sharing and fleet sizing for a system of shared autonomous vehicles in Austin, Texas.  Transportation 45(1), 143–158.
  * GoK (2020) GoK (2020).  Retrieved from https://transport.karnataka.gov.in/storage/pdf-files/May%20Blr%202020.pdf. Accessed June 11, 2021.
  * GoM (2022) GoM (2022).  Retrieved from https://transport.maharashtra.gov.in/Site/Upload/GR/Part-3.pdf. Accessed May 03, 2022.
  * Goswami et al. (2021) Goswami, S., P. Tallapragada, and T. Rambha (2021).  Optimal supply control for shared mobility with logit mode-choice dynamics.  In 2021 IEEE International Intelligent Transportation Systems Conference (ITSC), pp. 3509–3514.
  * Grahn et al. (2021) Grahn, R., S. Qian, and C. Hendrickson (2021).  Improving the performance of first- and last-mile mobility services through transit coordination, real-time demand prediction, advanced reservations, and trip prioritization.  Transportation Research Part C: Emerging Technologies 133, 103430.
  * Greenlaw and Liang (2003) Greenlaw, R. and Y. D. Liang (2003).  Object-oriented programming.  In H. Bidgoli (Ed.), Encyclopedia of Information Systems, pp. 347–361. New York: Elsevier.
  * Hartleb et al. (2021) Hartleb, J., M. Friedrich, and E. Richter (2021).  Vehicle scheduling for on-demand vehicle fleets in macroscopic travel demand models.  Transportation 49(4), 1133–1155.
  * Huang et al. (2021) Huang, Y., K. M. Kockelman, V. Garikapati, L. Zhu, and S. Young (2021).  Use of shared automated vehicles for first-mile last-mile service: micro-simulation of rail-transit connections in Austin, Texas.  Transportation Research Record 2675(2), 135–149.
  * IndianExpress (2021) IndianExpress (2021).  Retrieved from https://indianexpress.com/article/explained/explained-bengaluru-auto-fare-hike-and-how-it-will-impact-commuters-7651047/. Accessed February 25, 2022.
  * Jha (2021) Jha, S. N. (2021).  Retrieved from https://www.financialexpress.com/express-mobility/tummoc-partners-with-rapido-to-offer-first-and-last-mile-connectivity/2380162/. Accessed December 1, 2021.
  * Kanuri et al. (2019) Kanuri, C., K. Venkat, S. Maiti, and P. Mulukutla (2019).  Leveraging innovation for last-mile connectivity to mass transit.  Transportation Research Procedia 41, 655–669.
  * Kumar and Khani (2021) Kumar, P. and A. Khani (2021).  An algorithm for integrating peer-to-peer ridesharing and schedule-based transit system for first mile/last mile access.  Transportation Research Part C: Emerging Technologies 122, 102891.
  * Lau and Susilawati (2021) Lau, S. T. and S. Susilawati (2021).  Shared autonomous vehicles implementation for the first and last-mile services.  Transportation Research Interdisciplinary Perspectives 11, 100440.
  * Leffler et al. (2021) Leffler, D., W. Burghout, E. Jenelius, and O. Cats (2021).  Simulation of fixed versus on-demand station-based feeder operations.  Transportation Research Part C: Emerging Technologies 132, 103401.
  * Li and Quadrifoglio (2010) Li, X. and L. Quadrifoglio (2010).  Feeder transit services: Choosing between fixed and demand responsive policy.  Transportation Research Part C: Emerging Technologies 18(5), 770–780.
  * Lucken et al. (2019) Lucken, E., K. T. Frick, and S. A. Shaheen (2019).  “Three Ps in a MOD:” role for mobility on demand (MOD) public-private partnerships in public transit provision.  Research in Transportation Business & Management 32, 100433\.
  * Martinez et al. (2015) Martinez, L. M., G. H. Correia, and J. M. Viegas (2015).  An agent-based simulation model to assess the impacts of introducing a shared-taxi system: an application to Lisbon (Portugal).  Journal of Advanced Transportation 49(3), 475–495.
  * Mueller and Sgouridis (2011) Mueller, K. and S. P. Sgouridis (2011).  Simulation-based analysis of personal rapid transit systems: service and energy performance assessment of the Masdar City PRT case.  Journal of Advanced Transportation 45(4), 252–270.
  * OR-Tools (2022) OR-Tools (2022).  Retrieved from https://developers.google.com/optimization. Accessed November 26, 2021.
  * Philip (2020) Philip, C. M. (2020).  Retrieved from https://timesofindia.indiatimes.com/city/bengaluru/at-7-minutes-wait-for-an-uber-cab-is-longest-in-bengaluru/articleshow/74449621.cms. Accessed August 23, 2021.
  * Ramachander et al. (2015) Ramachander, A., C. Bagrecha, and S. Talur (2015).  Financial well-being of auto drivers in Bangalore–a study conducted under research promotion scheme of AICTE.  International Journal of Latest Technology in Engineering, Management And Applied Science.
  * Scheltes and de Almeida Correia (2017) Scheltes, A. and G. H. de Almeida Correia (2017).  Exploring the use of automated vehicles as last mile connection of train trips through an agent-based simulation model: An application to Delft, Netherlands.  International Journal of Transportation Science and Technology 6(1), 28–41.
  * Segui-Gasco et al. (2019) Segui-Gasco, P., H. Ballis, V. Parisi, D. G. Kelsall, R. J. North, and D. Busquets (2019).  Simulating a rich ride-share mobility service using agent-based models.  Transportation 46(6), 2041–2062.
  * Shaheen and Chan (2016) Shaheen, S. and N. Chan (2016).  Mobility and the sharing economy: Potential to facilitate the first-and last-mile public transit connections.  Built Environment 42(4), 573–588.
  * Shen et al. (2018) Shen, Y., H. Zhang, and J. Zhao (2018).  Integrating shared autonomous vehicle in public transportation system: A supply-side simulation of the first-mile service in Singapore.  Transportation Research Part A: Policy and Practice 113, 125–136.
  * STAMP (2017) STAMP (2017).  Retreived from https://wricitiesindia.org/STAMP/content/bengaluru-2017. Accessed January 07, 2022.
  * Stiglic et al. (2018) Stiglic, M., N. Agatz, M. Savelsbergh, and M. Gradisar (2018).  Enhancing urban mobility: Integrating ride-sharing and public transit.  Computers & Operations Research 90, 12–21.
  * Toth and Vigo (2002) Toth, P. and D. Vigo (2002).  Models, relaxations and exact approaches for the capacitated vehicle routing problem.  Discrete Applied Mathematics 123(1-3), 487–512.
  * Wang and Ross (2019) Wang, F. and C. L. Ross (2019).  New potential for multimodal connection: Exploring the relationship between taxi and transit in New York City (NYC).  Transportation 46(3), 1051–1072.
  * Winter et al. (2018) Winter, K., O. Cats, G. Correia, and B. van Arem (2018).  Performance analysis and fleet requirements of automated demand-responsive transport systems as an urban public transport service.  International Journal of Transportation Science and Technology 7(2), 151–167.

##  Appendix A AnyLogic Specifics

For the purpose of reproducibility, this subsection provides a few
implementation details that are specific to AnyLogic. These details are not
critical for simulation platforms built using other tools, and hence the
reader can skip this material without any loss of continuity.

The discrete-event model that triggers the occurrence of certain time-ordered
processes (Borshchev and Filippov, 2004) is executed in AnyLogic using its
process modelling library blocks. Individual events can also have a timestamp
associated with them and can be scheduled in advance. To create vehicle agents
for every metro station, we use the resource pool functionality of AnyLogic’s
process modelling library. The number of resource units in each pool can be
specified along with other properties such as vehicle speed and initial
location. An advantage of using resource pools is that it captures utilisation
statistics, such as the time for which FLM vehicles are idle or busy during
the simulation. These can be computed using a set of process modelling library
blocks as shown in Figure 17. When an instance trip (agent type LastMileTrip
or FirstMileTrip) is generated, the function ProcessTrip.take(trip) is called.
ProcessTrip is an Enter block at which the FLM vehicle agents are inserted
into the process modelling library blocks. TakeVehicle is a Seize block that
captures units of the FLM vehicle resource pool. The control then goes to the
Travelling block, which is a Delay block, until the stopDelay() function is
called after an FLM vehicle serves the passenger trip request and reaches the
station. After this step, the control flow goes to the ReleaseVehicle block
that releases the seized FLM vehicle unit. The agents are then taken out of
this process flow by the Sink block.

Figure 17: Process modelling library blocks

For simulating first-mile passenger arrivals, the dynamic event functionality
of AnyLogic was used (since it allows the creation of multiple concurrent
instances, each of which is independent) and initialised with the specified
parameters (such as the name of the metro station where passengers arrive).
For the shareability scenarios, communication of inputs and outputs between
the CVRP codes and AnyLogic is established through additional custom code
using PypeLine (a Python connector library for AnyLogic).