This is the source code for the paper "Demand-driven design of bicycle infrastructure networks for improved urban bikeability" by C. Steinacker, D.-M. Storch, M. Timme, and M. Schröder.
I strongly recommend using Linux (e.g. openSUSE Tumbleweed). With Windows, there are major problems with Conda and R, which means that the code often cannot be executed there.
-
Install the dependencies
There are two options to install the dependencies: Conda or pure Python virtualenv. Both should not take more than 20-25 minutes to set up.
-
Conda
Check that you have Latex installed outside of conda, as the conda version of Latex is currently broken. Use the
conda-env.yml
file to create a conda environment:conda env create -f conda-env.yml
. The environment will be calledBikePathNet
, activate the environment withconda activate BikePathNet
. -
Python virtualenv
Check if you have installed the following dependencies
- Python 3 (>= 3.6) including development libraries
- PROJ (>= 8.0)
- R (>=3.6.1)
- g++ (>= 5.3)
- cmake (>= 3.5)
- Build System: Make or Ninja
- Latex
Create Python venv and install Python requirements.
# Create a new virtualenv and activate it python3 -m venv venv source venv/bin/activate # Install dependencies pip install cython pip install -r requirements.txt
-
-
Install the package
Make sure you activated the conda env or Python virtualenv, and you are executing the command from the project folder. The installation of the package should only take a couple of seconds.
pip install -e ./
-
Executing the python scripts
All commands assume you are in the project folder.
- Prepare data for algorithm with given street networks. Execute
examples/hh_prep.py
. It will take only a couple of seconds. - Run the simulations. This can be done by running
examples/hh_algorithm.py
. This is a time and resource intensive step, it takes roughly 1-2 hours depending on the number of CPU cores and their speed. - Now the figures can be generated, some additional information will be printed in the commandline. Execute
examples/hh_plot.py
. The plots will be saved in theexamples/plots/
folder. Should take less than 5 minutes for all plots.
- Prepare data for algorithm with given street networks. Execute
- Python 3.9
- Python packages: See requirements.txt
- R 3.6.1
- PROJ 8.1.1
The data used for Hamburg (hh) in the example folder is extracted from a publicly available data set provided by Call a Bike by Deutsche Bahn AG (License: CC BY 4.0).