This repository is the official implementation of Replication study of "Data-Driven Methods for Balancing Fairness and Efficiency in Ride-Pooling"
To install requirements for simulating the taxi environment, training the location embeddings, or training the neural value function:
conda env create -f environment.yml
To install requirements for preprocessing raw New York taxi data, obtaining a graph for (part of) a city using OpenStreetMap, or obtaining corresponding travel time and shortest path files:
conda env create -f preprocessing/environment.yml
The labels that assign each node in the graph to a neighborhood and are required to train/evaluate models and to generate the results are created as follows:
python preprocessing/kmeans.pyTo create the graph (i.e. streetnetwork) that is needed to replicate the original experiments, run respectively for Manhattan and Brooklyn:
python preprocessing/get_graph_Manhattan.py
python preprocessing/get_graph_Brooklyn.pyThe txt files containing the rider request (start, dest, counter) can be obtained by running these commands:
python preprocessing/flow_files_manhattan.py
python preprocessing/flow_files_brooklyn.pyTo generate the csv file with the shortest paths and the travel time of these paths, run this command:
python preprocessing/generate_paths_and_traveltimes.pyTo obtain the initial locations of the taxies, run:
python preprocessing/initializations_taxies.pyThe pretrained location embeddings are obtained by running these commands:
python src/utils/generate_embeddings.pyTo train and evaluate the model(s) in the paper, run these commands:
# driver side fairness objective
python src/main.py training_days 3 testing_days 1 num_agents 200 value_num 10 write_file True print_verbose False lambda 0.67 data_dir "'../data/ny/'"
# income objective
python src/main.py training_days 3 testing_days 1 num_agents 200 value_num 15 write_file True print_verbose False data_dir "'../data/ny/'"
# rider side fairness objective
python src/main.py training_days 2 testing_days 1 num_agents 200 value_num 14 write_file True print_verbose False lambda 1000000000 data_dir "'../data/ny/'"
# requests objective
python src/main.py training_days 3 testing_days 1 num_agents 200 value_num 1 write_file True print_verbose False data_dir "'../data/ny/'"The figures required to support the claims, which were generated here:



