Package com.anylogic.engine
- java.lang.Object
- com.anylogic.engine.EventOriginator
- com.anylogic.engine.DynamicEvent
- All Implemented Interfaces:
AgentDestroyListener
,Serializable
public class DynamicEvent extends EventOriginator implements AgentDestroyListener
This class is a base class for dynamic events created by the user. Dynamic events
are used to schedule any number of concurrent and independent events; a typical
object that uses dynamic event would be a Delay object that can delay arbitrary
number of entities concurrently. The event gets scheduled when a DynamicEvent is
instantiated. Upon execution of the dynamic event the instance is deleted.
When the
Memory: sizeof(EventOriginator) = 22 bytes + sizeof(HashSet entry - in AO) + user data
Agent
is destroyed, all dynamic events belonging to it are discarded.Memory: sizeof(EventOriginator) = 22 bytes + sizeof(HashSet entry - in AO) + user data
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
DynamicEvent |
A base class constructor for dynamic events.
|
DynamicEvent |
A base class constructor for dynamic events.
|
DynamicEvent |
A base class constructor for dynamic events.
|
DynamicEvent |
A base class constructor for dynamic events.
|
Modifier and Type | Method | Description |
---|---|---|
void | execute() |
This method should be implemented at the subclass with a necessary call to
super.execute() at the beginning.
|
String | getName() |
Returns the name of the dynamic event - actually, the simple name of the
dynamic event class.
|
void | onDestroy |
This method is internal and shouldn't be called by user.
it may be removed/renamed in future. |
void | reset() |
Discards the scheduled occurrence of the event unregisters this
dynamic event at the agent
|
public DynamicEvent(Agent ao, double dt)
A base class constructor for dynamic events. The constructor of the subclass
must call "super( agent, timeout )". Schedules the event in the timeout
specified.
- Parameters:
ao
- agent - event ownerdt
- the timeout
public DynamicEvent(Agent ao, double dt, TimeUnits units)
A base class constructor for dynamic events. The constructor of the subclass
must call "super( agent, timeout )". Schedules the event in the timeout
specified.
- Parameters:
ao
- agent - event ownerunits
- the units of timedt
- the timeout
public DynamicEvent(Agent ao, double t, boolean absoluteTime)
A base class constructor for dynamic events. The constructor of the subclass
must call "super( agent, timeout )". Schedules the event in the timeout
specified.
- Parameters:
ao
- agent - event ownert
- the absolute time or timeout, depending onabsoluteTime
parameterabsoluteTime
-true
to schedule to the given time,false
- to the current time + given timeout
public DynamicEvent(Agent ao, double t, TimeUnits units, boolean absoluteTime)
A base class constructor for dynamic events. The constructor of the subclass
must call "super( agent, timeout )". Schedules the event in the timeout
specified.
- Parameters:
ao
- agent - event ownert
- the absolute time or timeout, depending onabsoluteTime
parameterunits
- the units of timeabsoluteTime
-true
to schedule to the given time,false
- to the current time + given timeout
public String getName()
Returns the name of the dynamic event - actually, the simple name of the
dynamic event class.
- Specified by:
getName
in classEventOriginator
- Returns:
- The name of the dynamic event.
public void reset()
Discards the scheduled occurrence of the event unregisters this
dynamic event at the agent
@AnyLogicInternalAPI public void execute()
This method should be implemented at the subclass with a necessary call to
super.execute() at the beginning.
@AnyLogicInternalAPI public void onDestroy(Agent agent)
This method is internal and shouldn't be called by user.
it may be removed/renamed in future.
it may be removed/renamed in future.
- Specified by:
onDestroy
in interfaceAgentDestroyListener