Installation¶
Prerequisites¶
Python¶
The project requires python3 (>= 3.7)
Sumo¶
In order to be able to use the SumoEnvironment (intersection_control.environments.sumo.SumoEnvironment), you will
need to have SUMO installed, and the SUMO_HOME
environment
variable should be set correctly as described here
Anaconda¶
It is recommended to create a new Anaconda environment when using this project:
$ conda create --name <environment-name> python=3.8
$ conda activate <environment-name>
Installing IntersectionControl¶
There are a couple of ways to install this library, and you should choose the way you install it depending on how you plan on using it and what you would like to do with it.
The reason for suggesting the 2nd and 3rd option below is that this is a first version of the library, and so I assume that some APIs will need modifications and so most users of the library at this stage will likely want to be modifying its source code while using it.
Via pip: If you plan to define your own control algorithms and environments entirely from scratch - and/or to use the algorithms/environments from the library out-of-the box.
Clone and install in editable mode: If you would like the flexibility of being able to modify the library’s source code - which may be necessary, for example if you are defining a new algorithm and feel like the existing API is not sufficient and needs to be extended, but you will be writing your own code in a separate project space.
Work in the repository directly: If you want the same flexibility as in (2), but want to work directly in the library’s source files.
Install via pip¶
The library is available to install via pip
$ pip install intersection-control
You will then be able to make use of the library in any python source file:
from intersection_control.core import Vehicle
Clone and install in editable mode¶
$ git clone git@github.com:julesdehon/IntersectionControl.git
$ cd IntersectionControl
$ pip install -e . # (install in editable mode)
You can then create a new separate project and be able to make use of the library in any python source file:
from intersection_control.core import Vehicle
And any modifications that you make to source files in the IntersectionControl
project will be reflected directly
in your pip installation
Work in the repository directly¶
$ git clone git@github.com:julesdehon/IntersectionControl.git
$ cd IntersectionControl
$ pip install -r requirements.txt