|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.tudelft.simulation.dsol.formalisms.devs.AbstractSimEvent
public abstract class AbstractSimEvent
The AbstractSimEvent forms the basement for SimEvents and defines a compare method by which eventLists can compare priority of the event.
(c) copyright 2002-2005 Delft
University of Technology , the Netherlands.
See for project information
www.simulation.tudelft.nl
License of use: Lesser
General Public License (LGPL) , no warranty.
Field Summary | |
---|---|
protected double |
absoluteExecutionTime
absoluteExecutionTime reflects the time at which the event is scheduled |
protected long |
id
the id used in compare statements |
protected short |
priority
priority reflects the priority of the event |
Fields inherited from interface nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface |
---|
MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY |
Constructor Summary | |
---|---|
AbstractSimEvent(double executionTime)
The constuctor of the event stores the time the event must be executed and the object and method to invoke |
|
AbstractSimEvent(double executionTime,
short priority)
The constuctor of the event stores the time the event must be executed and the object and method to invoke |
Method Summary | |
---|---|
int |
compareTo(Object object)
|
abstract void |
execute()
executes the simEvent |
double |
getAbsoluteExecutionTime()
|
long |
getID()
sets the id of an event. |
short |
getPriority()
|
void |
setID(long id)
sets the id of an event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double absoluteExecutionTime
protected short priority
protected long id
Constructor Detail |
---|
public AbstractSimEvent(double executionTime)
executionTime
- reflects the time the event has to be executed.public AbstractSimEvent(double executionTime, short priority)
executionTime
- reflects the time the event has to be executed.priority
- reflects the priority of the eventMethod Detail |
---|
public int compareTo(Object object)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
public abstract void execute() throws SimRuntimeException
execute
in interface SimEventInterface
SimRuntimeException
- on execution failurepublic double getAbsoluteExecutionTime()
getAbsoluteExecutionTime
in interface SimEventInterface
public short getPriority()
getPriority
in interface SimEventInterface
public long getID()
SimEventInterface
getID
in interface SimEventInterface
public void setID(long id)
SimEventInterface
setID
in interface SimEventInterface
id
- The id to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |