Creating new component
Follow these step to create a new component that participates in simulation in the platform.
- Make sure you understand the basic concepts of the platform (see Basic concepts at Manual for developer)
- Outputs: Decide what information the component should generate as result messages
- Inputs: Resolve what information the component needs as the input to generate the result messages
- This information comes from other components
- This is optional, because not all components need input
- Topics: Specify the topics the component uses to communicate
- This is based on "outputs" and "inputs"
- Re-use existing topics if and only if appropriate
- Specify new topics as needed
- See Conventions of naming
- Make sure the names do not conflict with existing topic names (see Topics (core) and Topics (energy))
- Messages: Determine which data is communicated with "topics"
- This is based on "outputs" and "inputs"
- Re-use existing message structures if possible
- See Message structures (core) and the existing messages at Message type names (core) and Message type names (energy)
- Specify new message structures as needed
- Choose whether to manage the execution by the platform or externally
- Develop the component
- Follow the workflow in pages Workflow of start and end and Workflow of component in simulation
- When developing a component using Python, it is advisable to to use the Simulation Tools package. For details about developing a new component using the package, see the instructions and the template file for a new component.
- An example of a platform managed component, called SimpleComponent, has been made by using the Simulation Tools package and the available documentation. The repository, https://github.com/simcesplatform/simple-component, contains documentation about the development steps taken during the development of the example component.
- During the component development, things that might have to considered:
- Environment: Determine what variable information the component must know about the environment (if anything)
- Parameters: Determine what parametrizable properties the component has (if any)
- Create a component manifest file using the instructions on page Creating a component manifest file.
- For platform managed component, build and publish a Docker image for the component. See page Building Docker image for a component for instructions on how to accomplish that.
- Update the documentation
- Document the communication and the workflow of the component. See the page for Static time series resource for an example.
- Document any new message types that are used by the component. See the page for Epoch message for an example.
- Document the topics used by the component and them to the list topics, for example to Topics (energy).
- Document a new Start message block for the component. See Dummy Component block for an example.
- For externally managed component, provide full installation instructions for the component.