Package com.anylogic.engine
- java.lang.Object
- com.anylogic.engine.AgentExtensionFactory<T>
public abstract class AgentExtensionFactory<T extends AgentExtension> extends Object
Constructor | Description |
---|---|
AgentExtensionFactory() |
Modifier and Type | Method | Description |
---|---|---|
abstract T | create |
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 | |
static <T extends AgentExtension> | register |
Registers new extension factory.
|
public AgentExtensionFactory()
public static <T extends AgentExtension> void register(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(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