Interface ILayer
Base Interface for all layers.
Instead implement either ISteppedLayer or one of its descendants depending on your requirements.
Namespace: Mars.Interfaces.Layers
Assembly: Mars.Interfaces.dll
Syntax
public interface ILayer : IModelObject
Methods
| Improve this Doc View SourceGetCurrentTick()
The current Tick this layer is in
Declaration
long GetCurrentTick()
Returns
Type | Description |
---|---|
System.Int64 | Positive long value in active simulation or if simulation has ended, -1 otherwise |
InitLayer(LayerInitData, RegisterAgent, UnregisterAgent)
Initializes the layer with layerInitData.
Use this instead of the constructor, as it is
guaranteed to be called in the correct load order.
This layer is in a state which allows
it to start the simulation.
A data type holding the
information of how to initialize a layer.
Handle to register agents from the simulation.
Handle to unregister agents from the simulation.
This layer was successfully added to its container.
Declaration
bool InitLayer(LayerInitData layerInitData, RegisterAgent registerAgentHandle = null, UnregisterAgent unregisterAgent = null)
Parameters
Type | Name | Description |
---|---|---|
LayerInitData | layerInitData | |
RegisterAgent | registerAgentHandle | |
UnregisterAgent | unregisterAgent |
Returns
Type | Description |
---|---|
System.Boolean | True if init finished successfully, false otherwise |
SetCurrentTick(Int64)
Sets the current simulation step of the layer.
This will be called by the Executor to
deliver the current logical simulation step into the layer.
Declaration
void SetCurrentTick(long currentStep)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | currentStep | A positive number |