Class AgentManager
Contains methods to create IEntity instances
from a given input and agent type
Inheritance
System.Object
AgentManager
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.Components.Services
Assembly: Mars.Components.dll
Syntax
public static class AgentManager
Methods
| Improve this Doc View SourceCreateAgents<T>(AgentMapping, RegisterAgent, UnregisterAgent, List<ILayer>, List<IEnvironment>, Int32)
Creates a set of agent with unique identifier according to the inputConfiguration
and optional input data within a AgentMapping
Declaration
public static IDictionary<Guid, T> CreateAgents<T>(AgentMapping agentInitConfig, RegisterAgent registerAgentHandle, UnregisterAgent unregisterAgentHandle, List<ILayer> layerDependencies = null, List<IEnvironment> environments = null, int reducedCount = -1)
where T : IEntity
Parameters
Type | Name | Description |
---|---|---|
AgentMapping | agentInitConfig | Configuration for agent creation, contains the reference to the input data |
RegisterAgent | registerAgentHandle | Handle to register the agent entity within the execution system |
UnregisterAgent | unregisterAgentHandle | Handle to unregister the agent entity and remove it from the execution system |
System.Collections.Generic.List<ILayer> | layerDependencies | Optional layer dependencies of the agent type |
System.Collections.Generic.List<IEnvironment> | environments | Optional environment dependencies for spatial operation e.g. movement and exploration |
System.Int32 | reducedCount | Optional specified amount of agent instances to create according to the available data within the AgentMapping |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Guid, T> | A System.Collections.Generic.IDictionary<TKey, TValue> unique identifiable agent entities |
Type Parameters
Name | Description |
---|---|
T | The type from which instances shall be created |
Exceptions
Type | Condition |
---|---|
AgentInitializationException |
No available constructor of |
GetAgentsByAgentInitConfig<T>(AgentMapping, RegisterAgent, UnregisterAgent, List<ILayer>, IEnvironment, Int32)
Contains methods to create IEntity instances
from a given input and agent type
Declaration
public static ConcurrentDictionary<Guid, T> GetAgentsByAgentInitConfig<T>(AgentMapping agentInitConfig, RegisterAgent registerAgentHandle, UnregisterAgent unregisterAgentHandle, List<ILayer> layerDependencies = null, IEnvironment environment = null, int reducedCount = -1)
where T : IEntity
Parameters
Type | Name | Description |
---|---|---|
AgentMapping | agentInitConfig | |
RegisterAgent | registerAgentHandle | |
UnregisterAgent | unregisterAgentHandle | |
System.Collections.Generic.List<ILayer> | layerDependencies | |
IEnvironment | environment | |
System.Int32 | reducedCount |
Returns
Type | Description |
---|---|
System.Collections.Concurrent.ConcurrentDictionary<System.Guid, T> |
Type Parameters
Name | Description |
---|---|
T |
SpawnAgents(AgentMapping, RegisterAgent, UnregisterAgent, List<ILayer>, List<IEnvironment>, Int32)
Creates and register the agent set of the specified type within the AgentMapping type with the
layer type out of the type description
Declaration
public static IDictionary<Guid, IAgent> SpawnAgents(AgentMapping agentInitConfig, RegisterAgent registerAgentHandle, UnregisterAgent unregisterAgentHandle, List<ILayer> layerDependencies = null, List<IEnvironment> environments = null, int reducedCount = -1)
Parameters
Type | Name | Description |
---|---|---|
AgentMapping | agentInitConfig | Configuration for agent creation, contains the reference to the input data |
RegisterAgent | registerAgentHandle | Handle to register the agent entity within the execution system |
UnregisterAgent | unregisterAgentHandle | Handle to unregister the agent entity and remove it from the execution system |
System.Collections.Generic.List<ILayer> | layerDependencies | Optional layer dependencies of the agent type |
System.Collections.Generic.List<IEnvironment> | environments | Optional environment dependencies for spatial operation e.g. movement and exploration |
System.Int32 | reducedCount | Optional specified amount of agent instances to create according to the available data within the AgentMapping |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Guid, IAgent> | A System.Collections.Generic.IDictionary<TKey, TValue> unique identifiable agent entities |
Exceptions
Type | Condition |
---|---|
AgentInitializationException | No available constructor of IAgent or missing input data for creation |
SpawnAgents<T>(AgentMapping, RegisterAgent, UnregisterAgent, List<ILayer>, List<IEnvironment>, Int32)
Creates and register the agent set of the specified type with the
layer type out of the type description
Declaration
public static IDictionary<Guid, T> SpawnAgents<T>(AgentMapping agentInitConfig, RegisterAgent registerAgentHandle, UnregisterAgent unregisterAgentHandle, List<ILayer> layerDependencies = null, List<IEnvironment> environments = null, int reducedCount = -1)
where T : IAgent
Parameters
Type | Name | Description |
---|---|---|
AgentMapping | agentInitConfig | Configuration for agent creation, contains the reference to the input data |
RegisterAgent | registerAgentHandle | Handle to register the agent entity within the execution system |
UnregisterAgent | unregisterAgentHandle | Handle to unregister the agent entity and remove it from the execution system |
System.Collections.Generic.List<ILayer> | layerDependencies | Optional layer dependencies of the agent type |
System.Collections.Generic.List<IEnvironment> | environments | Optional environment dependencies for spatial operation e.g. movement and exploration |
System.Int32 | reducedCount | Optional specified amount of agent instances to create according to the available data within the AgentMapping |
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.Guid, T> | A System.Collections.Generic.IDictionary<TKey, TValue> unique identifiable agent entities |
Type Parameters
Name | Description |
---|---|
T | The type from which instances shall be created |
Exceptions
Type | Condition |
---|---|
AgentInitializationException |
No available constructor of |