|
||||||||||
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
nl.tudelft.simulation.dsol.formalisms.devs.SimEvent
public class SimEvent
The SimEvent forms the essential scheduling mechanism for D-SOL. Objects do not invoke methods directly on eachother; they bundle the object on which the method is planned to be invoked together with the arguments and the name of the method in a simEvent. The SimEvent is then stored in the eventList and executed.
(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 Object[] |
args
args are the arguments which are used to invoke the method with |
protected String |
method
method is the method which embodies the state change |
protected Object |
source
source reflects the source that created the simevent |
protected Object |
target
target reflects the target on which a state change is scheduled |
Fields inherited from class nl.tudelft.simulation.dsol.formalisms.devs.AbstractSimEvent |
---|
absoluteExecutionTime, id, priority |
Fields inherited from interface nl.tudelft.simulation.dsol.formalisms.devs.SimEventInterface |
---|
MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY |
Constructor Summary | |
---|---|
SimEvent(double executionTime,
Object source,
Object target,
String method,
Object[] args)
The constuctor of the event stores the time the event must be executed and the object and method to invoke |
|
SimEvent(double executionTime,
short priority,
Object source,
Object target,
String method,
Object[] args)
The constuctor of the event stores the time the event must be executed and the object and method to invoke |
Method Summary | |
---|---|
void |
execute()
executes the simEvent |
Object[] |
getArgs()
|
String |
getMethod()
|
Object |
getSource()
|
Object |
getTarget()
|
String |
toString()
|
Methods inherited from class nl.tudelft.simulation.dsol.formalisms.devs.AbstractSimEvent |
---|
compareTo, getAbsoluteExecutionTime, getID, getPriority, setID |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Object source
protected Object target
protected String method
protected Object[] args
Constructor Detail |
---|
public SimEvent(double executionTime, Object source, Object target, String method, Object[] args)
executionTime
- reflects the time the event has to be executed.source
- reflects the source that created the methodtarget
- reflects the object on which the method must be invoked.method
- reflects the method to invokeargs
- reflects the argumenst the method to invoke withpublic SimEvent(double executionTime, short priority, Object source, Object target, String method, Object[] args)
executionTime
- reflects the time the event has to be executed.priority
- reflects the priority of the eventsource
- reflects the source that created the methodtarget
- reflects the object on which the method must be invoked.method
- reflects the method to invokeargs
- reflects the argumenst the method to invoke withMethod Detail |
---|
public void execute() throws SimRuntimeException
AbstractSimEvent
execute
in interface SimEventInterface
execute
in class AbstractSimEvent
SimRuntimeException
- on execution failureSimEventInterface.execute()
public Object[] getArgs()
public String getMethod()
public Object getSource()
public Object getTarget()
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |