Package com.anylogic.engine
- java.lang.Object
-
- com.anylogic.engine.EventOriginator
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
DynamicEvent
,Event
,Transition
public abstract class EventOriginator
extends java.lang.Object
implements java.io.Serializable
Base class for all constructs in AnyLogic modeling language that are able
to schedule discrete events, like Event, DynamicEvent and Transition.
Memory: sizeof(Object) + 8 bytes = 22 bytes
Memory: sizeof(Object) + 8 bytes = 22 bytes
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
void |
cancel() |
Deprecated.
User should not call this method for events,
call
reset() instead |
Agent |
getActiveObject() |
Deprecated.
Use
getAgent() instead |
Agent |
getAgent() |
Returns the agent that owns the event originator.
|
java.lang.String |
getFullName() |
Returns the name of the event originator prefixed by the full name
of its agent.
|
abstract java.lang.String |
getName() |
Returns the name of the event originator, i.e.
|
double |
getRest() |
Returns the time remaining before the scheduled occurrence of the event, or
+infinity if the event is not scheduled. |
double |
getRest(TimeUnits units) |
Returns the time remaining before the scheduled occurrence of the event, or
+infinity if the event is not scheduled. |
boolean |
isActive() |
Returns
true if the event is currently scheduled by this event
originator, false otherwise. |
boolean |
isCurrent() |
Tests if the event is being currently executed, or just has been executed.
|
boolean |
isLoggingToDB() |
Return
true if the given event (or dynamic event) is logged to database
(note that this may be overridden by logging settings of Agent). |
void |
onDestroy() |
Discards the scheduled event, if any (deletes it from the engine).
|
java.lang.String |
toString() |
|
Modifier and Type | Method | Description |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public abstract java.lang.String getName()
Returns the name of the event originator, i.e. the name of an event or a
transition object specified by the user.
- Returns:
- The name of the event originator.
public java.lang.String getFullName()
Returns the name of the event originator prefixed by the full name
of its agent.
- Returns:
- The full name of the event.
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
public Agent getAgent()
Returns the agent that owns the event originator.
- Returns:
- The agent owning this event originator.
@Deprecated public Agent getActiveObject()
Deprecated.
Use
getAgent()
insteadpublic boolean isActive()
Returns
true
if the event is currently scheduled by this event
originator, false
otherwise.- Returns:
- The status of the event.
public boolean isCurrent()
Tests if the event is being currently executed, or just has been executed.
- Returns:
- true if the event is "current", false otherwise
public double getRest()
Returns the time remaining before the scheduled occurrence of the event, or
+infinity
if the event is not scheduled.- Returns:
- The time remaining before the occurrence of the event.
public double getRest(TimeUnits units)
Returns the time remaining before the scheduled occurrence of the event, or
+infinity
if the event is not scheduled.- Parameters:
units
- the time units- Returns:
- The time remaining before the occurrence of the event.
- Since:
- 7.1
@Deprecated @AnyLogicInternalCodegenAPI public void cancel()
Deprecated.
User should not call this method for events,
call
reset()
insteadCancels the scheduled event and clears the eventEntry
@AnyLogicInternalAPI public boolean isLoggingToDB()
Return
true
if the given event (or dynamic event) is logged to database
(note that this may be overridden by logging settings of Agent).@AnyLogicInternalCodegenAPI public void onDestroy()
Discards the scheduled event, if any (deletes it from the engine).
Must be called when the agent is destroyed. We assume it is
common behavior of all event originators
-
How can we improve this article?
-