|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.eval.SlaveMonitor
SlaveMonitor.java The SlaveMonitor is the main tool used by the evolutionary computation process to synchronize the work of multiple threads (for example, for different slaves). The monitor is in charge of keeping track of all the slaves (either those that are busy with various jobs they have received, or those that are available to perform jobs on behalf of the main evolutionary process). Additionally, the monitor provides methods to schedule a job to be executed by the next available slave, as well as a mechanism to wait until all jobs have been finished.
Constructor Summary | |
SlaveMonitor(boolean showDebugInfo,
int maxJobsPerSlave)
Simple constructor that initializes the data structures for keeping track of the state of each slave. |
Method Summary | |
void |
markSlaveAsUnavailable(ec.eval.SlaveData slave)
Mark a slave as unavailable (the slave has reached its maximum load). |
void |
notifySlaveAvailability(ec.eval.SlaveData slave,
EvaluationData ed)
Notifies the monitor that the particular slave has finished performing a job, and it (probably) is available for other jobs. |
int |
numSlaves()
Returns the number of slaves (available and busy) that are currently registered with the monitor. |
void |
registerSlave(ec.eval.SlaveData slave)
Registers a new slave with the monitor. |
void |
scheduleJobForEvaluation(EvolutionState state,
EvaluationData toEvaluate)
Schedules a job for execution on one of the available slaves. |
void |
shutdown(EvolutionState state)
Shuts down the slave monitor (also shuts down all slaves). |
void |
unregisterSlave(ec.eval.SlaveData slave)
Unregisters a dead slave from the monitor. |
void |
waitForAllSlavesToFinishEvaluating(EvolutionState state)
This method returns only when all slaves have finished the jobs that they were assigned. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SlaveMonitor(boolean showDebugInfo, int maxJobsPerSlave)
Method Detail |
public void registerSlave(ec.eval.SlaveData slave)
public void markSlaveAsUnavailable(ec.eval.SlaveData slave)
public void unregisterSlave(ec.eval.SlaveData slave)
public void shutdown(EvolutionState state)
public void scheduleJobForEvaluation(EvolutionState state, EvaluationData toEvaluate)
public void waitForAllSlavesToFinishEvaluating(EvolutionState state)
public void notifySlaveAvailability(ec.eval.SlaveData slave, EvaluationData ed)
public int numSlaves()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |