public class NodeThreadPool
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static int |
defaultNumJavaThreads |
protected static int |
maxNumJavaThreads |
protected double |
myAverageTimePerStep |
protected static boolean |
myCollectTimings |
protected int |
myCurrentNumJavaThreads |
protected float |
myEndTime |
protected java.lang.Object |
myLock |
protected Node[] |
myNodes |
protected static int |
myNumJavaThreads |
protected int |
myNumSteps |
protected int |
myNumThreads |
protected Projection[] |
myProjections |
protected long |
myRunStartTime |
protected float |
myStartTime |
protected ThreadTask[] |
myTasks |
protected NodeThread[] |
myThreads |
protected SyncedUnit[] |
myUnits |
protected int |
numThreadsComplete |
protected int |
numThreadsWaiting |
protected boolean |
runFinished |
protected boolean |
threadsRunning |
Modifier | Constructor and Description |
---|---|
protected |
NodeThreadPool() |
|
NodeThreadPool(Network network,
java.util.List<ThreadTask> threadTasks,
boolean interactive) |
Modifier and Type | Method and Description |
---|---|
static java.util.List<Node> |
collectNodes(Node[] startingNodes,
boolean breakDownNetworkArrays)
Return all the nodes in the network except subnetworks.
|
static java.util.List<Projection> |
collectProjections(Node[] startingNodes,
Projection[] startingProjections)
Returns all the projections that would be in a "flattened" version of the network.
|
static java.util.List<SyncedUnit> |
collectSyncedNodes(Node[] startingNodes)
///my
This method should find all Nodes which extend SyncedUnit class.
|
static java.util.List<ThreadTask> |
collectTasks(Node[] startingNodes)
Returns all the tasks that would be in a "flattened" version of the network.
|
float |
getEndTime() |
static int |
getMaxNumJavaThreads() |
static int |
getNumJavaThreads() |
boolean |
getRunFinished() |
float |
getStartTime() |
protected void |
initialize(Network network,
java.util.List<ThreadTask> threadTasks,
boolean interactive)
1.
|
static boolean |
isCollectingTimings() |
static boolean |
isMultithreading() |
void |
kill()
Kill the threads in the pool by interrupting them.
|
static void |
setCollectTimings(boolean collectTimings) |
static void |
setNumJavaThreads(int value) |
void |
step(float startTime,
float endTime)
Tell the threads in the current thread pool to take a step.
|
void |
threadFinished()
Called by the threads in this pool to signal that they are done a phase.
|
void |
threadWait()
Called by the threads in this node pool.
|
static void |
turnOffMultithreading() |
protected static final int maxNumJavaThreads
protected static final int defaultNumJavaThreads
protected static int myNumJavaThreads
protected int myCurrentNumJavaThreads
protected int myNumThreads
protected NodeThread[] myThreads
protected java.lang.Object myLock
protected Node[] myNodes
protected SyncedUnit[] myUnits
protected Projection[] myProjections
protected ThreadTask[] myTasks
protected volatile int numThreadsComplete
protected volatile int numThreadsWaiting
protected volatile boolean threadsRunning
protected volatile boolean runFinished
protected float myStartTime
protected float myEndTime
protected static boolean myCollectTimings
protected long myRunStartTime
protected double myAverageTimePerStep
protected int myNumSteps
protected NodeThreadPool()
public NodeThreadPool(Network network, java.util.List<ThreadTask> threadTasks, boolean interactive)
public static int getNumJavaThreads()
public static void setNumJavaThreads(int value)
public static int getMaxNumJavaThreads()
public static boolean isMultithreading()
public static void turnOffMultithreading()
public static boolean isCollectingTimings()
public static void setCollectTimings(boolean collectTimings)
public float getStartTime()
public float getEndTime()
public boolean getRunFinished()
protected void initialize(Network network, java.util.List<ThreadTask> threadTasks, boolean interactive)
public void step(float startTime, float endTime) throws SimulationException
SimulationException
public void threadWait() throws java.lang.InterruptedException
java.lang.InterruptedException
public void threadFinished() throws java.lang.InterruptedException
java.lang.InterruptedException
public void kill()
public static java.util.List<SyncedUnit> collectSyncedNodes(Node[] startingNodes)
startingNodes
- public static java.util.List<Node> collectNodes(Node[] startingNodes, boolean breakDownNetworkArrays)
public static java.util.List<Projection> collectProjections(Node[] startingNodes, Projection[] startingProjections)
public static java.util.List<ThreadTask> collectTasks(Node[] startingNodes)