Plexe

The Platooning Extension for Veins.

Plexe Examples - Running Plexe

Step 0. Building Plexe

This quick tutorial assumes that you already have installed Plexe and all the required software following the instruction inside the building section. After doing so, please set up the environmental variables by running the following

1 2
cd ~/src/plexe . ./setenv

Description

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.

Running the example

We first run one simulation with the SUMO GUI to actually see the vehicles. Go to the ~/src/plexe/examples/platooning folder and type

1
plexe_run -u Cmdenv -c Sinusoidal -r 2

On Windows, you might need to substitute plexe_run with python ../../bin/plexe_run. 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
plexe_run -u Cmdenv -c SinusoidalNoGui -r 0 plexe_run -u Cmdenv -c SinusoidalNoGui -r 1 plexe_run -u Cmdenv -c SinusoidalNoGui -r 3 plexe_run -u Cmdenv -c SinusoidalNoGui -r 4 plexe_run -u Cmdenv -c SinusoidalNoGui -r 5 plexe_run -u Cmdenv -c BrakingNoGui -r 0 plexe_run -u Cmdenv -c BrakingNoGui -r 1 plexe_run -u Cmdenv -c BrakingNoGui -r 2 plexe_run -u Cmdenv -c BrakingNoGui -r 3 plexe_run -u Cmdenv -c BrakingNoGui -r 4 plexe_run -u Cmdenv -c BrakingNoGui -r 5

At this point you should have all the results ready to be processed in the results folder.

Plotting the results

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 ./genmakefile.py. The script will parse the content of all .vec files and generate Sinusoidal.Rdata and 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.

Sinusoidal scenario

Figure 1. Control inputs in time.

Figure 2. Accelerations in time.

Figure 3. Speeds in time.

Figure 4. Distances in time.

Braking scenario

Figure 5. Control inputs in time.

Figure 6. Accelerations in time.

Figure 7. Speeds in time.

Figure 8. Distances in time.