Package com.anylogic.engine
- java.lang.Object
-
- com.anylogic.engine.AgentExtensionFactory<T>
public abstract class AgentExtensionFactory<T extends AgentExtension>
extends java.lang.Object
AgentExtensionFactory() |
|
Constructor | Description |
---|
abstract T |
create(Agent owner) |
This method should create an extension for the given agent.
If designed, this method may perform check for compatibility with existing agent extensions and may throw error (e.g. |
static <T extends AgentExtension> |
get(java.lang.Class<T> c) |
|
static <T extends AgentExtension> |
register(java.lang.Class<T> c,
AgentExtensionFactory<? extends T> factory) |
Registers new extension factory.
|
Modifier and Type | Method | Description |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public AgentExtensionFactory()
public static <T extends AgentExtension> void register(java.lang.Class<T> c, AgentExtensionFactory<? extends T> factory)
Registers new extension factory. The reference to the given factory will be stored
until Java Virtual Machine shutdown. Hence, the factory instance shouldn't have
any references to a particular model and/or simulation results.
- Parameters:
c
- agent extension classfactory
- factory instance
@AnyLogicInternalAPI public static <T extends AgentExtension> AgentExtensionFactory<? extends T> get(java.lang.Class<T> c)
public abstract T create(Agent owner)
This method should create an extension for the given agent.
If designed, this method may perform check for compatibility with existing agent extensions and may throw error (e.g. requested "Discrete space Agent" while the object already has "Continuous space Agent" extension).
Implementation may invoke nested ext() calls on the agent -- e.g. in cases when it is based on some extension (like "Entity" is based on "Continuous space Agent")
If designed, this method may perform check for compatibility with existing agent extensions and may throw error (e.g. requested "Discrete space Agent" while the object already has "Continuous space Agent" extension).
Implementation may invoke nested ext() calls on the agent -- e.g. in cases when it is based on some extension (like "Entity" is based on "Continuous space Agent")
- Parameters:
owner
-- Returns:
- new agent extension
-
How can we improve this article?
-