Now Reading
Project: An Agent-Based Model to Simulate Ridesharing Services (Like Lyft & Uber)

The ridesharing economy is experiencing rapid growth and progress. Companies such as Uber and Lyft are continuing to grow while providing their platform as an organizing medium for ridesharing, increasing consumer utility as well as employing thousands in part-time positions.

However, many challenges remain in the modeling of and understanding of rides-haring services, many of which are not currently under investigation by the academic community.
In this paper an agent-based model is developed to simulate a ridesharing service in the Washington D.C. metropolitan region. The model forms the basis for future experiments to determine the levels of utility to both riders and drivers of the service. In this paper a description of the model is provided, as well as a description of a typical run.

In experimenting with the efficacy of the model, we investigate the relative utility of drivers for a 24-hour period under two scenarios: random movement (information asymmetry) and Voronoi movement (information symmetry). We find that random movement prior to rider pickup outperforms Voronoi movement for a stationary run, while Voronoi movement performed at comparable levels of driver utility for a scenario run.

Introduction

Ridesharing services such as Uber and Lyft have been experiencing explosive growth driven by rider demand and a number of other factors in industry (Anderson, 2014). One challenge for both ridesharing service companies as well as for their driver contractors is how to maximize driver acceptance of new customers while ensuring drivers gain maximum utility from rides given.
Research in this arena is also experiencing a surge with a number of journal publications (Shaheen, 2016) (Shaheen et. al, 2016)(Nielsen, 2015)(Zhang,2015) and others that explore multidimensional challenges and opportunities posed by the widespread adoption of ridesharing services.
This project aims to investigate the conditions under which drivers can gain maximum returns (utility) on their time while ensuring that a maximum number of potential riders reach their destinations. The project uses an agent-based modeling framework to answer this question. An ABM is more suitable for this type of analysis because of its inherent ability to create many autonomous agents following some behavioral/rule-set, and to simulate this behavior for various initial conditions and parameters.
The model proposed in this project would focus on simulating drivers and riders in the Washington, DC metro region and would attempt to simulate the movement of drivers under differing social and environmental conditions.
From a knowledge perspective, the aim of this model is to gain insight into whether drivers, riders and ridesharing services benefit more or less from information asymmetry or symmetry.

Information Asymmetry vs. Information Symmetry

We define information asymmetry in this context as lack of information regarding the location of other drivers. This is currently the method by which all ridesharing services manage their platform.
This model will investigate how drivers would benefit from having all information about peer drivers available in real time and whether that additional information would cause new behavior to emerge, and would generally maximize driver utility. And, though there are a number of differing behaviors that can be a direct result of drivers having access to information about their peers, we will assume that there is only one behavior which would result from that information, and will extend this model in future iterations with more behaviors. We call this assumed behavior Voronoi behavior. This behavior is based on the concept of a Voronoi polygon (Voronoi, 1908) and it essentially amounts to driver agents identifying nearby driver agents and moving away from them so as to increase the potential of picking up a new customer.
We also seek to answer, from the rider’s perspective, would driver’s awareness of each other increase the likelihood of call acceptance or whether increased awareness would create a more competitive market where more drivers seek to answer fewer calls based on localized demand.
Additionally, we hope to understand the role of a spatial configuration on agent utility, and the role of running spatial models only in situ versus utilizing stylized facts and qualitative observations to build realistic scenarios fit for testing model assumptions. Figure 1. shows the graphical representation of the model and subsequent sections will discuss model design particulars.

Fig. 1. This model was implemented in Netlogo 5.3 and utilized open access data from the Washington DC government website.

Model & Methods

The model was implemented in Netlogo 5.3 and utilized the GIS extension built into the platform. The model’s spatial configuration was based on a road network downloaded from the Washington, D.C. government Open Data project website, which included highly accurate, editable shape files and GIS data. The data included feature labels for roads and intersections. These features are used in the instantiation and initialization of agents, and for certain agent behaviors to be dis-cussed at later sections of this paper.
At the current iteration of the model we chose not to include additional layers of geographic information for simplicity, but in future iteration the Open Data project can be advantageous in increasing the efficacy of our model by adding more spatial configuration data.
The road network was imported to Netlogo and an automated spatial equivalent configuration was assigned. All roads were labeled internally by a variable to help identify spatial cells that contained a road, versus spatial cells that did not. This would later be an important step when designing the movement choices of agents in the simulation.
The model contains two agents, drivers and riders. Drivers can move across the model space, but only on cells that contain a road, while riders do not move, but can only be initialized on roads, specifically intersections.
The movement of the drivers in the model was set such that it is direct movement—that is—although the drivers must always remain on roads, we assume that following traffic routes would provide a negligible difference for our research goals. In future iterations of the model traffic and road direction movement could be taken into account to create a greater sense of realism. For now, driver agents move on roads in a direct fashion to their destinations.

Agent Behaviors

Before we discuss the specifics of agents used in our model. we define the terminology used in the model. We define driver agents as those agents who are intending to pick up a rider. A rider agent is an agent who has been instantiated and can be picked up by a driver. Once a driver agent picks up a rider agent, the rider agent becomes a passenger. Passengers are not agents and form no interactions with their environment. In other words, riders who become passengers simply become an attribute of the driver agents, releasing with them certain data points which are then used by the driver agents post pick-up.
This terminology will be used throughout the model description.

Driver Agents

Driver agents are instantiated in the initial setup of the model according to a user input parameter and a random distribution set to uniform properties. Spatially, the driver agents are initialized at random road intersections of the geo-spatial model, and according to a randomization test score that allows for a greater randomized spatial distribution of agent objects.
Driver agents are also instantiated throughout the model run according to the aforementioned user set parameter. Those agents are also instantiated at road intersections and according to a user set parameter.

Driver agents move from one spatial cell to another by first checking whether a road exists in the cell ahead. If it does, then an agent may move to that cell. If no road exists in that cell then agents are instructed to rotate a random number of degrees between 0 and 360, and repeat the process.


For driver agents who are carrying a passenger, the process is the same. However, the randomized degree value is set to be between -45 and +45 degrees if a road is not found directly in the heading of the driver agent. By doing so, we en-sure that drivers are constantly moving in the direction of their destination, but are still able to overcome the majority of obstacles in their way, such as the lack of availability of roads to travel on. This method does have grounds in reality in that drivers who may not necessarily know precisely how to optimize their routes, may in general, pick a random route that they know to be in the general direction of their destination. In future iterations of the model a more advanced path finding algorithm could be adopted.
Driver agents were assigned a number of attributes at instantiation and some are assigned as the model is run situationally.

Attributes include energy level, cash-on-hand, time driven, current driver destination (if carrying a passenger), riders who are nearby, current passenger id, time the current passenger has been on a trip, how many riders the driver has picked up, and how many passengers the driver has dropped off as well as a Boolean passenger variable . All these attributes carry great importance depending on the phase the drive-pickup-dropoff-drive cycle of the driver agents. However, a deeper explanation of the attributes and their relevancy is appropriate at this time.
We assign a level of energy to every driver agent set to be a random number following a normal distribution between a 4 and 8 hour range translated into model time units (which is set to be at 1 minute per time unit). The underlying assumption is that the majority of drivers will only be able to drive, regardless of their level of success, for a period determined by time availability and physical and/or mental fatigue. This is an appropriate assumption. Time driven is a variable that counts the amount of time driven by each driver and is used to display and calculate the model’s summary statistics.
Cash on-hand is the variable attribute that stores the accumulation of fares each driver agent has gained, as well as the variable in which money is deducted (vehicle and transportation costs) for drivers who are not carrying active passengers. In other words, it is the driver agents’ utility at any given time period.
Pick-up count and drop-off count are variables that store the total number of riders successfully picked up from their initialized location and successfully dropped off at their destination. The Boolean passenger variable shows whether the current driver is currently seeking a rider or already has a passenger and is used in a number of important model mechanics. Passenger id is a variable that stores the id of the rider currently within the driver agent’s vehicle. It is equivalent to the driver asking for the rider’s name prior to pick up, and is used in the verification process of the model to ensure that drivers are successfully picking up in-tended riders.
Variables for nearby riders and nearby drivers were also implemented as at-tributes of the driver agents. The first being the number, and id of any nearby riders waiting for pickup. This attribute is used to evaluate whether there are any riders nearby available for pickup. The second is whether there are any nearby driver agents, and is used in the Voronoi movement mechanism. The details of the Voronoi movement mechanism will be discussed at a subsequent section.

Rider Agents

Rider agents are instantiated at the initialization of the model at random locations (intersections). Rider agents do not move but await their intended pick up in the same location. This is in line with expected behaviors of ridesharing service customers. Rider agents are instantiated utilizing a user set input and a random variable to allow for some stochasticity in the model runs. Spatially, and in a similar fashion to driver agents, they are placed randomly across the available intersection of the model’s geographic configuration, and only on road cells.
Rider agents are instantiated throughout the model’s runs but at a rate per time unit user set parameter, unlike driver agents who typically remain in the model’s space until they decide to leave (randomly) or because they have exhausted their energy variable and are replaced stochastically up to a maximum user set parameter. In other words, while the number of driver agents is set by a maximum capacity global (exogenous) variable, the number of rider agents is set to be a rate of arrival following a probability distribution.

For simplicity, we chose the arrival rate probability distribution to be normal, though in subsequent iterations of the model testing of other probability distribution types, such an exponential arrival function, would be necessary.
Rider agents possess two attributes for this iteration of the IAMWARM model. The first is the rider destination, which is a randomly assigned destination converted to the spatial coordinate equivalent. This destination is assigned at the moment of instantiation of the rider agents. The second is the wait time variable which is a count of how long a rider has been waiting for pickup. A user designated input allows for varying the waiting time of rider agents. For typical model runs we assigned this variable to 20 minutes. Once a rider agent reaches their maxi-mum waiting time assigned they leave the simulation. This is a proxy behavior for this rider attempting to find alternative modes of transportation to their destination.

Model Mechanics

The model relies on user inputs for the number of drivers (capacity), the number of riders arriving per given time unit, the maximum waiting time for rider agents, whether or not to use random movement while attempting to find a rider or whether to maximize distance from any other drivers in the area of assigned vision (Voronoi movement). Based on these inputs and the parameters of the model a typical model run behaves as follows.


Rider and driver agents are instantiated on a highly accurate road map of Washington, D.C. at random intersections in accordance with the input parameters assigned by model users. Once the model is run, rider agents are spawned while others, according to the user input, will leave the simulation. The same is applied to driver agents.
Driver agents move according to one of the predetermined movement methods (random movement or Voronoi movement) until they are within a user inputted proximity setting of a rider agent. During this time driver agents lose energy at a rate of 0.75 per time unit and lose cash at a rate of $0.1 per time unit.
Once a driver agent is within a designated vicinity of the rider agent, a pick-up occurs, and the rider is converted to a passenger. A transfer of the destination of the rider occurs from rider agent to the driver agent at this time. Once a driver agent has successfully executed a pickup, the agent can no longer make any additional pickups, and it is at this point that the driver agent begins to accumulate cash, set at a rate of $2.00 + 0.60/time unit. Calibration of the model was conducted to reach a dollar amount that could be seen as probable through qualitative observations of distance and time of real world trips versus the model’s spatial geometry.
Driver agents then proceed in a direct path to the coordinates of the transferred destination while earning cash and losing energy. Once they reach their proximate destination, a drop-off is executed, their passenger carry variable is reduced from 1 to 0, and a successful trip is recorded as being now completed. All relevant at-tribute and model-level variables are updated with this new information. The driver then continues to move searching for new riders and repeats the process.

Rider agents who are not picked up within their waiting time period limit find alternative transportation and are no longer in the simulation. While driver agents who are not carrying a passenger could “give up” and leave the simulation, or they could run out of energy and leave the simulation due to fatigue.
Typical runs are for a 24 hour period, but a model user can run the model in-definitely.

Scenarios

Much of the model can be run in a stationary mode—that is—it can be run in a form of equilibrium where driver agents and rider agents arrive at predetermined rates resulting in a constantly changing but variably fixed dynamic. This is interesting for general runs, verification of model mechanics and quality, as well as to gain a general understanding of the ridesharing process. However, anecdotal evidence and earlier studies have shown that the rates by which riders and drivers arrive, interact, and exit the process are variable and somewhat subservient to the city in which the ridesharing service operates, the time of year, month, day, and time of day. Additionally, rider and driver rates and activity are also affected by current events, traffic, roadworks, weather patterns and other exogenous factors. Therefore, though running the model in situ yields important insights, it is important to run experimentation in some scenario for comparative reasons and for a closer approximation of real-world dynamics.
Therefore, based on anecdotal evidence gained from the author’s registering with a ridesharing service and gaining access to the driver’s application for monitoring reasons, we develop a scenario which is not entirely hypothetical in order to test the model’s effectiveness under varying conditions. In future iterations of this model we intend to develop scenarios grounded in real data collected and to develop a number of them to test different scenarios under different conditions without reliance on qualitative observations.
For this model iteration we conducted a test of one scenario—the “Saturday” scenario. Below I provide a summary of the scenario, and reasoning where appropriate for selection of scenario inputs and parameters.

Results & Discussion

We present typical model results for the 4 possible variations of our test runs. Figure 2. shows a plot of our 4 representative runs in as the model is run with total profit at any given time unit on the y-axis and time on the x-axis. We see no real difference in terms of total profit between either of our stationary run model runs for random movement and Voronoi movement (yellow and grey).
For the scenario runs we find divergence in the profitability between random movement choices and Voronoi movement choices for the driver agents. Emergence of this result is unexpected.

Fig.2. This figure shows four typical runs utilizing both the stationary and scenario runs where driver agents use random movement and Voronoi movement prior to rider agent pickup. X-axis is time in minutes of a 24-hour run cycle, while the y-axis represents total profitability over time. X-axis increment in 60 minute increments for direct comparison with model scenario design in an earlier section.

Specifically, we find that Voronoi movement for driver agents provides greater utility for drivers when varying rates are executed on the model’s inputs i.e. when a scenario is utilized. Where, for stationary model runs neither movement method prior to rider pickup provided any visible change in driver agent utility.
Consequently, our observations and analysis of the model run takes a focus on the scenario runs, and more precisely on the moments of divergence of the scenario run random movement model run when compared to the Voronoi movement scenario model run. The first instance of divergence occurs at around 420 minutes into the model run or as we describe it in our scenario design, hour 12PM which we describe as lunch time and mark by a constant driver agent capacity of 50 at 11AM (360 minutes into model run) and a decrease at 1 pm from 50 driver agents to 45 driver agents. Also during this period the number of rider agent rate of entry begins at 20 riders per time unit at 11AM, decreased to 10 riders per time unit at 12PM, and then rises drastically to 25 riders per time unit at 1 PM. Hence, we can describe this pattern as a sudden increase in demand, fol-lowed by a sudden decrease and then a sudden increase once again, while driver agent capacity remained roughly the same.
This was the first moment of divergence in our model and it is repeated in much the same way at time 600, 720, and to a lesser extent at other times. Interestingly this emergent pattern allows us to provide a possible explanation for the increased driver utility in scenario environment when it is clear that no real difference exists within the stationary run of the model.
One possible and highly dependable explanation is that the sudden increase and decrease in demand in conjunction with a steady capacity (supply) or a slightly decreasing capacity provides a sudden spatial vacuum in the model’s geographic configuration which is best enclosed by agents who are actively trying to move away from each other – a Voronoi movement pattern. This increase in spatial spread of the driver agents allows for an increased probability of executing a pickup. They key to reproducing this pattern is that it must be sudden.
We see similar processes in supply chain management theory that describe the bullwhip effect as that of being a powerful reaction at the end of a supply chain occurring from a small change in its starting point sources. If the change is sudden the effect is compounded.
This emergent behavior does not seem to occur in the stationary runs of the model because at constantly random and stable entry rate for both agent types there is never a sudden vacuum to be capitalized and the spread of agents ap-proximated random agent spread even with Voronoi movement is enabled.

Next Step

In this paper I described the development of an agent-based model for ridesharing services in the Washington, DC area. The model simulates riders and drivers through simple interactions on an accurate data-driven geo-spatial configuration. This model forms the basis for a number of experiments and model extensions that could yield greater insights into the ridesharing economy as it develops, expands, and evolves.

I also showed the importance of running experiments utilizing agent-based models not only in the form of stationary runs, but in the form of scenarios designed to create unpredictable effects that can and in our case did, yield greater insights which otherwise would not have been discovered. Those scenarios should be grounded in data-driven facts and observations, but at minimum should be based on experience and general observations, especially in the absence of concrete data, which in our case, being that this model is based on private sector services, had not yet been made publicly available.

More importantly we showed that driver agent to driver agent interactions, forming a symmetrical information environment where agents know where other agents are can provide increased utility for drivers, and consequently for the ridesharing service and riders as well, in certain situations.

There are many pathways that this model can be extended for future work. Primarily the most interesting extension would be to add more complex behaviors in agent-to-agent interactions and measuring the results. However, there are improvements to be made in the spatial configuration of the model itself. For example inclusion of spatial demographics to enrich probability distribution calculations, adding road direction and traffic patterns, as well as utilizing more detailed geographic datasets would all bring this model to the forefront of ridesharing service modeling and prediction.

References

Anderson, D. N. (2014). Not just a taxi: For-profit ridesharing, driver strategies, and VMT. Transportation, 41(5), 1099–1117. doi:10.1007/s11116-014-9531-8
Bash, E. (2015). Dynamic Ridesharing: An Exploration of the Potential for Re-duction in Vehicle Miles Traveled. PhD Proposal.
Crooks, A. T., & Wise, S. (2013). GIS and agent-based models for humanitarian assistance. Computers, Environment and Urban Systems, 41, 100–111. doi:10.1016/j.compenvurbsys.2013.05.003
Furuhata, M., Dessouky, M., Ord????ez, F., Brunet, M. E., Wang, X., & Koenig, S. (2013). Ridesharing: The state-of-the-art and future directions. Transporta-tion Research Part B: Methodological, 57, 28–46. doi:10.1016/j.trb.2013.08.012
Martin, C. J. (2016). The sharing economy: A pathway to sustainability or a nightmarish form of neoliberal capitalism? Ecological Economics, 121, 149–159. doi:10.1016/j.ecolecon.2015.11.027
Nielsen, J. R., Hovmøller, H., Blyth, P. L., & Sovacool, B. K. (2015). Of “white crows” and “cash savers:” A qualitative study of travel behavior and perceptions of ridesharing in Denmark. Transportation Research Part A: Poli-cy and Practice, 78, 113–123. doi:10.1016/j.tra.2015.04.033
Nourinejad, M., & Roorda, M. J. (2015). Agent based model for dynamic rides-haring. Transportation Research Part C: Emerging Technologies, 1, 117–132. doi:10.1016/j.trc.2015.07.016
Rayle, L., Dai, D., Chan, N., Cervero, R., & Shaheen, S. (2016). Just a better taxi? A survey-based comparison of taxis, transit, and ridesourcing services in San Francisco. Transport Policy, 45, 168–178. doi:10.1016/j.tranpol.2015.10.004
Rayle, L., Shaheen, S., Chan, N., Dai, D., & Cervero, R. (2014). App-Based, On-Demand Ride Services: Comparing Taxi and Ridesourcing Trips and User Characteristics in San Francisco. University of California Transportation Center, 94720(August), 1–20. doi:10.1007/s13398-014-0173-7.2
Shaheen, S. A. (2016). Shared mobility innovations and the sharing economy. Transport Policy, 1–2. doi:10.1016/j.tranpol.2016.01.008
Shaheen, S. A., Chan, N. D., & Gaynor, T. (2016). Casual carpooling in the San Francisco Bay Area: Understanding user characteristics, behaviors, and motivations. Transport Policy, 1–9. doi:10.1016/j.tranpol.2016.01.003
Voronoi, G. (1908). Nouvelles applications des paramètres continus à la théorie des formes quadratiques. Premier mémoire. Sur quelques propriétés des formes quadratiques positives parfaites. Journal Für Die Reine Und An-gewandte Mathematik (Crelle’s Journal), 1908(133). doi:10.1515/crll.1908.133.97
Zhang, W., Guhathakurta, S., Fang, J., & Zhang, G. (2015). Exploring the impact of shared autonomous vehicles on urban parking demand: An agent-based simulation approach. Sustainable Cities and Society, 19, 34–45. doi:10.1016/j.scs.2015.07.006
Zolnik, E. J. (2015). The effect of gasoline prices on ridesharing. Journal of Transport Geography, 47, 47–58. doi:10.1016/j.jtrangeo.2015.07.009

About The Author
Joseph A.E. Shaheen
Computational Social Scientist. Former Consultant. I fought ISIS/ISIL/Daesh in my own way. Livin' life in Washington, DC
1 Comments
Leave a response
  • JIE ZHU
    May 28, 2017 at 5:52 pm

    hello,

    This ABS model is great. I am really interested. Is it possible for you to share with me your Netlogo codes?
    Great Thanks for your reply

    Regards,
    Jie

Leave a Response