|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread avrora.sim.SimulatorThread
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 Simulation.Node |
node
|
protected Synchronizer |
synchronizer
The synchronizer field stores a reference to the synchronizer that this thread
is a part of; this is needed so that when the thread finishes execution (either through
a timeout or error, etc), it can be removed from the simulation and the rest of the simulation
can continue. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
SimulatorThread(Simulation.Node n)
The constructor for the simulator thread accepts an instance of Simulator as a parameter
and stores it internally. |
Method Summary | |
Simulation.Node |
getNode()
The getNode() method gets a reference to the Simulation.Node that this
simulator thread is simulating. |
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. |
void |
setSynchronizer(Synchronizer s)
The setSynchronizer() method sets the synchronizer for 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 |
protected final Simulation.Node node
protected Synchronizer synchronizer
synchronizer
field stores a reference to the synchronizer that this thread
is a part of; this is needed so that when the thread finishes execution (either through
a timeout or error, etc), it can be removed from the simulation and the rest of the simulation
can continue.
Constructor Detail |
public SimulatorThread(Simulation.Node n)
Simulator
as a parameter
and stores it internally.
n
- the nodeMethod Detail |
public Simulation.Node getNode()
getNode()
method gets a reference to the Simulation.Node
that this
simulator thread is simulating.
public Simulator getSimulator()
getSimulator()
method gets the Simulator
instance that this thread is
bound to.
Simulator
this thread is intended to run.public void run()
run()
method begins the simulation, calling the start()
method of the
Simulator
instance associated with this thread.
public void setSynchronizer(Synchronizer s)
setSynchronizer()
method sets the synchronizer for this thread.
s
- the synchronizer for this node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |