WikiPrint - from Polar Technologies

Sample code

Source code for a sample plugin can be found at

...Ecopath6\Sources\EwETutorials\CEFASPluginSample

To view the sample code

  1. Load ...Ecopath6\Sources\EwE6.sln into Visual Studio.
  2. In Visual Studio's Solution Explore added the CEFASPluginSample.vbproj project file by right clicking on Solution Explorer and selecting Add>Existing Project...
  3. Set a reference to CEFASPluginSample in the ScientificInterface project

Running Ecosim on a variable time step

Ecosim can be run on a variable time step via a plugin. When run from the Scientific Interface Ecosim runs 1 time step per month, 12 time steps per year. The number of timesteps per month can be set in code via the cEcosimDataStuctures.StepsPerMonth property. This allows a plugin to run Ecosim on sub time steps, multiple time steps in a month.

Sub time step data

When running on sub time steps Ecosim will only update its results objects cCore.cEcoSimResults(), cCore.cEcosimGroupOutput(), cCore.cEcosimOutput() and cCore.cEcosimFleetOutput() once at the end of the month. Data computed for the sub time step can only be access via the cEcosimDataStrucutres provided by the IEcosimSubTimestepsPlugin.EcosimSubTimeStepBegin() and IEcosimSubTimestepsPlugin.EcosimSubTimeStepEnd() plugin points. The IEcosimBeginTimestepPlugin.EcosimBeginTimeStep() and IEcosimEndTimestepPlugin.EcosimEndTimeStep() will only be call at the start and end of the month not during the sub time step and will not contain the sub time step data.

Sub time step plugin points

IEcosimSubTimestepsPlugin.EcosimSubTimeStepBegin(ByRef BiomassAtTimestep() As Single, ByVal TimeInYears As Single, ByVal DeltaT As Single, ByVal SubTimestepIndex As Integer, ByVal EcosimDatastructures As Object)

IEcosimSubTimestepsPlugin.EcosimSubTimeStepEnd(ByRef BiomassAtTimestep() As Single, ByVal TimeInYears As Single, ByVal DeltaT As Single, ByVal SubTimestepIndex As Integer, ByVal EcosimDatastructures As Object)