7. Implementing IManageState

Implementation of the IManageState interface is not required in order to claim OpenMI compliance. However, if you want to use your model in configurations where iterations are needed or you want to use calibration or optimization controllers, the implementation of the IManageState interface is required. Normally, you should put the bulk of the implementation into the engine core and save the data required in order to restore a state in memory.

7.1 The IManageState interface

Implementation of the IManageState interface is shown in Figure 20.

The LinkableEngine class already implements the required methods for the OpenMI.Standard.ILinkableComponent interface but it is not specified in this class that it implements the OpenMI.Standard.IManageState interface.

To implement the IManageState interface when using the LinkableEngine, the procedure is as follows:

  1. In MyLinkableEngine, specify that it implements the IManageState interface.

  2. In MyEngineWrapper, specify that it implements the IManageState interface.

  3. Implement the IManageState methods in all wrapper classes. The implementation will typically be very simple code that redirects the call to the next wrapper class and finally to the engine core, where the bulk of the implementation is located.


Fig. 20. IManageState implementation

  • No labels