AnyLogic AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.AgentExtensionFactory<T>

public abstract class AgentExtensionFactory<T extends AgentExtension>
extends java.lang.Object

Constructor Summary

Constructors 
AgentExtensionFactory()  
Constructor Description

Method Summary

All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
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")
static <T extends AgentExtension>
AgentExtensionFactory<? extends T>
get​(java.lang.Class<T> c)  
static <T extends AgentExtension>
void
register​(java.lang.Class<T> c, AgentExtensionFactory<? extends T> factory)
Registers new extension factory.
Modifier and Type Method Description

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

AgentExtensionFactory

public AgentExtensionFactory()

Method Detail

register

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 class
factory - factory instance

get

@AnyLogicInternalAPI
public static <T extends AgentExtensionAgentExtensionFactory<? extends T> get​(java.lang.Class<T> c)

create

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")
Parameters:
owner -
Returns:
new agent extension
How can we improve this article?