class SlaveConnection extends Object
Generally SlaveConnection is only seen by communicates only with SlaveMonitor.
| Modifier and Type | Field and Description |
|---|---|
DataInputStream |
dataIn
Used to read results and randoms state from slave.
|
(package private) DataOutputStream |
dataOut
Used to transmit data to the slave.
|
(package private) Socket |
evalSocket
Socket for communication with the slave process
|
(package private) LinkedList |
jobs |
(package private) ThreadPool.Worker |
reader |
(package private) Runnable |
readerRun |
(package private) boolean |
showDebugInfo |
(package private) Object |
shutDownLock |
(package private) boolean |
shuttingDown
This method is called whenever there are any communication problems with the slave
(indicating possibly that the slave might have crashed).
|
(package private) SlaveMonitor |
slaveMonitor |
(package private) String |
slaveName
Name of the slave process
|
(package private) EvolutionState |
state |
(package private) ThreadPool.Worker |
writer |
(package private) Runnable |
writerRun |
| Constructor and Description |
|---|
SlaveConnection(EvolutionState state,
String slaveName,
Socket evalSocket,
DataOutputStream dataOut,
DataInputStream dataIn,
SlaveMonitor slaveMonitor)
The constructor also creates the queue storing the jobs that the slave
has been asked to evaluate.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
buildThreads() |
(package private) void |
debug(String s) |
int |
numJobs()
Returns the number of jobs that a slave is in charge of.
|
(package private) Job |
oldestUnsentJob() |
(package private) boolean |
readLoop() |
(package private) void |
rescheduleJobs(EvolutionState state)
Reschedules the jobs in this job queue to other slaves in the system.
|
void |
scheduleJob(Job job)
Adds a new jobs to the queue.
|
protected void |
shutdown(EvolutionState state) |
String |
toString() |
(package private) boolean |
writeLoop() |
String slaveName
Socket evalSocket
DataOutputStream dataOut
public DataInputStream dataIn
EvolutionState state
SlaveMonitor slaveMonitor
ThreadPool.Worker reader
Runnable readerRun
ThreadPool.Worker writer
Runnable writerRun
LinkedList jobs
boolean shuttingDown
Object shutDownLock
boolean showDebugInfo
public SlaveConnection(EvolutionState state, String slaveName, Socket evalSocket, DataOutputStream dataOut, DataInputStream dataIn, SlaveMonitor slaveMonitor)
protected void shutdown(EvolutionState state)
final void debug(String s)
public int numJobs()
void buildThreads()
Job oldestUnsentJob()
boolean writeLoop()
boolean readLoop()
public void scheduleJob(Job job)
void rescheduleJobs(EvolutionState state)
Copyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.