Interface IModelContainer
The model container is responsible to manage all model descriptions, including
configurations for the simulation
and to get static infos from them (e.g. the existing constructors, public properties,...)
Inherited Members
System.IDisposable.Dispose()
Assembly: Mars.Core.dll
Syntax
public interface IModelContainer : IDisposable
Properties
|
Improve this Doc
View Source
ModelDescription
Gets the current used model description, containing all
information's about used types and their dependencies.
Declaration
ModelDescription ModelDescription { get; }
Property Value
Methods
|
Improve this Doc
View Source
AddAgent<TAgent, TLayer>()
Adds an agent type to the containers with the typename as identifier
and the layer type where the agent type lies on.
Declaration
AgentType AddAgent<TAgent, TLayer>()
where TAgent : class, IAgent where TLayer : class, ILayer
Returns
Type Parameters
| Name |
Description |
| TAgent |
The agent type to add |
| TLayer |
The layer type where the agent lies on |
|
Improve this Doc
View Source
AddAgent<TAgent, TLayer>(String)
Adds an agent type to the containers with the specified name
and the layer type where the agent type lies on
Declaration
AgentType AddAgent<TAgent, TLayer>(string name)
where TAgent : class, IAgent where TLayer : class, ILayer
Parameters
| Type |
Name |
Description |
| System.String |
name |
A name of the agent type, can differ from exact type name |
Returns
Type Parameters
| Name |
Description |
| TAgent |
The agent type to add |
| TLayer |
The layer type where the agent lies on |
|
Improve this Doc
View Source
AddEntity<TEntity>()
Adds an entity type to the container with typename as identifier.
Declaration
EntityType AddEntity<TEntity>()
where TEntity : class, IEntity, new()
Returns
Type Parameters
| Name |
Description |
| TEntity |
The actual entity type to add |
|
Improve this Doc
View Source
AddEntity<TEntity>(String)
Adds an entity type to the container with the specified name.
Declaration
EntityType AddEntity<TEntity>(string name)
where TEntity : class, IEntity, new()
Parameters
| Type |
Name |
Description |
| System.String |
name |
The optional differ name of the type |
Returns
Type Parameters
| Name |
Description |
| TEntity |
The actual layer type to add |
|
Improve this Doc
View Source
AddLayer<TLayer>(String, IEnumerable<Type>)
Adds a layer type to the container with the specified name
and their optional construction dependencies
Declaration
LayerType AddLayer<TLayer>(string name, IEnumerable<Type> interfaces = null)
where TLayer : ILayer
Parameters
| Type |
Name |
Description |
| System.String |
name |
The optional differ name of the type |
| System.Collections.Generic.IEnumerable<System.Type> |
interfaces |
All explicit implemented interfaces or null if no interfaces were used |
Returns
Type Parameters
| Name |
Description |
| TLayer |
The actual layer type to add |
|
Improve this Doc
View Source
AddLayer<TLayer>(Type[])
Adds a layer type to the container with typename as identifier
and their optional explicit interface implementations
Declaration
LayerType AddLayer<TLayer>(params Type[] interfaces)
where TLayer : class, ILayer
Parameters
| Type |
Name |
Description |
| System.Type[] |
interfaces |
All explicit implemented interfaces or null if no interfaces were used |
Returns
Type Parameters
| Name |
Description |
| TLayer |
The actual layer type to add |
|
Improve this Doc
View Source
BuildOrder(ModelDescription)
Calculates the dependency order of the Layer types within the passed model description
Declaration
IList<LayerType> BuildOrder(ModelDescription description)
Parameters
| Type |
Name |
Description |
| ModelDescription |
description |
model description with layer types |
Returns
| Type |
Description |
| System.Collections.Generic.IList<LayerType> |
A System.Collections.Generic.List<T> or null if no layer in model description was specified |
|
Improve this Doc
View Source
CreateModel(ModelDescription, SimulationConfig)
Declaration
IList<TypeMapping> CreateModel(ModelDescription description, SimulationConfig config)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.IList<TypeMapping> |
A collection with mapped types |
|
Improve this Doc
View Source
CreateModel(ModelDescription, String)
Declaration
SimulationConfig CreateModel(ModelDescription description, string config)
Parameters
| Type |
Name |
Description |
| ModelDescription |
description |
The model description to set |
| System.String |
config |
The config as json or yaml as direct content or file path |
Returns
|
Improve this Doc
View Source
Match(ModelDescription, SimulationConfig)
Matches the the type mappings of the to their respective
types of the
Declaration
IList<TypeMapping> Match(ModelDescription description, SimulationConfig config)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.IList<TypeMapping> |
A collection with mapped types |
|
Improve this Doc
View Source
Validate(ModelDescription, SimulationConfig)
Validates the model itself, the simulation config itself and their mapping between
to check whether the existing simulation config matches the model description
Declaration
IList<ValidationResult> Validate(ModelDescription description, SimulationConfig config)
Parameters
Returns
| Type |
Description |
| System.Collections.Generic.IList<ValidationResult> |
Collection of warning and infos identified by the validation |
Extension Methods