Value federates are the most common type of federate in HELICS co-simulations. They model the physics of a system—batteries, generators, thermal loads, fluid networks—and exchange physical quantities with other federates through a publish/subscribe interface. Where value signals differ fundamentally from messages is in their semantics: a published value is persistent, meaning it remains available to all subscribers with its latest value until the publisher updates it. This reflects physical reality, where a voltage or temperature at a boundary is a continuous quantity that other simulators can read at any time, not a one-shot packet that disappears after receipt.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GMLC-TDC/HELICS/llms.txt
Use this file to discover all available pages before exploring further.
Interface types for value federates
HELICS provides four interface types for value exchange. The choice between them determines whether the federate or the federation configuration specifies the connection mapping.| Interface | Direction | Connection specified by |
|---|---|---|
| Publication | Sending | Recipient is optional (targets) |
| Subscription | Receiving | Sender is specified via key |
| Named Input | Receiving | Named; targets are optional |
| Directed Output | Sending | Recipient is required |
Publications and subscriptions are the recommended starting point for most co-simulations. Named inputs are more appropriate when a single receiving interface must aggregate values from several publishers, or when the mapping of connections is managed centrally in a broker configuration file rather than within each federate.
Supported data types
HELICS supports a wide range of data types for value signals. The type is specified when registering the interface and determines how HELICS serializes and deserializes the value. HELICS will perform type conversion where possible if the publisher and subscriber specify different types.| Type string | Description |
|---|---|
double | 64-bit floating-point scalar |
int | 64-bit signed integer |
string | UTF-8 string |
complex | Complex number (real + imaginary as doubles) |
vector | Array of doubles |
complex_vector | Array of complex numbers |
named_point | Named double value (string + double pair) |
boolean | True/false |
time | HELICS time value |
JSON configuration
Federate publications, subscriptions, and inputs are most commonly configured via a JSON file. The same file also contains timing settings and federate-level properties.Key publication options
key— The unique identifier for this publication within the federate. Ifglobalisfalse(the default), the full federation-wide key becomes<federate_name>/<key>. Ifglobalistrue, thekeyvalue is used as-is across the entire federation and must be unique.type— The data type of the published value (see supported types above).unit— Physical unit string. HELICS can perform unit conversion fordoubletypes (e.g., V to mV). A warning is generated if units are specified but incompatible.global— Whentrue, the key is the global name. Use for small federations with few publications to keep key strings short.only_transmit_on_changeandtolerance— HELICS will suppress publishing a new value unless it differs from the previous value by more thantolerance. Reduces unnecessary network traffic.
Key subscription options
key— The name of the publication to subscribe to. If the publication was registered withglobal: false, use the full<federate_name>/<publication_key>form.default— The value returned before any publication has been received. Prevents undefined reads at simulation start.only_update_on_changeandtolerance— Symmetric to the publication option; the subscription considers a value “updated” only if it differs by more thantolerance.
C API
The HELICS C API is the basis for all language bindings. The following examples show the core calls for working with value federates.Registering interfaces
- C API
- Python
Publishing values
- C API
- Python
Reading subscriptions and inputs
- C API
- Python
Global vs. local publications
Theglobal flag on a publication controls the scope of its name within the federation.
Local publications ("global": false) have their key automatically prefixed with the federate name. A publication with key "EV1_current" in a federate named "BatteryFederate" becomes "BatteryFederate/EV1_current" federation-wide. Subscribers must use this full name. Local publications are recommended for large federations where unique global names would be difficult to guarantee.
Global publications ("global": true) use the key value as-is across the entire federation. The user is responsible for ensuring uniqueness. Global keys are convenient in small federations where short, descriptive names improve readability.
Inputs vs. subscriptions
Subscriptions are unnamed receiving interfaces—they are identified only by the publication key they target. Inputs are named receiving interfaces; they are known to the federation by their own key and can be connected to one or more publications via thetargets field.
helicsInputGetDouble() is the most recently received value from any of those targets. For aggregation of multiple values you would need to query each target publication individually.