ec.eval
Class Slave

java.lang.Object
  extended by ec.eval.Slave

public class Slave
extends java.lang.Object

Slave.java

Slave is the main entry point for a slave evaluation process. The slave works with a master process, receiving individuals from the master, evaluating them, and reporting the results back to the master, thus enabling distributed evolution.

Slave replicates most of the functionality of the ec.Evolve class, for example in terms of parameters and checkpointing. This is mostly because it needs to bootstrap and set up the EvolutionState in much the same way that ec.Evolve does. Additionally, depending on settings below, the Slave may act like a mini-evolver on the individuals it receives from the master.

Like ec.Evolve, Slave is run with one of two argument formats:

java ec.eval.Slave -file parameter_file [-p parameter=value]*

This starts a new slave, using the parameter file parameter_file. The user can provide optional overriding parameters on the command-line with the -p option.

java ec.eval.Slave -checkpoint checkpoint_file

This starts up a slave from a previous checkpoint file. Use of this form would be rare indeed.

Slaves need to know some things in order to run: the master's IP address and socket port number, whether to do compression, and whether or not to return individuals or just fitnesses.

Slaves presently always run in single-threaded mode and receive their random number generator seed from the master. Thus they ignore any seed parameters given to them.

Slaves run in one of three modes:

Parameters

eval.slave-name
String
(the slave's name, only for debugging purposes. If not specified, the slave makes one up.)
eval.master.host
String
(the IP Address of the master.)
eval.master.port
integer >= 1024
(the socket port number of the master.)
eval.compression
bool = true or false (default)
(should we use compressed streams in communicating with the master?)
eval.run-evolve
bool = true or false (default)
(should we immediately evaluate the individuals and return them (or their fitnesses), or if we have extra time (defined by eval.runtime), should we do a little evolution on our individuals first?)
eval.runtime
integer > 0
(if eval.run-evolve is true, how long (in milliseconds wall-clock time) should we allow the individuals to evolve?)
eval.return-inds
bool = true or false (default)
(should we return whole individuals or (if false) just the fitnesses of the individuals? This must be TRUE if eval.run-evolve is true.)
nostore
bool = true or false (default)
(should the ec.util.Output facility not store announcements in memory?)
flush
bool = true or false (default)
(should I flush all output as soon as it's printed (useful for debugging when an exception occurs))
verbosity
int >= 0
(the ec.util.Output object's verbosity)
state
classname, inherits and != ec.EvolutionState
(the EvolutionState object class)
print-accessed-params
bool = true or false (default)
(at the end of a run, do we print out a list of all the parameters requested during the run?)
print-used-params
bool = true or false (default)
(at the end of a run, do we print out a list of all the parameters actually used during the run?)
print-unaccessed-params
bool = true or false (default)
(at the end of a run, do we print out a list of all the parameters NOT requested during the run?)
print-unused-params
bool = true or false (default)
(at the end of a run, do we print out a list of all the parameters NOT actually used during the run?)
print-all-params
bool = true or false (default)
(at the end of a run, do we print out a list of all the parameters stored in the parameter database?)

Author:
Liviu Panait, Sean Paus, Keith Sullivan, and Sean Luke

Field Summary
static java.lang.String A_CHECKPOINT
          The argument indicating that we're starting up from a checkpoint file.
static java.lang.String A_FILE
          The argument indicating that we're starting fresh from a new parameter file.
static java.lang.String P_EVALCOMPRESSION
           
static java.lang.String P_EVALMASTERHOST
           
static java.lang.String P_EVALMASTERPORT
           
static java.lang.String P_EVALSLAVENAME
           
static java.lang.String P_FLUSH
          flush announcements parameter
static java.lang.String P_PRINTACCESSEDPARAMETERS
           
static java.lang.String P_PRINTALLPARAMETERS
           
static java.lang.String P_PRINTUNACCESSEDPARAMETERS
           
static java.lang.String P_PRINTUNUSEDPARAMETERS
           
static java.lang.String P_PRINTUSEDPARAMETERS
           
static java.lang.String P_RETURNINDIVIDUALS
           
static java.lang.String P_RUNEVOLVE
          Should slave run its own evolutionary process?
static java.lang.String P_RUNTIME
          Time to run evolution on the slaves in seconds
static java.lang.String P_STATE
          state parameter
static java.lang.String P_STORE
          nostore parameter
static java.lang.String P_SUBPOP
           
static java.lang.String P_VERBOSITY
          verbosity parameter
static boolean runEvolve
           
static int runTime
           
static int SLEEP_TIME
          How long we sleep in between attempts to connect to the master (in milliseconds).
static byte V_CHECKPOINT
           
static byte V_EVALUATEGROUPED
           
static byte V_EVALUATESIMPLE
           
static byte V_FITNESS
           
static byte V_INDIVIDUAL
           
static byte V_NOTHING
           
static byte V_SHUTDOWN
           
 
Constructor Summary
Slave()
           
 
Method Summary
static void evaluateGroupedProblemForm(EvolutionState state, boolean returnIndividuals, java.io.DataInputStream dataIn, java.io.DataOutputStream dataOut)
           
static void evaluateSimpleProblemForm(EvolutionState state, boolean returnIndividuals, java.io.DataInputStream dataIn, java.io.DataOutputStream dataOut, java.lang.String[] args)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_PRINTACCESSEDPARAMETERS

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

P_PRINTUSEDPARAMETERS

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

P_PRINTALLPARAMETERS

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

P_PRINTUNUSEDPARAMETERS

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

P_PRINTUNACCESSEDPARAMETERS

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

P_EVALSLAVENAME

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

P_EVALMASTERHOST

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

P_EVALMASTERPORT

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

P_EVALCOMPRESSION

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

P_RETURNINDIVIDUALS

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

P_SUBPOP

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

V_NOTHING

public static final byte V_NOTHING
See Also:
Constant Field Values

V_INDIVIDUAL

public static final byte V_INDIVIDUAL
See Also:
Constant Field Values

V_FITNESS

public static final byte V_FITNESS
See Also:
Constant Field Values

V_SHUTDOWN

public static final byte V_SHUTDOWN
See Also:
Constant Field Values

V_EVALUATESIMPLE

public static final byte V_EVALUATESIMPLE
See Also:
Constant Field Values

V_EVALUATEGROUPED

public static final byte V_EVALUATEGROUPED
See Also:
Constant Field Values

V_CHECKPOINT

public static final byte V_CHECKPOINT
See Also:
Constant Field Values

A_CHECKPOINT

public static final java.lang.String A_CHECKPOINT
The argument indicating that we're starting up from a checkpoint file.

See Also:
Constant Field Values

A_FILE

public static final java.lang.String A_FILE
The argument indicating that we're starting fresh from a new parameter file.

See Also:
Constant Field Values

P_FLUSH

public static final java.lang.String P_FLUSH
flush announcements parameter

See Also:
Constant Field Values

P_STORE

public static final java.lang.String P_STORE
nostore parameter

See Also:
Constant Field Values

P_VERBOSITY

public static final java.lang.String P_VERBOSITY
verbosity parameter

See Also:
Constant Field Values

P_STATE

public static final java.lang.String P_STATE
state parameter

See Also:
Constant Field Values

P_RUNTIME

public static final java.lang.String P_RUNTIME
Time to run evolution on the slaves in seconds

See Also:
Constant Field Values

runTime

public static int runTime

P_RUNEVOLVE

public static final java.lang.String P_RUNEVOLVE
Should slave run its own evolutionary process?

See Also:
Constant Field Values

runEvolve

public static boolean runEvolve

SLEEP_TIME

public static final int SLEEP_TIME
How long we sleep in between attempts to connect to the master (in milliseconds).

See Also:
Constant Field Values
Constructor Detail

Slave

public Slave()
Method Detail

main

public static void main(java.lang.String[] args)

evaluateSimpleProblemForm

public static void evaluateSimpleProblemForm(EvolutionState state,
                                             boolean returnIndividuals,
                                             java.io.DataInputStream dataIn,
                                             java.io.DataOutputStream dataOut,
                                             java.lang.String[] args)

evaluateGroupedProblemForm

public static void evaluateGroupedProblemForm(EvolutionState state,
                                              boolean returnIndividuals,
                                              java.io.DataInputStream dataIn,
                                              java.io.DataOutputStream dataOut)