JGAP

examples.grid.evolutionDistributed
Class ClientEvolveStrategy

java.lang.Object
  extended by examples.grid.evolutionDistributed.ClientEvolveStrategy
All Implemented Interfaces:
java.io.Serializable, IClientEvolveStrategy

public class ClientEvolveStrategy
extends java.lang.Object
implements IClientEvolveStrategy

Sample implementation of a strategy for evolving a generation on the client.

Since:
3.2
See Also:
Serialized Form

Field Summary
static java.lang.String CVS_REVISION
          String containing the CVS revision.
 
Constructor Summary
ClientEvolveStrategy()
          Default constructor is necessary here as it will be called dynamically!
 
Method Summary
 void afterWorkRequestsSent()
           
 void evolve()
           
 JGAPRequest[] generateWorkRequests(JGAPRequest m_workReq, IRequestSplitStrategy m_splitStrategy, java.lang.Object data)
           
 void initialize(GridClient a_gc, Configuration a_config, IClientFeedback a_clientFeedback)
          Called at the very beginning and only once before distributed evolution starts.
 boolean isEvolutionFinished(int a_evolutionsDone)
           
 void onFinished()
          Called after evolution has finished.
 void resultReceived(JGAPResult a_result)
          Merge the received results as a basis for the next evolution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CVS_REVISION

public static final java.lang.String CVS_REVISION
String containing the CVS revision. Read out via reflection!

See Also:
Constant Field Values
Constructor Detail

ClientEvolveStrategy

public ClientEvolveStrategy()
Default constructor is necessary here as it will be called dynamically! Don't declare any other constructor as it will not be called!

Method Detail

initialize

public void initialize(GridClient a_gc,
                       Configuration a_config,
                       IClientFeedback a_clientFeedback)
                throws java.lang.Exception
Called at the very beginning and only once before distributed evolution starts.

Specified by:
initialize in interface IClientEvolveStrategy
Parameters:
a_gc - GridClient
a_config - Configuration
a_clientFeedback - IClientFeedback
Throws:
java.lang.Exception
Since:
3.2

afterWorkRequestsSent

public void afterWorkRequestsSent()
                           throws java.lang.Exception
Specified by:
afterWorkRequestsSent in interface IClientEvolveStrategy
Throws:
java.lang.Exception

isEvolutionFinished

public boolean isEvolutionFinished(int a_evolutionsDone)
Specified by:
isEvolutionFinished in interface IClientEvolveStrategy

onFinished

public void onFinished()
Called after evolution has finished.

Specified by:
onFinished in interface IClientEvolveStrategy

evolve

public void evolve()
            throws java.lang.Exception
Specified by:
evolve in interface IClientEvolveStrategy
Throws:
java.lang.Exception

generateWorkRequests

public JGAPRequest[] generateWorkRequests(JGAPRequest m_workReq,
                                          IRequestSplitStrategy m_splitStrategy,
                                          java.lang.Object data)
                                   throws java.lang.Exception
Specified by:
generateWorkRequests in interface IClientEvolveStrategy
Throws:
java.lang.Exception

resultReceived

public void resultReceived(JGAPResult a_result)
                    throws java.lang.Exception
Merge the received results as a basis for the next evolution.

Specified by:
resultReceived in interface IClientEvolveStrategy
Parameters:
a_result - JGAPResult
Throws:
java.lang.Exception

JGAP