Interface IEntityMapping
Generic input/output mapping component, responsible to manage all connected services in order
to access them to read entities or to write entity states in multi-store manner.
Inherited Members
System.IDisposable.Dispose()
Namespace: Mars.Core.Data
Assembly: Mars.Core.dll
Syntax
public interface IEntityMapping : IDisposable
Methods
| Improve this Doc View SourceDeRegisterEntity(IEntity, TypeElement)
Unregisters an entity object from the I/O mapper.
Declaration
void DeRegisterEntity(IEntity entity, TypeElement type)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The entity to remove. |
TypeElement | type | The corresponding type of the entity. |
DeRegisterLayer(ILayer, LayerType)
Unregisters a layer object from the entity I/O mapper.
Declaration
void DeRegisterLayer(ILayer layer, LayerType type)
Parameters
Type | Name | Description |
---|---|---|
ILayer | layer | The layer object to remove. |
LayerType | type | The corresponding type of the layer. |
Initialize(ModelDescription, SimulationConfig)
Initialize the result output for the passed ModelDescription
and their SimulationConfig.
Declaration
void Initialize(ModelDescription description, SimulationConfig config)
Parameters
Type | Name | Description |
---|---|---|
ModelDescription | description | The description containing all types. |
SimulationConfig | config | The simulation config containing all relevant runtime information's. |
RegisterEntity(IEntity, TypeElement, TypeMapping)
Register a simulation object at the result adapter.
Declaration
IGeneratedEntityLogger RegisterEntity(IEntity entity, TypeElement type, TypeMapping mapping = null)
Parameters
Type | Name | Description |
---|---|---|
IEntity | entity | The simulation entity to add to output queue. |
TypeElement | type | The description of the type from which this entity is an instance. |
TypeMapping | mapping | The type-specific configuration. |
Returns
Type | Description |
---|---|
IGeneratedEntityLogger |
RegisterLayer(ILayer, LayerType, Int32)
Register a layer object at the result adapter.
Declaration
IGeneratedLayerLogger RegisterLayer(ILayer layer, LayerType type, int outputFrequency = 1)
Parameters
Type | Name | Description |
---|---|---|
ILayer | layer | The layer entity to add to output queue. |
LayerType | type | The layer type responsible for the concrete instance. |
System.Int32 | outputFrequency | Output tick frequency of the layer. |
Returns
Type | Description |
---|---|
IGeneratedLayerLogger |
RegisterType(TypeElement, Int32)
Registers an agent type where each instance their result output will be handled by this configuration
if its not registered individually by apply RegisterEntity(IEntity, TypeElement, TypeMapping).
Declaration
IGeneratedTypeLogger RegisterType(TypeElement type, int executionGroup = 1)
Parameters
Type | Name | Description |
---|---|---|
TypeElement | type | The static AgentType description. |
System.Int32 | executionGroup | The output tick frequency after each tick the instance shall be persisted. |
Returns
Type | Description |
---|---|
IGeneratedTypeLogger |
SimulationFinished()
The simulation has finished. Tear down / finalization method.
Declaration
void SimulationFinished()
WriteResults(Int64, Int64, Nullable<DateTime>)
Fetch all tick results and write them to the database.
Declaration
void WriteResults(long currentTick, long currentStep, DateTime? currentDate)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | currentTick | The current tick. Needed for sanity check. |
System.Int64 | currentStep | The current model simulation step |
System.Nullable<System.DateTime> | currentDate | The current concrete time point if realtime related |