VILLASframework
Modular co-simulation framework
|
A path is a uni-directional connection between incoming and outgoing nodes.
It forwards messages from one or more incoming nodes to one or more outgoing nodes. Therefore it represents a n-to-n relation between nodes.
For bidirectional communication a corresponding path in the reverse direction must be added.
By default, message contents are not altered. The server only performs checks for valid message headers (sequence number, cryptographic signature..). However, every path supports optional hook functions which allow user-defined operations on the samples.
The path section in the configuration file consists of a list of one or more paths objects.
Every path object is configured by the following settings:
The in
settings expects the name of one or more source nodes or mapping expressions.
See Input mapping
The out
setting expects the name of one or more destination nodes. Each sample which is processed by the path will be sent to each of the destination nodes.
The optional enabled
setting can be used to temporarily disable a path. If omitted, the path is enabled by default.
By default, the path is unidirectional. Meaning, that it only forwards samples from the source to the destination. Sometimes a bidirectional path is needed. This can be accomplished by setting reverse
to true
.
The mode setting specifies under which condition a path is triggered. A triggered path will multiplex / merge samples from its input nodes and run the configured hook functions on them. Afterwards the processed and merged samples will be send to all output nodes.
Two modes are currently supported:
any
: The path will trigger the path as soon as any of the masked (see mask (list of strings: node-names) = _all input nodes_) input nodes received new samples.all
: The path will trigger the path as soon as all input nodes received at least one new sample.This setting allows masking the the input nodes which can trigger the path.
See also: mode (string: "all" | "any") = "any"
A non-zero value will periodically trigger the path and resend the last sample again.
A value of zero will disable this feature.
When this flag is set, the original sequence number from the source node will be used when multiplexing the nodes.
A list of hook functions which will be executed for each sample which is processed by this path.
See Hook-types chapter of this documentation for details.
The in (list of strings: node-names | mapping expression) setting supports different ways of configuring and selecting the nodes from which the path sources its samples.
The easiest way of configuring a path source is by providing a single name of a node. This will take all signals from this source node and forward it to the path destinations.
Instead of a single node also multiple nodes can be provided in a list. In this configuration all signals from all listed nodes will be concatenated in the order in which the nodes are listed.
The last way of configuring signals for a path is by using more complex signal mapping expressions. This allows you to select individual signals from one or multiple source nodes as well as other metadata such as:
Se below for a few different examples using the signal mapping expressions