A federate is a running instance of a simulator that has been integrated with HELICS. It is the fundamental unit of a HELICS co-simulation. Each federate models some portion of the overall system—perhaps the batteries in a fleet of electric vehicles, or the chargers those batteries connect to—and exchanges values or messages with other federates through the HELICS framework. A collection of federates running together to answer a shared research question is called a federation.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.
What a federate is
When talking about a simulator in the abstract—GridLAB-D, OpenDSS, EnergyPlus—we say “simulator.” The moment you launch a specific instance of that simulator with a specific model, configured to participate in a co-simulation, it becomes a federate. The distinction matters: a simulator on its own has no ability to join a HELICS federation, but a running instance configured with a HELICS core does. A single executable can contain multiple models. For example, one federate might model five EV batteries simultaneously, using a single HELICS interface for all five. As federations grow in complexity, it often becomes practical to use one federate per model object to keep configurations manageable.Every federate must have a unique name within the federation. HELICS uses this name to route signals to the correct destination. Duplicate names will produce an error at initialization.
Types of federates
HELICS defines four federate types, distinguished by the kinds of signals they exchange and the API classes they use.- ValueFederate
- MessageFederate
- CombinationFederate
- CallbackFederate
A Or from a JSON configuration file:
ValueFederate (C++ class: helics::ValueFederate) exchanges value signals—physical quantities such as voltages, currents, temperatures, or flow rates. Value signals represent the physics at the boundary between two simulators. They are persistent: once published, a value remains available to subscribers until a new one replaces it.Value federates are configured with publications and subscriptions (or named inputs). They are created in code with:Choosing the right federate type
| Requirement | Federate type |
|---|---|
| Physical values only (voltages, temperatures, flow rates) | ValueFederate |
| Control signals, protocol messages, event data | MessageFederate |
| Both physical values and control signals | CombinationFederate |
| Event-driven execution with callbacks | CallbackFederate |
The federate lifecycle
Every HELICS federate progresses through four stages during a co-simulation.Creation
The federate is instantiated and its interfaces (publications, subscriptions, inputs, endpoints) are registered with the HELICS core. This is done either through the API or by loading a JSON configuration file. No time advances during this stage.
Initialization
The federate calls
helicsFederateEnterInitializingMode() and performs any setup required before time begins. Federates can publish initial values during this stage; those values become available to others at simulation time t=0 when execution begins. The federation can iterate in initialization mode to converge on a consistent initial state before proceeding.Execution
The federate enters execution mode—a blocking call that waits until all other federates are ready—then steps through simulated time in a loop. At each granted time, the federate reads its inputs, runs its internal simulation logic, publishes outputs, and requests the next time.
Finalization
Once the federate has completed its contribution (typically when granted When all federates connected to a core have finalized, the core terminates. When all cores connected to a broker have terminated, the broker terminates. This cascade cleanly ends the co-simulation.
HELICS_TIME_MAXTIME or when the simulation end condition is met), it signals its departure to the rest of the federation and frees its resources.Cores
The core is the HELICS library embedded inside a simulator that enables it to participate in a federation. Every federate has exactly one core. The core is responsible for:- Managing all interface registrations (publications, subscriptions, inputs, endpoints) for its federate
- Coordinating time requests between the local federate and the broker
- Routing messages to and from the broker
coreType property. The default and most commonly used is ZeroMQ (zmq), but TCP, IPC (for in-memory same-machine communication), and MPI (for HPC clusters) are also supported.
Brokers
The broker is a standalone executable that serves as the central message router for the federation. Every core must register with a broker to participate. The broker:- Collects time requests from all connected cores and determines the next globally safe time to grant
- Routes value and message signals to their intended recipients
- Signals termination when all federates have finalized
Value vs. message signals at a glance
| Values | Messages | |
|---|---|---|
| Interface type | Publication / Subscription / Input | Endpoint |
| Signal route | Fixed at initialization | Determined at transmission time |
| Outgoing | 1 to many (broadcast) | 1 to 1 |
| Incoming | Many to 1 | 1 to 1 |
| Persistence | Current value always available | Consumed when received |
| Filterable | No | Yes |
| Typical use | Physical quantities | Control signals, protocol data |