Package jasima.core.simulation
Class SimEvent
- java.lang.Object
-
- jasima.core.simulation.SimEvent
-
- All Implemented Interfaces:
Comparable<SimEvent>,Runnable
- Direct Known Subclasses:
SimEventMethodCall
public abstract class SimEvent extends Object implements Comparable<SimEvent>, Runnable
Abstract base class for all simulation events. Events are sequenced by anEventQueueaccording to their time, priority and event number (to enforce FIFO order of concurrent events with the same priority).- Author:
- Torsten Hildebrandt
-
-
Field Summary
Fields Modifier and Type Field Description static intEVENT_PRIO_HIGHstatic intEVENT_PRIO_HIGHERstatic intEVENT_PRIO_HIGHESTstatic intEVENT_PRIO_LOWstatic intEVENT_PRIO_LOWERstatic intEVENT_PRIO_LOWESTstatic intEVENT_PRIO_MAXstatic intEVENT_PRIO_MINstatic intEVENT_PRIO_NORMAL
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intcompareTo(SimEvent o)SimOperations.SimEventTypeeventType()StringgetDescription()intgetPrio()doublegetTime()abstract voidhandle()Override this method to implement the actual functionality.booleanisAppEvent()An application event is the usual event type in a simulation.voidrun()voidsetDescription(String newDescription)voidsetPrio(int newPrio)voidsetTime(double time)StringtoString()
-
-
-
Field Detail
-
EVENT_PRIO_NORMAL
public static final int EVENT_PRIO_NORMAL
- See Also:
- Constant Field Values
-
EVENT_PRIO_LOW
public static final int EVENT_PRIO_LOW
- See Also:
- Constant Field Values
-
EVENT_PRIO_LOWER
public static final int EVENT_PRIO_LOWER
- See Also:
- Constant Field Values
-
EVENT_PRIO_LOWEST
public static final int EVENT_PRIO_LOWEST
- See Also:
- Constant Field Values
-
EVENT_PRIO_HIGH
public static final int EVENT_PRIO_HIGH
- See Also:
- Constant Field Values
-
EVENT_PRIO_HIGHER
public static final int EVENT_PRIO_HIGHER
- See Also:
- Constant Field Values
-
EVENT_PRIO_HIGHEST
public static final int EVENT_PRIO_HIGHEST
- See Also:
- Constant Field Values
-
EVENT_PRIO_MAX
public static final int EVENT_PRIO_MAX
- See Also:
- Constant Field Values
-
EVENT_PRIO_MIN
public static final int EVENT_PRIO_MIN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SimEvent
public SimEvent(double time, int prio)
-
SimEvent
public SimEvent(double time, int prio, String description)
-
-
Method Detail
-
handle
public abstract void handle()
Override this method to implement the actual functionality.
-
setTime
public void setTime(double time)
-
getTime
public double getTime()
-
getPrio
public int getPrio()
-
setPrio
public void setPrio(int newPrio)
-
getDescription
public String getDescription()
-
setDescription
public void setDescription(String newDescription)
-
isAppEvent
public boolean isAppEvent()
An application event is the usual event type in a simulation. A simulation is terminated if the event queue is empty or does not contain any application events (i.e. isAppEvent() of all events in the queue returns false).
-
eventType
public SimOperations.SimEventType eventType()
-
compareTo
public final int compareTo(SimEvent o)
- Specified by:
compareToin interfaceComparable<SimEvent>
-
-