Skip to content

jmythms/CoolerChips_HELICS_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A very basic HELICS example, and how to setup a basic federate.

How to run this example:

  1. Install pyHELICS: pip install helics

image

  1. Clone this repo: git clone <copied link from above>
  2. Move to the cloned directory: cd <path to cloned directory>
  3. Run using the runner.json: helics run --path=Runner.json

What is happening here?

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.

May I get some basic terminology?

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

What do these files do, can I learn more?

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)

Expected results when you run this:

image

What am I expected to do with this?

Figure out how to make your model work like in one of the Fedn.py files. (Example)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages