This quick tutorial assumes that you already have installed OMNeT++ 5.1.1, all library dependencies for SUMO, tools such as
clang++, and the R statistical framework.
Also, the tutorial assumes you are working on a Unix-like operating system.
Please also consider to install ccache (see the FAQ section for an explanation).
We will put all the source code in the
src folder under your home (
C:\Users\<user>\src\ in Windows).
You can download and build Plexe-Veins and Plexe-SUMO with the following commands:
1 2 3 4 5 6 7 8 9 10 11 12 13 cd ~/src git clone https://github.com/michele-segata/plexe-veins.git git clone https://github.com/michele-segata/plexe-sumo.git cd plexe-veins git checkout plexe-2.1 ./configure make -j <number of cores of your PC> MODE=release cd ~/src/plexe-sumo git checkout plexe-2.1 mkdir build-release cd build-release cmake -DCMAKE_BUILD_TYPE=Release .. make -j <number of cores of your PC>
Now you need to tell your system where to find SUMO binaries, which can be done by changing your
PATH environmental variable under your
.profile, or any other, depending on the shell you are using.
Edit the file, add
1 export PATH=$PATH:~/src/plexe-sumo/bin
and re-open your terminal (or
source your configuration file).
sumo in your terminal you should now get something similar to
1 2 3 4 5 Eclipse SUMO Version 619df18 Build features: Darwin-14.5.0 Proj GUI GDAL FFmpeg GL2PS SWIG Copyright (C) 2001-2018 German Aerospace Center (DLR) and others; http://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.
The first example shows a comparison between the ACC and the CACC models that Plexe provides. A platoon of 8 cars is injected in a stretch of freeway. The scenario includes two sub-scenarios. In the first one the leader accelerates and decelerates in a sinusoidal fashion to show some properties of the controllers, while in the second the leader performs and emergency braking maneuver. The simulation provides five configurations for each scenario: In the first two, the followers enable the ACC to control the car, but with two different headway times (i.e., 0.3 s and 1.2 s). The aim is to show that the ACC is unstable in the first case, and stable in the second one. In the other scenarios instead, the followers use the CACCs available in Plexe. The example shows how, thanks to IVC, the cooperative control systems are stable even when vehicles are closely following each other.
We first run one simulation with the SUMO GUI to actually see the vehicles.
Go to the
~/src/plexe-veins/examples/platooning folder and type
1 ./run -u Cmdenv -c Sinusoidal -r 2
On Windows, you might need to substitute
You should see the SUMO interface popping up and showing an empty freeway.
At 1 second you should see the platoon of 8 cars appear in the highway.
The vehicles will run for 60 s and then the simulation will stop.
To run all the other scenarios, let’s avoid the GUI.
Copy-paste the following in your terminal
1 2 3 4 5 6 7 8 9 10 11 ./run -u Cmdenv -c SinusoidalNoGui -r 0 ./run -u Cmdenv -c SinusoidalNoGui -r 1 ./run -u Cmdenv -c SinusoidalNoGui -r 3 ./run -u Cmdenv -c SinusoidalNoGui -r 4 ./run -u Cmdenv -c SinusoidalNoGui -r 5 ./run -u Cmdenv -c BrakingNoGui -r 0 ./run -u Cmdenv -c BrakingNoGui -r 1 ./run -u Cmdenv -c BrakingNoGui -r 2 ./run -u Cmdenv -c BrakingNoGui -r 3 ./run -u Cmdenv -c BrakingNoGui -r 4 ./run -u Cmdenv -c BrakingNoGui -r 5
At this point you should have all the results ready to be processed in the
First, we pre-process the data from all simulation and merge the results into a single file using the new scripts provided by Plexe.
To do this, go into the
analysis folder and type
1 2 ./genmakefile.py parse-config > Makefile make
On Windows, you might need to type
python genmakefile.py instead of
The script will parse the content of all
.vec files and generate
Braking.Rdata, which will include all the results from the two scenarios.
These files are very easy to load in
R and give you immediate access to all the results (actually, the ones that you decided to extract).
To plot the graphs to compare the controllers run the R script
1 2 Rscript plot-sinusoidal.R Rscript plot-braking.R
The script generates the following graphs, showing the evolution of control input, acceleration, speed, and distances in time.