Interface IAgentManager
This component is designed to be used by the modeller to retrieve, create, update or delete agent
entity within the environment.
Assembly: Mars.Core.dll
Syntax
public interface IAgentManager
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. |
|
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
|
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. |
|
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. |
|
Improve this Doc
View Source
Spawn<TAgent, TLayer>(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. |
Extension Methods