Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 1.58 KB

README.md

File metadata and controls

53 lines (44 loc) · 1.58 KB

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.