Class AbstractLayer
Base implementation of the the ILayer interface for inheritance and
quick layer type implementation. The entity creation within the InitLayer(LayerInitData, RegisterAgent, UnregisterAgent) method
is need be handled by the specialized class.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Components.Layers
Assembly: Mars.Components.dll
Syntax
public abstract class AbstractLayer : ILayer, IModelObject
Properties
| Improve this Doc View SourceContainer
Gets the simulation container resolve each required dependency for specific purposes.
Declaration
public ISimulationContainer Container { get; }
Property Value
Type | Description |
---|---|
ISimulationContainer |
Context
The step execution context
Declaration
public ISimulationContext Context { get; }
Property Value
Type | Description |
---|---|
ISimulationContext |
EntityManager
The entity manager to create entity objects by an input source.
Declaration
public IEntityManager EntityManager { get; }
Property Value
Type | Description |
---|---|
IEntityManager |
Mapping
Gets the input mapping for this vector-layer.
Declaration
public LayerMapping Mapping { get; set; }
Property Value
Type | Description |
---|---|
LayerMapping |
RegisterAgent
Gets the registration handle to activate an ITickClient at the runtime system
to let execute their Tick() method and to observe the object in the output.
Declaration
public RegisterAgent RegisterAgent { get; }
Property Value
Type | Description |
---|---|
RegisterAgent |
UnregisterAgent
Gets the unregister handle to deactivate an ITickClients at the runtime system to prevent
any execution and stop the observation.
Declaration
public UnregisterAgent UnregisterAgent { get; }
Property Value
Type | Description |
---|---|
UnregisterAgent |
Methods
| Improve this Doc View SourceGetCurrentTick()
The current Tick this layer is in
Declaration
public virtual 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.
This layer was successfully added to its container.
Declaration
public virtual 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
public virtual void SetCurrentTick(long currentStep)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | currentStep | A positive number |