com.xj.anylogic.engine
Class DynamicEvent

java.lang.Object
  extended by com.xj.anylogic.engine.EventOriginator
      extended by com.xj.anylogic.engine.DynamicEvent
All Implemented Interfaces:
java.io.Serializable

public class DynamicEvent
extends EventOriginator

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 ActiveObject is destroyed, all dynamic events belonging to it are discarded.
Memory: sizeof(EventOriginator) = 22 bytes + sizeof(HashSet entry - in AO) + user data

Author:
XJ Technologies Company Ltd. www.anylogic.com
See Also:
Serialized Form

Constructor Summary
DynamicEvent(ActiveObject ao, double dt)
          A base class constructor for dynamic events.
 
Method Summary
 void execute()
          This method should be implemented at the subclass with a necessary call to super.execute() at the beginning.
 java.lang.String getName()
          Returns the name of the dynamic event - actually, the simple name of the dynamic event class.
 void reset()
          Discards the scheduled occurrence of the event unregisters this dynamic event at the active object
 
Methods inherited from class com.xj.anylogic.engine.EventOriginator
cancel, getActiveObject, getFullName, getRest, isActive, onDestroy, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DynamicEvent

public DynamicEvent(ActiveObject ao,
                    double dt)
A base class constructor for dynamic events. The constructor of the subclass must call "super( active object, timeout )". Schedules the event in the timeout specified.

Parameters:
ao - active object - event owner
dt - the timeout
Method Detail

getName

public java.lang.String getName()
Returns the name of the dynamic event - actually, the simple name of the dynamic event class.

Specified by:
getName in class EventOriginator
Returns:
The name of the dynamic event.

reset

public void reset()
Discards the scheduled occurrence of the event unregisters this dynamic event at the active object


execute

public void execute()
This method should be implemented at the subclass with a necessary call to super.execute() at the beginning.



Copyright © 1991-2008 XJ Technlogies. All Rights Reserved.