To avoid package conflicts it is recommended to create a virtual environment for the dependencies.
$ virtualenv --python=python3 venv
$ source venv/bin/activate(venv) $ pip install -r requirements.txtThe simulation can be run through the main.py script in the
src/ directory of this project.
(venv) $ python src/main.pyTo see the list of all possible parameters to change use --help.
(venv) $ python src/main.py --helpThe simulation parameters can also be loaded from a yaml configuration file
(venv) $ python src/main.py --config config.yaml# config.yaml
simulation:
length: 150
lanes: 3
max-speed: 7
obstacles:
- "0:0-10"
- "2:0-10"
dispatch: 1Simulation can run in two different modes:
guidisplaying animation of the vehiclesclirunning for a specific number of cycles and showing only statistics
You can see gui specific parameters by running
(venv) $ python src/main.py gui --helpFor example to change the animation time of a single step to 200ms
(venv) $ python src/main.py gui --step 200You can see cli specific parameters by running
(venv) $ python src/main.py cli --helpFor example to change the number of steps to 1000
(venv) $ python src/main.py cli --steps 1000