# 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

## 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

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

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.