VILLASframework
Modular co-simulation framework
|
One of the main design decissions while developing VILLASnode gateway was the choice of a simple and common data structure for simulation data.
In VILLAS terminology, we refer to this as a sample. A sample is a set of signals which have been generated, simulated or measured at the same sampling time instant. Each node-type needs to convert its own data format into the common intermediate data structure. This enables VILLASnode to interface each of the available Node-types with each other.
Some node-types have support for different data formats. E.g. the MQTT node-type can transport its payloads in varying formats. Available pluggable (de-)serializers documented at: Format-types
The data-structure used by VILLASnode is defined by the struct sample
.
Each sample contains a sequence number. This sequence number needs to increase monotonicly. The main purpose of the sequence number is the detection of lost, reordered or duplicated samples.
Each sample contains a timestamps which define the sample instant. Timestamps are stored as struct timespec
which contain an UNIX timestamp (seconds after 1.1.1970, UTC) as well as the nanoseconds of the current seconds. Both fields are stored as 32 Bit integers.
In order to ease implementation of new node-types, the data structure is kept as simple as possible: Each sample stores its signal data as a linear array of values:
Metadata such as signal names, units, data-types etc. which dot not change between samples are not part of struct sample
. They are rather stored in a separate list of struct signal
defintions. The design of VILLASnode assumes that the these signal definitions remain static over the runtime of VILLASnode,
Each sample contains a pointer to this list of signal definitions. The indices of signal data coressponds to the index within the list of signal definitions.
See -dev-signal for more details.