This script simulates one or multiple drivers of ride-hailing on a working day.
The simulation works on strong and super-optimistic assumptions.
-
Driver(s) only work in a district of central Tehran, where most companies and businesses are located.
-
There is an infinite demand in this district.
-
Driver(s) only accept trips inside this district.
-
Passengers are at most 1 KM away from the driver and if traffic is supper-heavy and the passenger is too far than 10 minutes, the driver cancels the trip.
After running the script, the driver(s) initial location will be randomly chosen in a district in the center of Tehran, and they start the work day immediately. A passenger's location will be chosen uniformly randomly from a 1 km circle around the driver, and the destination of the passenger will be chosen uniformly from the district in central Tehran, which is more than 2 Km away from the passenger. There is only a 30 minutes rest time, and each driver is chosen randomly between 4-6 hours after starting time.
The price of trips collect from two main rides-hailing companies in Iran, (Snapp & Tapsi), and real-time traffic data will obtain from Neshan Company.
Indicate the number of drivers in main.py
by NUMBER_OF_DRIVERS
variable.
The request's header of Snapp/Tapsi API and the API key of Neshan should define as environment variables. Snapp's authentication could be obtained from Snapp's webapp and Tapsi's authentication could be obtained their webapp.
Run python main.py
The trajectory log file of each driver could be found in src/log
directory.
-
summary.py
, generates a summary of the log file of a driver. -
summary_for_all_logs.sh
runsummary.py
for all logs in the log directory.
how to use: in log directory, run
./summary_for_all_logs.sh
This project is licensed under the BSD license.
More info at LICENSE
.