# Z3 Rideshare Planner
Github: https://github.com/MinghanWu039/z3_rideshare_planner/tree/main
PyPI: https://pypi.org/project/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 a ```Planner``` instance.
- ```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 address
- ```driver_name_addr```: List of 2-tuples, where the first element is the driver name, and the second element is their address
- ```destination```: The final destination that everyone goes to
- ```n_seats```: Specifies the capacity (driver included) of each car. If the input is an ```int```, then it's for all drivers; If the input is a list of ```int```, 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.
- ```Planner.visualize_plan(self, output_mode='html', relative_path=None, colormap='Set1')```
If a plan has been found, visualize it with interactive features.
- ```output_mode```: If ```output_mode='html'```, save the visualization as an html file at ```relative_path```; If ```output_mode='display'```, returns a ```folium.Figure``` object
- ```colormap```: A ```str``` key of ```matplotlib.colormaps```, serves as the color scheme of the markers on the map
Raw data
{
"_id": null,
"home_page": "https://github.com/MinghanWu039/z3_rideshare_planner",
"name": "z3-rideshare-planner",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Travis Wu",
"author_email": "traviswu0524@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/7e/b2/bde7b68aa1a2f022a0d768498253b63e9dfedd52a9340a9f6d00b28773b0/z3_rideshare_planner-0.4.6.tar.gz",
"platform": null,
"description": "# Z3 Rideshare Planner\n\nGithub: https://github.com/MinghanWu039/z3_rideshare_planner/tree/main\n\nPyPI: https://pypi.org/project/z3-rideshare-planner/\n\n## Introduction\n\nThis 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.\n\nThis package utilizes [[https://www.microsoft.com/en-us/research/project/z3-3/|Microsoft Z3 Solver]] and [[https://developers.google.com/maps|Google Map API]].\n\n## Google Map API Key\n\nTo 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. \n\n## Dependencies\n\n- googlemaps\n- matplotlib\n- datetime\n- folium\n- z3-solver\n- polyline\n- numpy\n\n## Usage\n\n### Class: ```Planner```\n\n- ```Planner.__init__(self, API_KEY)```\nTakes in a Google API Key, returns a ```Planner``` instance.\n\n- ```Planner.configure(self, passenger_name_addr, driver_name_addr, destination, n_seats, must_together=[])```\nTakes in requirements and conditions.\n\n - ```passenger_name_addr```: List of 2-tuples, where the first element is the passenger name, and the second element is their address\n - ```driver_name_addr```: List of 2-tuples, where the first element is the driver name, and the second element is their address\n - ```destination```: The final destination that everyone goes to\n - ```n_seats```: Specifies the capacity (driver included) of each car. If the input is an ```int```, then it's for all drivers; If the input is a list of ```int```, then the list elements each represents the capacity of one car, according to the order of ``driver_name_addr```\n - ```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\n\n- ```Planner.solve(self)```\nIf a plan is found, prints \"Plan found!\". Otherwise, raises ValueError.\n\n- ```Planner.print_plan(self)```\nIf a plan has been found, print the plan in the string format.\n\n- ```Planner.visualize_plan(self, output_mode='html', relative_path=None, colormap='Set1')```\nIf a plan has been found, visualize it with interactive features.\n\n - ```output_mode```: If ```output_mode='html'```, save the visualization as an html file at ```relative_path```; If ```output_mode='display'```, returns a ```folium.Figure``` object\n - ```colormap```: A ```str``` key of ```matplotlib.colormaps```, serves as the color scheme of the markers on the map\n",
"bugtrack_url": null,
"license": null,
"summary": "A rideshare planner that gives an optimal plan for multiple drivers and passengers using Z3 Solver",
"version": "0.4.6",
"project_urls": {
"Homepage": "https://github.com/MinghanWu039/z3_rideshare_planner"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f72d8a3a1a05bec3d1949b69fe85394fcc5058a1fbee5c21449b5bcc567a0798",
"md5": "29055f8e09403dab0a230f491f76b73a",
"sha256": "36b3c2e5e377f4478d2a8dfec9839cb62ce82ce884c3fbca9013942fb02ef9ca"
},
"downloads": -1,
"filename": "z3_rideshare_planner-0.4.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "29055f8e09403dab0a230f491f76b73a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9774,
"upload_time": "2024-09-13T07:34:00",
"upload_time_iso_8601": "2024-09-13T07:34:00.846659Z",
"url": "https://files.pythonhosted.org/packages/f7/2d/8a3a1a05bec3d1949b69fe85394fcc5058a1fbee5c21449b5bcc567a0798/z3_rideshare_planner-0.4.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7eb2bde7b68aa1a2f022a0d768498253b63e9dfedd52a9340a9f6d00b28773b0",
"md5": "87777b0be9cb0b5770faefc42da73732",
"sha256": "ae5e2aad3d1460a0000998ebf446cbcdcc3485aaec0521c4a0445cfed2fed318"
},
"downloads": -1,
"filename": "z3_rideshare_planner-0.4.6.tar.gz",
"has_sig": false,
"md5_digest": "87777b0be9cb0b5770faefc42da73732",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 9680,
"upload_time": "2024-09-13T07:34:02",
"upload_time_iso_8601": "2024-09-13T07:34:02.341350Z",
"url": "https://files.pythonhosted.org/packages/7e/b2/bde7b68aa1a2f022a0d768498253b63e9dfedd52a9340a9f6d00b28773b0/z3_rideshare_planner-0.4.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-13 07:34:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MinghanWu039",
"github_project": "z3_rideshare_planner",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "z3-rideshare-planner"
}