Skip to content

Template used for constructing HELICS federates compatible with OEDI-SI configuration.

License

Notifications You must be signed in to change notification settings

openEDI/oedisi-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OEDISI Federate Template

Modifying the Template

  • test_federate.py defines the core Python simulation code using HELICS and oedisi types.

  • component_definition.json defines static inputs and dynamic inputs/outputs managed by JSON files and HELICS respectively.

  • requirements.txt any python requirements used by Python.

  • server.py is an optional file used in multi-container simulations. No modifications may be necessary.

Install Requirements

pip install -r requirements.txt

How to use this in a simulation

  1. (Preferred) Copy or clone oedisi-template to the simulation folder.
  2. Add the location of the component_definition.json to a components.json in your simulation folder along with a preferred federate name.
  3. Either create a system.json or add to an existing one with static information and any links.
{
    "components": [
        ...,
        {
            "name": "unique_simulation_name",
            "type": "TypeNameDefinedInComponentsDict",
            "parameters": {
                "input_needed_at_startup": 31.415926535
            }
        }
    ],
    "links": [
        ...,
        {
            "source": "unique_simulation_name",
            "source_port": "appropriate_helics_pub",
            "target": "another_federate_which_wants_data",
            "target_port": "subscription"
        }
    ]
}
  1. Build with oedisi build --system system.json. A folder called build should be created.
  2. Run with oedisi run.

For a more complete example along with multi-container settings, see https://github.com/openEDI/oedisi-example.

About

Template used for constructing HELICS federates compatible with OEDI-SI configuration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages