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

## avrora.sim
Class SimulatorThread

    java.lang.Object
      java.lang.Thread
          avrora.sim.SimulatorThread

All Implemented Interfaces:
  java.lang.Runnable

public class SimulatorThread
extends java.lang.Thread

The `SimulatorThread` class is a thread intended to run a `Simulator` in a multiple-node simulation. The mapping is one-to-one: each simulator is expected to be run in its own thread. Multiple simulators are then synchronized by being inserted into a group using the `GlobalClock` class.

Field Summary
`protected Simulator` | `simulator` The `simulator` field stores a reference to the simulator that this thread encapsulates.

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`SimulatorThread(Simulator s)` The constructor for the simulator thread accepts an instance of `Simulator` as a parameter and stores it internally.

Method Summary
`Simulator` | `getSimulator()` The `getSimulator()` method gets the `Simulator` instance that this thread is bound to.
`void` | `run()` The `run()` method begins the simulation, calling the `start()` method of the `Simulator` instance associated with this thread.

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield`

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

Field Detail

### simulator

    protected final Simulator simulator

  The `simulator` field stores a reference to the simulator that this thread encapsulates.

Constructor Detail

### SimulatorThread

    public SimulatorThread(Simulator s)

  The constructor for the simulator thread accepts an instance of `Simulator` as a parameter and stores it internally.

Parameters:
  `s` - the simulator this thread is intended to run.

Method Detail

### getSimulator

    public Simulator getSimulator()

  The `getSimulator()` method gets the `Simulator` instance that this thread is bound to.

  Returns:
    the instance of `Simulator` this thread is intended to run.

### run

    public void run()

  The `run()` method begins the simulation, calling the `start()` method of the `Simulator` instance associated with this thread.

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