Package com.anylogic.engine
- All Superinterfaces:
AgentExtension
,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
Modifier and Type | Method | Description |
---|---|---|
void | addDestroyListener |
Adds listener for top-level agent destroy.
|
<T> T | getCustomObject |
Returns custom object previously set by
setCustomObject(Object, Object) |
default <T> T | getCustomObject |
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 |
Adds listener for top-level agent destroy
|
<T> T | setCustomObject |
Registers some custom object for the given
requestor
Throws error if requestor is null |
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(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(Object requestor, 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(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