nl.tudelft.simulation.dsol.formalisms.devs
Interface SimEventInterface

All Superinterfaces:
java.lang.Comparable, java.io.Serializable
All Known Implementing Classes:
AbstractSimEvent

public interface SimEventInterface
extends java.io.Serializable, java.lang.Comparable

A SimEventInterface embodies the envolope in the scheduled method invocation information is stored.

(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
1.0
Version:
1.11 2004-03-26
Author:
Peter Jacobs

Field Summary
static short MAX_PRIORITY
          MAX_PRIORITY is a constant reflecting the maximum priority
static short MIN_PRIORITY
          MIN_PRIORITY is a constant reflecting the minimal priority
static short NORMAL_PRIORITY
          NORMAL_PRIORITY is a constant reflecting the normal priority
 
Method Summary
 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 interface java.lang.Comparable
compareTo
 

Field Detail

MAX_PRIORITY

public static final short MAX_PRIORITY
MAX_PRIORITY is a constant reflecting the maximum priority

See Also:
Constant Field Values

NORMAL_PRIORITY

public static final short NORMAL_PRIORITY
NORMAL_PRIORITY is a constant reflecting the normal priority

See Also:
Constant Field Values

MIN_PRIORITY

public static final short MIN_PRIORITY
MIN_PRIORITY is a constant reflecting the minimal priority

See Also:
Constant Field Values
Method Detail

execute

public void execute()
             throws SimRuntimeException
executes the simEvent.

Throws:
SimRuntimeException - on execution failure

getAbsoluteExecutionTime

public double getAbsoluteExecutionTime()
Returns:
the scheduled execution time of a simulation event.

getPriority

public short getPriority()
Returns:
The priority of a simulation event. The priorities are programmed according to the Java thread priority. Use 10 (MAX_PRIORITY), -9, .. , 5 (NORMAL_PRIORITY), 1(MIN_PRIORITY)

getID

public long getID()
sets the id of an event. Whenever a simulation event is added or removed from an eventlist, the list might want to set an ID for comparison. This is the only way to ensure a comparison on equal priority and execution time.

Returns:
retuns the id

setID

public void setID(long id)
sets the id of an event. Whenever a simulation event is added or removed from an eventlist, the list might want to set an ID for comparison. This is the only way to ensure a comparison on equal priority and execution time.

Parameters:
id - the id


Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.