Skip to main content

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 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.

  • visualize(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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z3_rideshare_planner-0.3.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z3_rideshare_planner-0.3.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file z3_rideshare_planner-0.3.1.tar.gz.

File metadata

  • Download URL: z3_rideshare_planner-0.3.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for z3_rideshare_planner-0.3.1.tar.gz
Algorithm Hash digest
SHA256 84c3ca6a4c940db69dee2692a0b9a0d6b0cf28459b4a0d2a5542570c5f29169a
MD5 d842e2351a63c12450401edc6dd34c29
BLAKE2b-256 624f26cc473d3353f1fdd537625388e0bcc3e42200d0efc25a6c0b7db389859a

See more details on using hashes here.

File details

Details for the file z3_rideshare_planner-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for z3_rideshare_planner-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8e0303224a22dfc8f8d135581212655eaada034b7b43d1d47fa2a4bb1f50b997
MD5 9f1335815a2b9128d3da5aec2a4f9b27
BLAKE2b-256 6b26a2ca56cb2e861502dae01c9d4d41019d9d4944ae387600546fd6c80cf01c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page