• 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

Interface IAgentManager

This component is designed to be used by the modeller to retrieve, create, update or delete agent entity within the environment.
Namespace: Mars.Core.Data
Assembly: Mars.Core.dll
Syntax
public interface IAgentManager
Remarks
To get an instance of this IAgentManager use the ISimulationContainer given by the LayerInitData given the outer call on InitLayer(LayerInitData, RegisterAgent, UnregisterAgent) call.

Methods

| Improve this Doc View Source

Create<TAgent>(List<IModelObject>)

Creates a collection of agent instances. The instances can be created and assigned from data retrieved by the source within simulation config and their AgentMapping mapping. Alternatively this method just constructs objects in a lazy fashion as much as as are required.
Declaration
IEnumerable<TAgent> Create<TAgent>(List<IModelObject> dependencies = null)
    where TAgent : IAgent
Parameters
Type Name Description
System.Collections.Generic.List<IModelObject> dependencies The optional model-related dependencies such as references to layers and environments.
Returns
Type Description
System.Collections.Generic.IEnumerable<TAgent> Returns an iterator over the constructed agent instances which can further processed and be passed to e.g., the RegisterAgent handle.
Type Parameters
Name Description
TAgent The concrete agent type description.
Remarks
The instances are not yet registered at the runtime and therefore will not be triggered, unless the RegisterAgent is called on them.
| Improve this Doc View Source

Create<TAgent, TLayer>(IEnumerable<IDomainData>, List<IModelObject>, Action<TAgent>)

Creates a collection of agent instances from the given data set and and optional mappings within the simulation config. This method is similar to Create<TAgent>(List<IModelObject>) except that input data is not retrieved from the specified source in the simulation config, but passed directly to transform it to the model type.
Declaration
IEnumerable<TAgent> Create<TAgent, TLayer>(IEnumerable<IDomainData> data, List<IModelObject> dependencies, Action<TAgent> assignment = null)
    where TAgent : IAgent<TLayer>, new()
    where TLayer : ILayer
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IDomainData> data The collection of data partial objects required to construct the TAgent type.
System.Collections.Generic.List<IModelObject> dependencies The optional model-related dependencies such as references to layers and environments.
System.Action<TAgent> assignment The optional delegate to assign the agent with custom values, before the Init(TLayer) method will be called.
Returns
Type Description
System.Collections.Generic.IEnumerable<TAgent> Returns an iterator over the constructed agent instances which can further processed and be passed to e.g., the RegisterAgent handle.
Type Parameters
Name Description
TAgent The concrete agent type description.
TLayer The concrete layer type responsible an the dependency for this agent.
Remarks
The instances are not yet registered at the runtime and therefore will not be triggered, unless the RegisterAgent is called on them.
| Improve this Doc View Source

Create<TAgent, TLayer>(List<IModelObject>, Action<TAgent>)

Creates a collection of agent instances. The instances can be created and assigned from data retrieved by the source within simulation config and their AgentMapping mapping. Alternatively this method just constructs objects in a lazy fashion as much as as are required.
Declaration
IEnumerable<TAgent> Create<TAgent, TLayer>(List<IModelObject> dependencies = null, Action<TAgent> assignment = null)
    where TAgent : IAgent<TLayer>, new()
    where TLayer : ILayer
Parameters
Type Name Description
System.Collections.Generic.List<IModelObject> dependencies The optional model-related dependencies such as references to layers and environments.
System.Action<TAgent> assignment The optional delegate to assign the agent with custom values, before the Init(TLayer) method will be called.
Returns
Type Description
System.Collections.Generic.IEnumerable<TAgent> Returns an iterator over the constructed agent instances which can further processed and be passed to e.g., the RegisterAgent handle.
Type Parameters
Name Description
TAgent The concrete agent type description.
TLayer The concrete layer type responsible an the dependency for this agent.
Remarks
The instances are not yet registered at the runtime and therefore will not be triggered, unless the RegisterAgent is called on them.
| Improve this Doc View Source

Spawn<TAgent>(List<IModelObject>)

Creates a collection of agent instances and registers them, in order to get triggered by the runtime system. The creation of instances is equivalent to Create<TAgent>(List<IModelObject>).
Declaration
IEnumerable<TAgent> Spawn<TAgent>(List<IModelObject> dependencies = null)
    where TAgent : IAgent
Parameters
Type Name Description
System.Collections.Generic.List<IModelObject> dependencies The optional model-related dependencies such as references to layers and environments.
Returns
Type Description
System.Collections.Generic.IEnumerable<TAgent> Returns an iterator over the constructed agent instances which can further processed and be passed to e.g., the RegisterAgent handle.
Type Parameters
Name Description
TAgent The concrete agent type description.
Remarks
To get an instance of this IAgentManager use the ISimulationContainer given by the LayerInitData given the outer call on InitLayer(LayerInitData, RegisterAgent, UnregisterAgent) call.
| Improve this Doc View Source

Spawn<TAgent, TLayer>(List<IModelObject>, Action<TAgent>)

Creates a collection of agent instances and registers them, in order to get triggered by the runtime system. The creation of instances is equivalent to Create<TAgent, TLayer>(IEnumerable<IDomainData>, List<IModelObject>, Action<TAgent>).
Declaration
IEnumerable<TAgent> Spawn<TAgent, TLayer>(List<IModelObject> dependencies = null, Action<TAgent> assignment = null)
    where TAgent : IAgent<TLayer>, new()
    where TLayer : ILayer
Parameters
Type Name Description
System.Collections.Generic.List<IModelObject> dependencies The optional model-related dependencies such as references to layers and environments.
System.Action<TAgent> assignment The optional delegate to assign the agent with custom values, before the Init(TLayer) method will be called.
Returns
Type Description
System.Collections.Generic.IEnumerable<TAgent> Returns an iterator over the constructed agent instances which can further processed and be passed to e.g., the RegisterAgent handle.
Type Parameters
Name Description
TAgent The concrete agent type description.
TLayer The concrete layer type responsible an the dependency for this agent.
Remarks
To get an instance of this IAgentManager use the ISimulationContainer given by the LayerInitData given the outer call on InitLayer(LayerInitData, RegisterAgent, UnregisterAgent) call.

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