• MARS Website
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Show / Hide Table of Contents
  • Mars.Core
    • DependencyRegistrationCore
  • Mars.Core.Data
    • AbstractConfigLoader
    • AbstractEntityManager
    • AgentManagerImpl
    • DomainDataMediatorImpl
    • EntityManagerImpl
    • IAgentManager
    • IEntityManager
    • IEntityMapping
    • IGeneratedEntityLogger
    • IGeneratedLayerLogger
    • IGeneratedLogger<TModel>
    • IGeneratedTypeLogger
    • IModelCompiler
    • IOutputLogger
    • IPlatformSelector
    • ISchemaMigrationProvider
    • ISerializerManager
    • PlatformSelectorImpl
  • Mars.Core.Data.Compiler
    • AbstractEntityMapper
    • AbstractJitMapper
    • AbstractLayerMapper
    • AbstractMapper<TModel>
    • AbstractTypeMapper
    • RoslynCompilerUtils
  • Mars.Core.Data.Entities
    • CircleFilter
    • Condition
    • ConjunctiveWhere
    • DataFrame
    • DisjunctiveWhere
    • EqualityCondition
    • IntersectionFilter
    • ISelection
    • NearestFilter
    • Query
    • WindowFilter
    • WithinFilter
  • Mars.Core.Data.Exceptions
    • AgentInitializationException
  • Mars.Core.Data.Mapping
    • DefaultSourceProvider
    • ReflectiveMapping
  • Mars.Core.Data.Wrapper
    • AbstractOperationWrapper
    • AbstractWrapper
    • AbstractWrapper<TOptions>
    • GlobalRestrictions
    • ICircleQueryOperation
    • IIntersectionOperation
    • ILookupOperation
    • INearestOperation
    • IOperation
    • IPlatform
    • IQueryOperation
    • ISnapshot
    • IWindowQueryOperation
    • IWithinOperation
    • IWrapper
    • KnnGraphWrapper
    • PostGisWrapper
  • Mars.Core.Data.Wrapper.Document
    • IMongoConnection
    • IMongoWrapper
    • MongoDbIteratorHelper
    • MongoDbWrapper
  • Mars.Core.Data.Wrapper.File
    • AbstractFileWrapper<TOptions>
    • AscWrapper
    • GeoJsonWrapper
  • Mars.Core.Data.Wrapper.Memory
    • DataTableWrapper
    • GeoHashTrieWrapper
    • KdTreeWrapper
    • TripPosition
    • TripPositionCoordinateConverter
    • TripsCollection
    • TripsLineConverter
    • TripsTrajectoryWrapper
  • Mars.Core.Data.Wrapper.Relational
    • AbstractRelationalConnection
    • PostgresSqlDbConnection
    • PostgresSqlWrapper
    • RelationalMapperException
    • RelationalSqlWrapper<TOptions>
    • SqliteDbConnection
    • SqliteWrapper
  • Mars.Core.Data.Wrapper.Stream
    • MqttWrapper
    • SimulationTypeInfo
  • Mars.Core.Executor
    • IRuntimeModel
    • ISimulationProgress
    • IStepExecutor
  • Mars.Core.Executor.Entities
    • Parametrization
    • StepParam
  • Mars.Core.Executor.Implementation
    • RuntimeModelImpl
    • SimulationProgressImpl
    • StepExecutionUseCase
  • Mars.Core.Model
    • IConfigLoader
    • IModelContainer
    • IModelResolver
  • Mars.Core.Model.Entities
    • LayerInstanceContainer
  • Mars.Core.Model.Exceptions
    • InvalidMappingException
    • MissingConstructorException
    • ModelResolutionException
    • ValidationException
  • Mars.Core.Model.Implementation
    • DependencyBuilder
    • MappingHelper
    • ModelContainer
    • ValidationIssueLevel
    • ValidationResult
    • Validator
  • Mars.Core.Simulation
    • ISimulation
    • ISimulationControl
  • Mars.Core.Simulation.Entities
    • SimulationRestartArgs
    • SimulationWorkflowState

Class ModelContainer

Inheritance
System.Object
ModelContainer
Implements
IModelContainer
IModelResolver
System.IDisposable
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.Core.Model.Implementation
Assembly: Mars.Core.dll
Syntax
public class ModelContainer : IModelContainer, IModelResolver, IDisposable

Constructors

| Improve this Doc View Source

ModelContainer()

Creates a new empty IModelContainer
Declaration
public ModelContainer()
| Improve this Doc View Source

ModelContainer(IConfigLoader)

Declaration
public ModelContainer(IConfigLoader configLoader)
Parameters
Type Name Description
IConfigLoader configLoader

Properties

| Improve this Doc View Source

ConfigLoader

Gets the current inputConfiguration repository
Declaration
public IConfigLoader ConfigLoader { get; }
Property Value
Type Description
IConfigLoader
| Improve this Doc View Source

Layers

Gets all resolved layer instances of this simulation.
Declaration
public IDictionary<Type, ILayer> Layers { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<System.Type, ILayer>
| Improve this Doc View Source

ModelDescription

Retrieve model description as the root object
Declaration
public ModelDescription ModelDescription { get; }
Property Value
Type Description
ModelDescription

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
public AgentType AddAgent<TAgent, TLayer>()
    where TAgent : class, IAgent where TLayer : class, ILayer
Returns
Type Description
AgentType
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
public 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 Description
AgentType
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 a layer type to the container with typename as identifier and their optional explicit interface implementations
Declaration
public EntityType AddEntity<TEntity>()
    where TEntity : class, IEntity, new()
Returns
Type Description
EntityType
Type Parameters
Name Description
TEntity The actual layer type to add
| Improve this Doc View Source

AddEntity<TEntity>(String)

Adds a layer type to the container with the specified name and their optional construction dependencies
Declaration
public 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 Description
EntityType
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
public 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 Description
LayerType
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
public 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 Description
LayerType
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
public 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)

CreateModel(ModelDescription, String)
Declaration
public IList<TypeMapping> CreateModel(ModelDescription description, SimulationConfig config)
Parameters
Type Name Description
ModelDescription description Static description of all model types
SimulationConfig config Execution parametrization inputConfiguration
Returns
Type Description
System.Collections.Generic.IList<TypeMapping> A collection with mapped types
| Improve this Doc View Source

CreateModel(ModelDescription, String)

Creates and persists the passed ModelDescription and associates the specified simulation config as a deserialized SimulationConfig
Declaration
public 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
Type Description
SimulationConfig
| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

Match(ModelDescription, SimulationConfig)

Matches the the type mappings of the to their respective types of the
Declaration
public IList<TypeMapping> Match(ModelDescription description, SimulationConfig config)
Parameters
Type Name Description
ModelDescription description The target model description
SimulationConfig config The source inputConfiguration for mapping
Returns
Type Description
System.Collections.Generic.IList<TypeMapping> A collection with mapped types
| Improve this Doc View Source

Resolve(ModelDescription)

Resolve the layer dependency graph and creates layer instances with their expected parameters and dependencies
Declaration
public LayerInstanceContainer Resolve(ModelDescription modelDescription)
Parameters
Type Name Description
ModelDescription modelDescription
Returns
Type Description
LayerInstanceContainer
| 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
public IList<ValidationResult> Validate(ModelDescription description, SimulationConfig config)
Parameters
Type Name Description
ModelDescription description The model description of types
SimulationConfig config The config for the model adjustment and mapping
Returns
Type Description
System.Collections.Generic.IList<ValidationResult> Collection of warning and infos identified by the validation

Implements

IModelContainer
IModelResolver
System.IDisposable

Extension Methods

Serializer.Save<T>(T, out Byte[], SerializerCompression)
Serializer.Save<T>(T, Stream, SerializerCompression)
Serializer.Save<T>(T, BinaryFormatter, Stream, SerializerCompression)
Serializer.Save<T>(T, String, SerializerCompression)
Serializer.Save<T>(T, String)
Matrix.Concatenate<T>(T, T[])
Matrix.Replace<T>(T, Object, Object)
DomainDataImporter.Import(Object, InputConfiguration)
ObjectSerialize.Serialize(Object)
Matrix.IsEqual(Object, Object, Decimal, Decimal)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg