- Install pyHELICS:
pip install helics
- Clone this repo:
git clone <copied link from above>
- Move to the cloned directory:
cd <path to cloned directory>
- Run using the runner.json:
helics run --path=Runner.json
There are two federates (in our case models), that are running together.
- Federate 1 runs on a one second timestep, Federate 2 runs on a two second timestep.
- The timesteps are being co-ordinated by HELICS.
- They are also subscribed to each other.
The first federate (Fed 1) generates two signals,
sin(pi*simulation_time/6)
and
cos(pi*simulation_time/6)
.
It publishes these values (sends it to HELICS).
The second federate (Fed 2) is subscribed to these two signals.
- When it receives these signals, it will amplify them (multiply the value by 2). It will then publish these amplified values which can be seen by the first federate.
Some basic terminology, taken from the official HELICS page:
- Federate - An individual simulator that is computing something interesting and communicating with other simulators
- Core - An object managing the interactions of one or more federates
- Broker - An object coordinating multiple cores or brokers:
- There can be several layers of brokers
- Root broker - The root broker in the hierarchy
- Last chance router
- Responsible for determining when to enter initialization mode for the federation
- Federation - The set of all federates executing together in a single co-simulation
Runner.json: This file tells HELICS to launch three federates named cooler_chips_example_broker
, First_federate
, and Second_federate
.
Fed1.py, Fed2.py: Instances of simulation executables that models a group of objects or an individual objects.
Fed1Config.json, Fed2Config.json: Specifies how the federates will communicate with to other federates in the federation.
These definitions were taken from or adapted from the official HELICS documentation. You can read more of the same here: (https://docs.helics.org/en/latest/user-guide/fundamental_topics/fundamental_topics_index.html)
Figure out how to make your model work like in one of the Fedn.py files. (Example)