AnyLogic
Expand
Font size
All Implemented Interfaces:
AgentExtension, Serializable
Direct Known Subclasses:
ExtAgentContinuousDelegate, ExtAgentWithSpatialMetricsDelegate

@AnyLogicInternalAPI
public abstract class AgentExtensionImpl
extends Object
implements AgentExtension, Serializable
Base class for extensions of Agents.
Please note that agent, during its lifetime, may change instances of some extensions (e.g. replace existing extension with its subclass), so you shouldn't store references to extensions anywhere. Please store references to agent instead.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Field Summary

Constructor Summary

ConstructorDescription
AgentExtensionImpl(Agent owner) 

Method Summary

Modifier and TypeMethodDescription
RuntimeExceptionerror(String errorText) 
RuntimeExceptionerror(String errorTextFormat, Object... args) 
AgentgetAgent()
Returns the agent this extension belongs to
static Set<Class<?>>getSupportedInterfaces_xjal(Class<? extends AgentExtension> extClass)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
final AgentExtensionnext_xjal()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future
voidonDestroy()
This method is called when the owner of this extension is destroyed.
Should be overridden when custom destroy is required.
Default implementation does nothing
voidonExtensionRemoved(AgentExtension ext)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Default implementation does nothing
intpriority()
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
final voidsetNext_xjal(AgentExtension next)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future
booleansupportsInterface_xjal(Class<?> itfs)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

Methods inherited from class java.lang.Object

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

Constructor Details

AgentExtensionImpl

public AgentExtensionImpl(Agent owner)

Method Details

getAgent

public Agent getAgent()
Returns the agent this extension belongs to
Specified by:
getAgent in interface AgentExtension
Returns:
the agent this extension belongs to

supportsInterface_xjal

@AnyLogicInternalAPI
public boolean supportsInterface_xjal(Class<?> itfs)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Specified by:
supportsInterface_xjal in interface AgentExtension

getSupportedInterfaces_xjal

@AnyLogicInternalAPI
public static Set<Class<?>> getSupportedInterfaces_xjal(Class<? extends AgentExtension> extClass)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.

error

public RuntimeException error(String errorText)
See Also:
Utilities.error(String)

error

public RuntimeException error(String errorTextFormat,
 Object... args)
See Also:

onDestroy

@AnyLogicInternalAPI
public void onDestroy()
This method is called when the owner of this extension is destroyed.
Should be overridden when custom destroy is required.
Default implementation does nothing
Specified by:
onDestroy in interface AgentExtension

next_xjal

@AnyLogicInternalAPI
public final AgentExtension next_xjal()
Description copied from interface: AgentExtension
This method is internal and shouldn't be called by user.
it may be removed/renamed in future
Specified by:
next_xjal in interface AgentExtension

setNext_xjal

@AnyLogicInternalAPI
public final void setNext_xjal(AgentExtension next)
Description copied from interface: AgentExtension
This method is internal and shouldn't be called by user.
it may be removed/renamed in future
Specified by:
setNext_xjal in interface AgentExtension

priority

@AnyLogicInternalAPI
public int priority()
Description copied from interface: AgentExtension
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
This function is used for sorting extensions (in order for the overriding delegation to work)
Specified by:
priority in interface AgentExtension
Returns:
int value, see also P_* constants

onExtensionRemoved

@AnyLogicInternalAPI
public void onExtensionRemoved(AgentExtension ext)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
Default implementation does nothing
Specified by:
onExtensionRemoved in interface AgentExtension
Parameters:
ext - the extension which has just been removed
See Also: