Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## nl.tudelft.simulation.dsol.simulators
Class DEVSSimulator

    java.lang.Object
      nl.tudelft.simulation.event.EventProducer
          nl.tudelft.simulation.dsol.simulators.Simulator
              nl.tudelft.simulation.dsol.simulators.DEVSSimulator

All Implemented Interfaces:
  DEVSSimulatorInterface, nl.tudelft.simulation.event.EventProducerInterface, java.rmi.Remote, java.lang.Runnable, java.io.Serializable, SimulatorInterface

Direct Known Subclasses:
  DEVDESSSimulator

public class DEVSSimulator
extends Simulator
implements DEVSSimulatorInterface

The DEVS defines the interface of the DEVS simulator. DEVS stands for the Discrete Event System Specification. More information on Discrete Event Simulation can be found in "Theory of Modeling and Simulation" by Bernard Zeigler et. al.

(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.16 2004-03-18
Author:
  Peter Jacobs
See Also:
  Serialized Form

Field Summary
`protected EventListInterface` | `eventList` eventList represents the future event list

Fields inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
`replication, running, semaphore, simulatorTime, worker`

Fields inherited from class nl.tudelft.simulation.event.EventProducer
`listeners`

Fields inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
`EVENTLIST_CHANGED_EVENT`

Fields inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
`END_OF_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT`

Fields inherited from interface nl.tudelft.simulation.event.EventProducerInterface
`FIRST_POSITION, LAST_POSITION`

Constructor Summary
`DEVSSimulator()`

Method Summary
`boolean` | `cancelEvent(SimEventInterface event)` cancels an event from the event list.
`EventListInterface` | `getEventList()` returns the eventlist of the simulator.
`void` | `initialize(Replication replication)` initializes the simulator with a specified replication.
`void` | `run()` The run method defines the actual time step mechanism of the simulator.
`void` | `scheduleEvent(double relativeDelay, java.lang.Object source, java.lang.Object target, java.lang.String method, java.lang.Object[] args)` schedules a methodCall at a relative duration.
`void` | `scheduleEvent(double relativeDelay, short priority, java.lang.Object source, java.lang.Object target, java.lang.String method, java.lang.Object[] args)` schedules a methodCall at a relative duration.
`void` | `scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit, java.lang.Object source, java.lang.Object target, java.lang.String method, java.lang.Object[] args)` schedules a methodCall at a relative duration.
`void` | `scheduleEvent(double relativeDelay, TimeUnitInterface timeUnit, short priority, java.lang.Object source, java.lang.Object target, java.lang.String method, java.lang.Object[] args)` schedules a methodCall at a relative duration.
`void` | `scheduleEvent(SimEventInterface event)` Method scheduleEvent schedules an event on the eventlist.
`void` | `setEventList(EventListInterface eventList)` Method setEventList sets the eventlist.
`void` | `step()` steps the simulator.
`void` | `stop()` stops the simulator.

Methods inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
`getReplication, getSimulatorTime, isRunning, start`

Methods inherited from class nl.tudelft.simulation.event.EventProducer
`addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getEventTypes, removeAllListeners, removeAllListeners, removeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
`getReplication, getSimulatorTime, isRunning, start`

Methods inherited from interface nl.tudelft.simulation.event.EventProducerInterface
`addListener, addListener, addListener, addListener, getEventTypes, removeListener`

Field Detail

### eventList

    protected EventListInterface eventList

  eventList represents the future event list

Constructor Detail

### DEVSSimulator

    public DEVSSimulator()

Method Detail

### cancelEvent

    public boolean cancelEvent(SimEventInterface event)

  Description copied from interface: `DEVSSimulatorInterface`
  cancels an event from the event list.

  Specified by:
    `cancelEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `event` - a simulation event to be canceled.
  Returns:
    boolean the succes of the operation.
  See Also:
    `#cancelEvent(SimEventInterface)`

### getEventList

    public EventListInterface getEventList()

  Description copied from interface: `DEVSSimulatorInterface`
  returns the eventlist of the simulator.

  Specified by:
    `getEventList` in interface `DEVSSimulatorInterface`
  Returns:
    the eventlist.
  See Also:
    `#getEventList()`

### initialize

    public void initialize(Replication replication)
                    throws java.rmi.RemoteException,
                           SimRuntimeException

  Description copied from interface: `SimulatorInterface`
  initializes the simulator with a specified replication.

  Specified by:
    `initialize` in interface `SimulatorInterface`
  Overrides:
    `initialize` in class `Simulator`
  Throws:
    `java.rmi.RemoteException`
    `SimRuntimeException`
  See Also:
    `#initialize(nl.tudelft.simulation.dsol.experiment.Replication)`

### scheduleEvent

    public void scheduleEvent(SimEventInterface event)
                       throws SimRuntimeException

  Description copied from interface: `DEVSSimulatorInterface`
  Method scheduleEvent schedules an event on the eventlist.

  Specified by:
    `scheduleEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `event` - a simulation event
  Throws:
    `SimRuntimeException` - whenever event is scheduled in past.
  See Also:
    `#scheduleEvent(SimEventInterface)`

### scheduleEvent

    public void scheduleEvent(double relativeDelay,
                              java.lang.Object source,
                              java.lang.Object target,
                              java.lang.String method,
                              java.lang.Object[] args)
                       throws SimRuntimeException

  Description copied from interface: `DEVSSimulatorInterface`
  schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.

  Specified by:
    `scheduleEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `source` - the source of the event
    `target` - the target
    `method` - the method
    `args` - the arguments.
    `relativeDelay` - the relativeDelay in timeUnits of the simulator.
  Throws:
    `SimRuntimeException` - whenever the event is scheduled in the past.
  See Also:
    `DEVSSimulatorInterface.scheduleEvent(double, java.lang.Object, java.lang.Object, java.lang.String, java.lang.Object[])`

### scheduleEvent

    public void scheduleEvent(double relativeDelay,
                              short priority,
                              java.lang.Object source,
                              java.lang.Object target,
                              java.lang.String method,
                              java.lang.Object[] args)
                       throws SimRuntimeException

  Description copied from interface: `DEVSSimulatorInterface`
  schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.

  Specified by:
    `scheduleEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `priority` - the priority compared to other events scheduled at the same time.
    `source` - the source of the event
    `target` - the target
    `method` - the method
    `args` - the arguments.
    `relativeDelay` - the relativeDelay in timeUnits of the simulator.
  Throws:
    `SimRuntimeException` - whenever the event is scheduled in the past.
  See Also:
    `DEVSSimulatorInterface.scheduleEvent(double, short, java.lang.Object, java.lang.Object, java.lang.String, java.lang.Object[])`

### scheduleEvent

    public void scheduleEvent(double relativeDelay,
                              TimeUnitInterface timeUnit,
                              java.lang.Object source,
                              java.lang.Object target,
                              java.lang.String method,
                              java.lang.Object[] args)
                       throws java.rmi.RemoteException,
                              SimRuntimeException

  Description copied from interface: `DEVSSimulatorInterface`
  schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.

  Specified by:
    `scheduleEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `timeUnit` - the timeUnits of the delay
    `source` - the source of the event
    `target` - the target
    `method` - the method
    `args` - the arguments.
    `relativeDelay` - the relativeDelay in timeUnits of the simulator.
  Throws:
    `java.rmi.RemoteException` - on network failure.
    `SimRuntimeException` - whenever the event is scheduled in the past.
  See Also:
    `DEVSSimulatorInterface.scheduleEvent(double, nl.tudelft.simulation.dsol.experiment.TimeUnitInterface, java.lang.Object, java.lang.Object, java.lang.String, java.lang.Object[])`

### scheduleEvent

    public void scheduleEvent(double relativeDelay,
                              TimeUnitInterface timeUnit,
                              short priority,
                              java.lang.Object source,
                              java.lang.Object target,
                              java.lang.String method,
                              java.lang.Object[] args)
                       throws java.rmi.RemoteException,
                              SimRuntimeException

  Description copied from interface: `DEVSSimulatorInterface`
  schedules a methodCall at a relative duration. The executionTime is thus simulator.getSimulatorTime()+relativeDuration.

  Specified by:
    `scheduleEvent` in interface `DEVSSimulatorInterface`
  Parameters:
    `priority` - the priority compared to other events scheduled at the same time.
    `timeUnit` - the timeUnits of the delay
    `source` - the source of the event
    `target` - the target
    `method` - the method
    `args` - the arguments.
    `relativeDelay` - the relativeDelay in timeUnits of the simulator.
  Throws:
    `SimRuntimeException` - whenever the event is scheduled in the past.
    `java.rmi.RemoteException` - on network failure.
  See Also:
    `DEVSSimulatorInterface.scheduleEvent(double, nl.tudelft.simulation.dsol.experiment.TimeUnitInterface, short, java.lang.Object, java.lang.Object, java.lang.String, java.lang.Object[])`

### setEventList

    public void setEventList(EventListInterface eventList)

  Description copied from interface: `DEVSSimulatorInterface`
  Method setEventList sets the eventlist.

  Specified by:
    `setEventList` in interface `DEVSSimulatorInterface`
  Parameters:
    `eventList` - the eventList for the simulator.
  See Also:
    `#setEventList(EventListInterface)`

### step

    public void step()
              throws SimRuntimeException

  Description copied from interface: `SimulatorInterface`
  steps the simulator.

  Specified by:
    `step` in interface `SimulatorInterface`
  Overrides:
    `step` in class `Simulator`
  Throws:
    `SimRuntimeException`
  See Also:
    `SimulatorInterface.step()`

### run

    public void run()

  Description copied from class: `Simulator`
  The run method defines the actual time step mechanism of the simulator. The implementation of this method depends on the formalism. Where discrete event formalisms loop over an eventlist continuous simulators take pre-defined time steps.

  Specified by:
    `run` in interface `java.lang.Runnable`
  Specified by:
    `run` in class `Simulator`
  See Also:
    `Simulator.run()`

### stop

    public void stop()

  Description copied from interface: `SimulatorInterface`
  stops the simulator.

  Specified by:
    `stop` in interface `SimulatorInterface`
  Overrides:
    `stop` in class `Simulator`
  See Also:
    `SimulatorInterface.stop()`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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