ec.eval
Interface IMasterProblemServer

All Known Implementing Classes:
MasterProblemServer

public interface IMasterProblemServer

Interface implemented by both the ECJ master/slave problem and the ORIGIN Frontier task distributed problem classes.


Field Summary
static java.lang.String P_EVALCOMPRESSION
           
static java.lang.String P_EVALMASTERPORT
           
static java.lang.String P_MAXIMUMACTIVESLAVES
           
static java.lang.String P_MAXIMUMNUMBEROFCONCURRENTJOBSPERSLAVE
           
 
Method Summary
 boolean evaluatedIndividualAvailable()
           
 QueueIndividual getEvaluatedIndividual(EvolutionState state)
           
 int numAvailableSlaves()
          Returns the number of available slave (not busy)
 QueueIndividual pollNextEvaluatedIndividual(EvolutionState state, long timeoutInMilliseconds)
          Polls for the next evaluated individual.
 void scheduleJobForEvaluation(EvolutionState state, Job ed)
          Schedules a remote evaluation.
 void setJobSize(int jobSize)
          A hint as to the maximum number of jobs per slave task.
 void setupServerFromDatabase(EvolutionState state)
          Initializes the server
 void shutdown()
          Shut down the server.
 java.lang.Thread spawnThread()
          Creates and starts a background thread for this server.
 void waitForAllSlavesToFinishEvaluating(EvolutionState state)
          Wait for remote evaluation to complete.
 Individual waitForIndividual(EvolutionState state)
          Wait for one individual to complete evaluation.
 

Field Detail

P_EVALMASTERPORT

static final java.lang.String P_EVALMASTERPORT
See Also:
Constant Field Values

P_EVALCOMPRESSION

static final java.lang.String P_EVALCOMPRESSION
See Also:
Constant Field Values

P_MAXIMUMNUMBEROFCONCURRENTJOBSPERSLAVE

static final java.lang.String P_MAXIMUMNUMBEROFCONCURRENTJOBSPERSLAVE
See Also:
Constant Field Values

P_MAXIMUMACTIVESLAVES

static final java.lang.String P_MAXIMUMACTIVESLAVES
See Also:
Constant Field Values
Method Detail

setupServerFromDatabase

void setupServerFromDatabase(EvolutionState state)
Initializes the server

Parameters:
state - The evolution state

spawnThread

java.lang.Thread spawnThread()
Creates and starts a background thread for this server.

Returns:
the background thread

numAvailableSlaves

int numAvailableSlaves()
Returns the number of available slave (not busy)


setJobSize

void setJobSize(int jobSize)
A hint as to the maximum number of jobs per slave task. The server is free to ignore or modify this value.


evaluatedIndividualAvailable

boolean evaluatedIndividualAvailable()
Returns:
true if there are individuals that have completed evaluation but not yet been processed.

shutdown

void shutdown()
              throws java.lang.InterruptedException
Shut down the server.

Throws:
java.lang.InterruptedException

scheduleJobForEvaluation

void scheduleJobForEvaluation(EvolutionState state,
                              Job ed)
Schedules a remote evaluation.

Parameters:
state - Evolution state
ed - Evaluation data for one individual or group

waitForIndividual

Individual waitForIndividual(EvolutionState state)
Wait for one individual to complete evaluation.


getEvaluatedIndividual

QueueIndividual getEvaluatedIndividual(EvolutionState state)

pollNextEvaluatedIndividual

QueueIndividual pollNextEvaluatedIndividual(EvolutionState state,
                                            long timeoutInMilliseconds)
Polls for the next evaluated individual.

Parameters:
state -
timeoutInMilliseconds - Timeout for individual to be received
Returns:
QueueIndividual, or null if no individual is received before the timeout.

waitForAllSlavesToFinishEvaluating

void waitForAllSlavesToFinishEvaluating(EvolutionState state)
Wait for remote evaluation to complete.