Package com.anylogic.engine
- All Superinterfaces:
AgentExtension
,java.io.Serializable
public interface ExtRootModelAgent extends AgentExtension
This extension may be defined only in the top-level agent of the model.
It owns 'default population' which e.g. takes agents created dynamically in flowcharts.
- Author:
- AnyLogic North America, LLC https://anylogic.com
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
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.
|
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 |
Modifier and Type | Method | Description |
---|
getAgent, next_xjal, onDestroy, onExtensionRemoved, priority, setNext_xjal, supportsInterface_xjal
AgentList<Agent> getDefaultPopulation()
Returns 'default population' which e.g. takes agents created dynamically in flowcharts.
- Returns:
- default population of top-level agent of the model
@AnyLogicInternalAPI void addDestroyListener(AgentDestroyListener listener)
Adds listener for top-level agent destroy. Listener should be
Serializable
@AnyLogicInternalAPI void removeDestroyListener(AgentDestroyListener listener)
Adds listener for top-level agent destroy
@AnyLogicInternalAPI <T> T getCustomObject(java.lang.Object requestor)
Returns custom object previously set by
setCustomObject(Object, Object)
- Parameters:
requestor
- any notnull
object, usually some agent or class, should beSerializable
- Returns:
- custom object for the given
requestor
@AnyLogicInternalAPI 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
- Parameters:
requestor
- any notnull
object, usually some agent or class, should beSerializable
initializer
- initializer, used when custom object is not registered. Initializer should returnSerializable
object- Returns:
- custom object for the given
requestor
@AnyLogicInternalAPI <T> T setCustomObject(java.lang.Object requestor, T object)
Registers some custom object for the given
requestor
Throws error if requestor
is null
- Parameters:
requestor
- any notnull
object, usually some agent or class, should beSerializable
object
- custom object for the givenrequestor
, usenull
to unregister custom object of requestor, should beSerializable
- Returns:
- object previously registered for
requestor
or otherwisenull
-
How can we improve this article?
-