A rideshare planner that gives an optimal plan for multiple drivers and passengers using Z3 Solver
Project description
Z3 Rideshare Planner
Introduction
This Python package provides a planner that takes in the names and addresses of multiple passengers and drivers, and the address of a destination, and gives a plan which minimizes the time for pickup process.
This package utilizes [[https://www.microsoft.com/en-us/research/project/z3-3/|Microsoft Z3 Solver]] and [[https://developers.google.com/maps|Google Map API]].
Google Map API Key
To use this package, you need to have a Google Map API Key. You can get one for free at https://console.cloud.google.com/google/maps-apis/credentials.
Dependencies
- googlemaps
- matplotlib
- datetime
- folium
- z3-solver
- polyline
- numpy
Usage
Class: Planner
-
Planner.__init__(self, API_KEY)Takes in a Google API Key, returns aPlannerinstance. -
Planner.configure(self, passenger_name_addr, driver_name_addr, destination, n_seats, must_together=[])Takes in requirements and conditions.passenger_name_addr: List of 2-tuples, where the first element is the passenger name, and the second element is their addressdriver_name_addr: List of 2-tuples, where the first element is the driver name, and the second element is their addressdestination: The final destination that everyone goes ton_seats: Specifies the capacity (driver included) of each car. If the input is anint, then it's for all drivers; If the input is a list ofint, then the list elements each represents the capacity of one car, according to the order of ``driver_name_addr```must_together: List of lists, where each element list contains a group of passengers and (at most one) driver that must be in the same car
-
Planner.solve(self)If a plan is found, prints "Plan found!". Otherwise, raises ValueError. -
Planner.print_plan(self)If a plan has been found, print the plan in the string format. -
visualize(self, output_mode='html', relative_path=None, colormap='Set1')If a plan has been found, visualize it with interactive features.output_mode: Ifoutput_mode='html', save the visualization as an html file atrelative_path; Ifoutput_mode='display', returns afolium.Figureobjectcolormap: Astrkey ofmatplotlib.colormaps, serves as the color scheme of the markers on the map
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters