Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

desmoj
Class ExternalEvent  view ExternalEvent download ExternalEvent.java

java.lang.Object
  extended bydesmoj.NamedObject
      extended bydesmoj.ModelComponent
          extended bydesmoj.Schedulable
              extended bydesmoj.Event
                  extended bydesmoj.ExternalEvent
Direct Known Subclasses:
ExternalEventDebugOff, ExternalEventDebugOn, ExternalEventStop, ExternalEventTimedTrace, ExternalEventTraceOff, ExternalEventTraceOn

public abstract class ExternalEvent
extends Event

Provides the basic frame for user defined events. Derive from this class to design special external events for a model. To use external events, always create a new object of this class.

Version:
DESMO-J, Ver. 1.5 copyright (c) 2001 licensed under GNU GPL

Field Summary
 
Fields inherited from class desmoj.Schedulable
myNote
 
Fields inherited from class desmoj.ModelComponent
 
Fields inherited from class desmoj.NamedObject
 
Constructor Summary
ExternalEvent(Model owner, java.lang.String name, boolean showInTrace)
          Creates an external event for the given model with the given name and the specified tracemode.
 
Method Summary
abstract  void eventRoutine()
          Implement this method to express the semantics of this external event.
 void eventRoutine(Entity who)
          Do not use this method to implement the external event's eventRoutine! This method can not be hidden due to the inheritance relationship to the class Event.
 void schedule(SimTime dt)
          Schedules this external event to make the desired changes to the experiment or model at the specified point in simulation time.
 void scheduleAfter(Schedulable after)
          Schedules this external event to act on the experiment or model state directly after the given schedulable is already set to be activated.
 void scheduleBefore(Schedulable before)
          Schedules this external event to act on the experiment or model state directly before the given schedulable is already set to be activated.
 
Methods inherited from class desmoj.Event
isExternal, schedule, scheduleAfter, scheduleBefore
 
Methods inherited from class desmoj.Schedulable
cancel, getEventNote, isCurrent, isScheduled, nextEntity, nextEvent, nextSchedulable, removeEventNote, rename, reSchedule, scheduledAt, setEventNote
 
Methods inherited from class desmoj.ModelComponent
current, currentEntity, currentEvent, currentModel, currentSimProcess, currentTime, debugIsOn, debugOff, debugOn, epsilon, getModel, isExperimentCompatible, isModelCompatible, sendDebugNote, sendMessage, sendTraceNote, sendWarning, setOwner, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
 
Methods inherited from class desmoj.NamedObject
getName, getQuotedName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExternalEvent

public ExternalEvent(Model owner,
                     java.lang.String name,
                     boolean showInTrace)
Creates an external event for the given model with the given name and the specified tracemode.

Method Detail

eventRoutine

public abstract void eventRoutine()
Implement this method to express the semantics of this external event. External events are supposed to act on the model or experiment in general. They are not related to a special entity (unlike method eventRoutine(Entity who) of class Event). Override this method to implement this ExternalEvent's behaviour.


eventRoutine

public void eventRoutine(Entity who)
Do not use this method to implement the external event's eventRoutine! This method can not be hidden due to the inheritance relationship to the class Event. Since external events are designed to act on the model or experiment in general and are not associated to an individual entity, you should use the parameterless method void eventRoutine() instead. Calling this method will result in a warning message and the parameterless method will be called. The given entity will not be changed. Do not override this method in your special external events!

Specified by:
eventRoutine in class Event

schedule

public void schedule(SimTime dt)
Schedules this external event to make the desired changes to the experiment or model at the specified point in simulation time. The point of time is given as an offset to the current simulation time as displayed by the simclock.


scheduleAfter

public void scheduleAfter(Schedulable after)
Schedules this external event to act on the experiment or model state directly after the given schedulable is already set to be activated. Note that this external event's point of simulation time will be set to be the same as the schedulable's time. Thus this external event will occur directly after the given schedulable but the simulation clock will not change. Make sure that the schedulable given as parameter is actually scheduled.


scheduleBefore

public void scheduleBefore(Schedulable before)
Schedules this external event to act on the experiment or model state directly before the given schedulable is already set to be activated. Note that this external event's point of simulation time will be set to be the same as the schedulable's time. Thus this external event will occur directly before the given schedulable but the simulation clock will not change. Make sure that the schedulable given as parameter is actually scheduled.