# Plexe

The Platooning Extension for Veins.

# Plexe Examples - Running Plexe

## Step 0. Building Plexe

This quick tutorial assumes that you already have installed OMNeT++ 5.1.1, all library dependencies for SUMO, tools such as g++ or 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 (~/src/ or C:\Users\<user>\src\ in Windows). You can download and build Plexe-Veins and Plexe-SUMO with the following commands:

Now you need to tell your system where to find SUMO binaries, which can be done by changing your PATH environmental variable under your .bash_rc, .zshrc, .profile, or any other, depending on the shell you are using. Edit the file, add

and re-open your terminal (or source your configuration file). By typing sumo in your terminal you should now get something similar to

## 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-veins/examples/platooning folder and type

On Windows, you might need to substitute ./run with python ../../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

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

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

The script generates the following graphs, showing the evolution of control input, acceleration, speed, and distances in time.