It4innovations / ruth

GNU General Public License v3.0
2 stars 1 forks source link

ruth

A python library for routing on OSM map based on osmnx.

Documentation

The detailed documentation is available at: https://it4innovations.github.io/ruth/

Installation

Required python version >= 3.9.6

# requirements
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
    git curl \
    build-essential gdal-bin libgdal-dev openmpi-bin libopenmpi-dev \
    python3 python3-dev python3-virtualenv python3-pip python3-setuptools python3-wheel

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

# create and activate python virtual environment
python3 -m venv venv
source venv/bin/activate

# within the venv
# install and update python dependencies
python3 -m pip install -U pip setuptools wheel cython

# install ruth - the traffic simulator
python3 -m pip install git+https://github.com/It4innovations/ruth.git

Test Run

Options

For the Alternatives and Route selection, percentages of vehicles can be set for each type. The sum of percentages for Alternatives has to be equal to the sum for Route Selection. If the percentages don't add up to 1, no alternatives are calculated for the remaining vehicles and they stick to their original route that is in the input parquet file.

Alternatives

Animation

To create animation of the simulation after the run, FFmpeg needs to be installed. Using option --gif to generate gif instead of mp4 does not require FFmpeg.

There are two types of animation:

To create the speed animation using the configuration file, run:

ruth-simulator-conf --config-file="config.json" run speed-animation

for the volume animation, run:

ruth-simulator-conf --config-file="config.json" run volume-animation

Animation can be generated only after run command. To create an animation of an existing simulation, see ruth/flowmap/README.md.

Animation options can be set in configuration file, for example:

{
  ...
  "animation":
  {
    "length": 60,
    "gif": true,
    "fps": 20,
    "title": "Traffic speed animation"
  }
}

Animation options

Tools

Other tools can be found in the ruth/tools directory. For more information, see ruth/tools/README.md.

Acknowledgement