2020-08-03 20:19:42 +02:00
|
|
|
# Urban Meal Delivery
|
|
|
|
|
|
|
|
|
|
This repository holds code
|
2020-09-30 13:43:00 +02:00
|
|
|
analyzing the data of an undisclosed urban meal delivery platform (UDP)
|
2020-08-03 20:19:42 +02:00
|
|
|
operating in France from January 2016 to January 2017.
|
|
|
|
|
The goal is to
|
|
|
|
|
optimize the platform's delivery process involving independent couriers.
|
|
|
|
|
|
2020-08-11 11:02:09 +02:00
|
|
|
|
|
|
|
|
## Structure
|
|
|
|
|
|
2020-09-30 13:43:00 +02:00
|
|
|
The analysis is structured into the following stages
|
2020-08-03 20:19:42 +02:00
|
|
|
that iteratively build on each other.
|
|
|
|
|
|
2020-09-30 13:43:00 +02:00
|
|
|
|
|
|
|
|
### Data Cleaning
|
|
|
|
|
|
|
|
|
|
The UDP provided its raw data as a PostgreSQL dump.
|
2026-11-26 16:02:00 +01:00
|
|
|
This [notebook](research/01_clean_data.ipynb)
|
2020-09-30 13:43:00 +02:00
|
|
|
cleans the data extensively
|
2026-11-26 16:02:00 +01:00
|
|
|
and maps them onto the [ORM models](src/velofy/db)
|
2026-11-24 10:56:25 +01:00
|
|
|
defined in the `velofy` package
|
2026-11-26 16:02:00 +01:00
|
|
|
that is developed in the [src/](src) folder
|
2020-09-30 13:43:00 +02:00
|
|
|
and contains all source code to drive the analyses.
|
|
|
|
|
|
|
|
|
|
Due to a non-disclosure agreement with the UDP,
|
|
|
|
|
neither the raw nor the cleaned data are published as of now.
|
2026-11-26 16:02:00 +01:00
|
|
|
However, previews of the data can be seen throughout the [research/](research) folder.
|
2020-09-30 13:43:00 +02:00
|
|
|
|
|
|
|
|
|
2021-02-04 16:12:25 +01:00
|
|
|
### Tactical Demand Forecasting
|
|
|
|
|
|
|
|
|
|
Before any optimizations of the UDP's operations are done,
|
|
|
|
|
a **demand forecasting** system for *tactical* purposes is implemented.
|
|
|
|
|
To achieve that, the cities first undergo a **gridification** step
|
|
|
|
|
where each *pickup* location is assigned into a pixel on a "checker board"-like grid.
|
2026-11-26 16:02:00 +01:00
|
|
|
The main part of the source code that implements that is in this [file](src/velofy/db/grids.py#L60).
|
|
|
|
|
Visualizations of the various grids can be found in the [visualizations/](research/visualizations) folder
|
|
|
|
|
and in this [notebook](research/03_grid_visualizations.ipynb).
|
2021-02-04 16:12:25 +01:00
|
|
|
|
|
|
|
|
Then, demand is aggregated on a per-pixel level
|
|
|
|
|
and different kinds of order time series are generated.
|
|
|
|
|
The latter are the input to different kinds of forecasting `*Model`s.
|
|
|
|
|
They all have in common that they predict demand into the *short-term* future (e.g., one hour)
|
|
|
|
|
and are thus used for tactical purposes, in particular predictive routing (cf., next section).
|
|
|
|
|
The details of how this works can be found in the first academic paper
|
|
|
|
|
published in the context of this research project
|
|
|
|
|
and titled "*Real-time Demand Forecasting for an Urban Delivery Platform*"
|
2026-11-24 11:15:38 +01:00
|
|
|
(cf., the [repository](https://code.webartifex.de/alexander/velofy-forecasting) with the LaTeX files).
|
2026-11-26 16:02:00 +01:00
|
|
|
All demand forecasting related code is in the [forecasts/](src/velofy/forecasts) sub-package.
|
2021-02-04 16:12:25 +01:00
|
|
|
|
2020-08-11 11:02:09 +02:00
|
|
|
|
|
|
|
|
### Predictive Routing
|
|
|
|
|
|
|
|
|
|
### Shift & Capacity Planning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Installation & Contribution
|
|
|
|
|
|
|
|
|
|
To play with the code developed for the analyses,
|
|
|
|
|
you can clone the project with [git](https://git-scm.com/)
|
2026-11-24 10:56:25 +01:00
|
|
|
and install the contained `velofy` package
|
2020-08-11 11:02:09 +02:00
|
|
|
and all its dependencies
|
|
|
|
|
in a [virtual environment](https://docs.python.org/3/tutorial/venv.html)
|
2026-11-25 15:54:16 +01:00
|
|
|
with [uv](https://docs.astral.sh/uv/):
|
2020-08-11 11:02:09 +02:00
|
|
|
|
2026-11-24 10:55:25 +01:00
|
|
|
`git clone ssh://git@git.webartifex.de/alexander/velofy.git`
|
2020-08-11 11:02:09 +02:00
|
|
|
|
|
|
|
|
and
|
|
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
`uv sync --extra research`
|
2020-08-03 20:19:42 +02:00
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
The `--extra` option is necessary as the non-develop dependencies
|
2026-11-26 16:02:00 +01:00
|
|
|
are structured in the [pyproject.toml](pyproject.toml) file
|
2026-11-24 10:56:25 +01:00
|
|
|
into dependencies related to only the `velofy` source code package
|
2020-08-11 11:02:09 +02:00
|
|
|
and dependencies used to run the [Jupyter](https://jupyter.org/) environment
|
|
|
|
|
with the analyses.
|
2020-08-03 20:19:42 +02:00
|
|
|
|
2020-08-11 11:02:09 +02:00
|
|
|
Contributions are welcome.
|
2026-11-24 10:55:25 +01:00
|
|
|
Use the [issues](https://code.webartifex.de/alexander/velofy/issues) tab.
|
2026-11-26 16:02:00 +01:00
|
|
|
The project is licensed under the [MIT license](LICENSE.txt).
|