Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

CPS Twinning

CPS Twinning is a framework for generating and executing digital twins that mirror cyber-physical systems (CPSs). This framework allows to automatically generate virtual environments for digital twins completely from specification. Ideally, artifacts that specify the correct behavior of a CPS have already been created during the production system engineering (PSE) process and will be maintained throughout the entire lifecycle. Standardized engineering data exchange formats, such as AutomationML (AML), may facilitate this process.

On top of CPS Twinning, multiple use cases can be implemented, ranging from behavior-specification-based intrusion detection to behavior learning & analytics.


CPS Twinning depends on Mininet-WiFi, MatIEC and CPS State Replication.


To install Mininet-WiFi, follow the instructions provided by the Mininet-WiFi installation guide. Note that CPS Twinning currently depends on a forked version of Mininet-WiFi.


First, install the MatIEC dependencies flex and bison. For example:

$ sudo apt-get update
$ sudo apt-get install flex
$ sudo apt-get install bison	

Then, clone the MatIEC repository and build the two transcompilers:

$ hg clone ssh://
$ cd matiec
$ autoreconf -i
$ ./configure
$ make

After that, set the following environment variables:

$ export MATIEC_INCLUDE_PATH=/home/<user>/matiec/lib
$ export MATIEC_C_INCLUDE_PATH=/home/<user>/matiec/lib/C
$ export PATH=/home/<user>/matiec:$PATH

CPS State Replication

To install CPS State Replication, follow the instructions provided in the README.

CPS Twinning

Finally, clone this repository and install CPS Twinning:

$ git clone
$ cd cps-twinning
$ virtualenv env
$ source env/bin/activate
(env)$ pip install -r requirements.txt
(env)$ pip install .


Now, to start CPS Twinning, run make twinning. The generation of digital twins from an AutomationML artifact can be initiated by executing twinning <path_to_aml>. An exemplary specification can be found at misc/specification/CandyFactory.aml.

Note that this project is only a proof of concept. As a consequence, there are currently many areas that need improvements. In particular, the functionality of the AutomationML parser is currently limited and may require manual adjustments.

How to Cite

If you use CPS Twinning in your research, please consider citing our CPSS '18 publication. Feel free to use the paper's BibTeX entry.