public interface ExtRootModelAgent extends AgentExtension
P_AGENT_INTERACTIVE_DELEGATE, P_AGENT_WITH_SPATIAL_METRICS_DELEGATE, P_AGENT_WITH_SPECIFIC_SPACE, P_AGENT_WITH_SPECIFIC_SPACE_DELEGATE, P_ENTITY_DELEGATE, P_ENV_WITH_SPECIFIC_SPACE, P_ROOT, P_SPACE, P_USER_EXT
Modifier and Type | Method and Description |
---|---|
void |
addDestroyListener(AgentDestroyListener listener)
Adds listener for top-level agent destroy.
|
<T> T |
getCustomObject(java.lang.Object requestor)
Returns custom object previously set by
setCustomObject(Object, Object) |
default <T> T |
getCustomObject(java.lang.Object requestor,
java.util.function.Supplier<T> initializer)
Returns custom object previously set by
setCustomObject(Object, Object)
or creates a new one using the given initializer |
AgentList<Agent> |
getDefaultPopulation()
Returns 'default population' which e.g. takes agents created dynamically in flowcharts.
|
void |
removeDestroyListener(AgentDestroyListener listener)
Adds listener for top-level agent destroy
|
<T> T |
setCustomObject(java.lang.Object requestor,
T object)
Registers some custom object for the given
requestor
Throws error if requestor is null |
getAgent, next_xjal, onDestroy, onExtensionRemoved, priority, setNext_xjal, supportsInterface_xjal
AgentList<Agent> getDefaultPopulation()
@AnyLogicInternalAPI void addDestroyListener(AgentDestroyListener listener)
Serializable
@AnyLogicInternalAPI void removeDestroyListener(AgentDestroyListener listener)
@AnyLogicInternalAPI <T> T getCustomObject(java.lang.Object requestor)
setCustomObject(Object, Object)
requestor
- any not null
object, usually some agent or class,
should be Serializable
requestor
@AnyLogicInternalAPI default <T> T getCustomObject(java.lang.Object requestor, java.util.function.Supplier<T> initializer)
setCustomObject(Object, Object)
or creates a new one using the given initializer
requestor
- any not null
object, usually some agent or class,
should be Serializable
initializer
- initializer, used when custom object is not registered. Initializer
should return Serializable
objectrequestor
@AnyLogicInternalAPI <T> T setCustomObject(java.lang.Object requestor, T object)
requestor
Throws error if requestor
is null
requestor
- any not null
object, usually some agent or class,
should be Serializable
object
- custom object for the given requestor
, use null
to unregister custom object of requestor, should be Serializable
requestor
or otherwise null
Copyright © AnyLogic North America, LLC. All Rights Reserved.