Installation¶
Here we provide user-friendly installation for DI-smartcross and all simulators we support.
Note
You can choose the simulators your experiments needed and install it only to run your experiments.
SUMO installation¶
DI-smartcross supports SUMO version >= 1.6.0. Here we demonstrate two easy ways of SUMO installation on Linux.
Install SUMO via apt-get or homebrew¶
On Debian or Ubuntu, SUMO can be directly installed using apt
:
sudo add-apt-repository ppa:sumo/stable
sudo apt-get update
sudo apt-get install sumo sumo-tools sumo-doc
On macOS, SUMO can be installed using homebrew
.
brew update
brew tap dlr-ts/sumo
brew install sumo
brew install --cask sumo-gui
After that, you need to set the SUMO_HOME
environment variable pointing to the directory
of your SUMO installation by inserting the following line at the end of .bashrc
:
export SUMO_HOME=/your/path/to/sumo
There might be some trouble arising when installing with the method above. It is recommended to build and install SUMO from the source code as follows.
Install SUMO from the source code¶
Here we show step-by-step guidance of installation with SUMO 1.8.0 on Linux.
install required libraries and dependencies
sudo apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig
download and unzip the installation package
tar xzf sumo-src-1.8.0.tar.gz
cd sumo-1.8.0
pwd
compile SUMO
mkdir build/cmake-build
cd build/cmake-build
cmake ../..
make -j $(nproc)
environment variables
echo 'export PATH=$HOME/sumo-1.8.0/bin:$PATH
export SUMO_HOME=$HOME/sumo-1.8.0' | tee -a $HOME/.bashrc
source ~/.bashrc
check install
sumo
If successful, the following message will be shown in the shell.
Eclipse SUMO sumo Version 1.8.0
Build features: Linux-3.10.0-957.el7.x86_64 x86_64 GNU 5.3.1 Release Proj GUI SWIG GDAL GL2PS
Copyright (C) 2001-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de
License EPL-2.0: Eclipse Public License Version 2 <https://eclipse.org/legal/epl-v20.html>
Use --help to get the list of options.
CityFlow Installation¶
CityFlow simulator can be installed from source code via CMake. Please make sure it is correctly worked in your system.
Simply download their source code and run pip install
in the root folder to install CityFlow.
git clone https://github.com/cityflow-project/CityFlow.git
cd CityFlow
pip install .
You can check installation by running import cityflow
in python.
Install DI-smartcross¶
Simply run pip install in the root folder of this repository. This will automatically install DI-engine as well.
pip install -e . --user
You can check the installation by running the following command.
python -c 'import ding; import smartcross'