|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.eval.JobQueue
public class JobQueue
JobQueue.java The queue of jobs that are assigned to a slave (there is a one-to-one mapping between slaves and job queues. The system keeps track of all jobs assigned to a slave such that, if that slave crashed, the jobs can be rescheduled for execution on other threads. As evaluated individuals (or only their fitness) are read back from the slaves, the queue of jobs is continuously updated. For regular evolution, a job consists of an individual that needs to be evaluated, and as such, a job is removed from the queue of jobs each time an individual is read back from the slave. On the other hand, coevolutionary settings involve multiple individuals that are evaluated together; in this case, the queue of jobs keeps track how many more individuals need to be read back from the slave before the current job is finished. Of course, a slave that crashes in the middle of the run requires that the entire job needs to be rescheduled to another slave. The queue is a first-in-first-out data structure. This implies that the jobs are expected to be read back from the slave in exactly the same order as they were sent there.
Constructor Summary | |
---|---|
JobQueue(SlaveMonitor sm)
A simple constructor. |
Method Summary | |
---|---|
EvaluationData |
finishReadingIndividual(EvolutionState state,
ec.eval.SlaveData slaveData)
Once an evaluated individual has been read back from a slave, the job queue might undergo certain updates. |
Individual |
getIndividual(EvolutionState state)
As the slave executes jobs, it sends back individuals that have been evaluated (or only their fitness). |
int |
numJobs()
Returns the number of jobs that a slave is in charge of. |
void |
rescheduleJobs(EvolutionState state)
Reschedules the jobs in this job queue to other slaves in the system. |
void |
reset()
Resets the state of the queue (empties the queue of jobs) |
void |
scheduleJob(EvaluationData ed)
Adds a new jobs to the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JobQueue(SlaveMonitor sm)
Method Detail |
---|
public void reset()
public void scheduleJob(EvaluationData ed)
public Individual getIndividual(EvolutionState state)
public EvaluationData finishReadingIndividual(EvolutionState state, ec.eval.SlaveData slaveData)
public void rescheduleJobs(EvolutionState state)
public int numJobs()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |