Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Include Page
OPENMI:4.1 Step 1 - Changing your engine core
OPENMI:4.1 Step 1 - Changing your engine core
Include Page
OPENMI:4.

...

The aim of the migration is to develop a class that implements the IEngine interface. As shown in Figure 6, the class that implements the IEngine interface is supported by other classes and the engine DLL.
Image Removed
Fig 6. Wrapping classes and engine core DLL
 
Model engines are typically compiled into an executable file (EXE). Such executable files are not accessible by other components and as such are not very suitable as a basis for OpenMI components. It is therefore necessary for your engine to be compiled into a dynamic link library file (DLL).
Ideally you should make modifications to your engines so that the same engine can be used both when running as an OpenMI component and when running as a standalone application. Having two versions of the same engine leads to unnecessary maintenance work. Therefore you could make a new application (EXE) that calls a function in the engine core DLL which, in turn, makes your engine perform a full simulation.
Figure 7 illustrates the software required to run an engine as a standalone application. The SimpleRiverApplication.EXE file is never used when running in an OpenMI setting.
 
Image Removed
Fig. 7. Running an engine as a standalone application
 
The following steps are required in the conversion of the engine core:

  1. Change the engine core so that it can be compiled into a DLL.
  2. Add a function to the engine core that will run a full simulation: logical function RunSimulation()
  3. Create an engine application (EXE) that from its main program calls the RunSimulation function in your engine core DLL.
  4. Run your engine by deploying the engine application and check that the engine is still producing correct results.

...

2 Step 2 - Creating the .Net assemblies
OPENMI:4.2 Step 2 - Creating the .Net assemblies

4.2 Step 2: Creating the .Net assemblies

...