This repo simulates package-delivery by truck.
It expects csv files containing distance data and package data. It instantiates truck and package objects and then constructs a route which handles multiple package constraints, uses nearest-neighbors, and shortens the route as much as possible while still delivering all package on time. It then "loads" trucks and "delivers" packages.
pip install package-delivery-app
Dependencies: none.
Prerequisites: Python 3 and either MacOS or a recent Windows.
Tech used: just Python 3.6.8.
The program's entry point is run_program() in __main__.py. The requirements for the distance and package csv files are documented in the load.py docstrings.
You can run this code as a package or as a module.
- As a package:
- import package_delivery_app as pda
- pda.run_program(your_distance_csv, your_package_csv)
- As a module:
- python -m package_delivery_app your_distance_csv your_package_csv
Reminder: wrap filepaths in quotes if they have any spaces.
Tip: use Python's __doc__ function to learn more about a package or class.
- Example: print(package_delivery_app.Hash.__doc__)
- Satisfy requirements for a Western Governors University course.
- Go beyond those requirements; explore building a "real" Python application.
- Custom Hash and time classes are used. The Hash class was designed to (nearly) replicate Python dictionaries.
- Route takes into account several kinds of constraints, such as: deadlines, packages needing to have their destination corrected (having the wrong destination initially), sets of packages needing to go together, and so on.
- Users can request snapshots of the delivery status of each package.
- Trucks maintain a constant speed of 18 miles per hour at all times.
- Trucks have a capacity of just 16 packages.
This project adheres to pep8. Idiomatic or 'Pythonic' ways were preferred, with the exception that I prefer the from/import style of imports.
I designed the logo--a composite of 'noncommercial use with modification' images, except for the Python logo, which I don't think has the 'with modification' qualifier.
MIT (see LICENSE.txt for details)