nl.tudelft.simulation.dsol.formalisms.devs
Class SimEvent

java.lang.Object
  extended by nl.tudelft.simulation.dsol.formalisms.devs.AbstractSimEvent
      extended by nl.tudelft.simulation.dsol.formalisms.devs.SimEvent
All Implemented Interfaces:
Serializable, Comparable, SimEventInterface

public class SimEvent
extends AbstractSimEvent

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.

Since:
1.0
Version:
$Revision: 1.1 $ $Date: 2007/01/06 13:21:28 $
Author:
Peter Jacobs
See Also:
Serialized Form

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

source

protected Object source
source reflects the source that created the simevent


target

protected Object target
target reflects the target on which a state change is scheduled


method

protected String method
method is the method which embodies the state change


args

protected Object[] args
args are the arguments which are used to invoke the method with

Constructor Detail

SimEvent

public 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

Parameters:
executionTime - reflects the time the event has to be executed.
source - reflects the source that created the method
target - reflects the object on which the method must be invoked.
method - reflects the method to invoke
args - reflects the argumenst the method to invoke with

SimEvent

public 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

Parameters:
executionTime - reflects the time the event has to be executed.
priority - reflects the priority of the event
source - reflects the source that created the method
target - reflects the object on which the method must be invoked.
method - reflects the method to invoke
args - reflects the argumenst the method to invoke with
Method Detail

execute

public void execute()
             throws SimRuntimeException
Description copied from class: AbstractSimEvent
executes the simEvent

Specified by:
execute in interface SimEventInterface
Specified by:
execute in class AbstractSimEvent
Throws:
SimRuntimeException - on execution failure
See Also:
SimEventInterface.execute()

getArgs

public Object[] getArgs()
Returns:
Returns the args.

getMethod

public String getMethod()
Returns:
Returns the method.

getSource

public Object getSource()
Returns:
Returns the source.

getTarget

public Object getTarget()
Returns:
Returns the target.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


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