JGAP

org.jgap.distr.grid
Class JGAPRequest

java.lang.Object
  extended by WorkRequest
      extended by org.jgap.distr.grid.JGAPRequest
All Implemented Interfaces:
java.lang.Cloneable, ICloneable
Direct Known Subclasses:
MyRequest

public class JGAPRequest
extends WorkRequest
implements ICloneable

An instance that creates single requests to be sent to a worker.

Since:
3.1

Constructor Summary
JGAPRequest(java.lang.String a_name, int a_id, Configuration a_config)
          Constructor.
JGAPRequest(java.lang.String a_name, int a_id, Configuration a_config, IWorkerEvolveStrategy a_strategy)
          Constructor.
JGAPRequest(java.lang.String a_name, int a_id, Configuration a_config, Population a_pop)
          Constructor.
JGAPRequest(java.lang.String a_name, int a_id, Configuration a_config, Population a_pop, IWorkerEvolveStrategy a_strategy)
          Constructor.
 
Method Summary
 java.lang.Object clone()
           
 Configuration getConfiguration()
           
 IGenotypeInitializer getGenotypeInitializer()
           
 Population getPopulation()
           
 IWorkerEvolveStrategy getWorkerEvolveStrategy()
           
 GridWorkerFeedback getWorkerFeedback()
           
 IWorkerReturnStrategy getWorkerReturnStrategy()
           
 JGAPRequest newInstance(java.lang.String a_name, int a_ID)
          Creates a new instance using the given name and ID.
 void setConfiguration(Configuration a_conf)
          Set a modified configuration.
 void setEvolveStrategy(IWorkerEvolveStrategy a_evolveStrategy)
          Sets the strategy to use for executing the evolution with a worker for a single request.
 void setGenotypeInitializer(IGenotypeInitializer a_initializer)
           
 void setPopulation(Population a_pop)
          Sets the Population to store in this request so that it can be passed to workers.
 void setWorkerFeedback(GridWorkerFeedback a_feedback)
           
 void setWorkerReturnStrategy(IWorkerReturnStrategy a_strategy)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JGAPRequest

public JGAPRequest(java.lang.String a_name,
                   int a_id,
                   Configuration a_config,
                   IWorkerEvolveStrategy a_strategy)
Constructor.

Parameters:
a_name - String
a_id - int
a_config - Configuration
a_strategy - the strategy to choose for evolution
Since:
3.1

JGAPRequest

public JGAPRequest(java.lang.String a_name,
                   int a_id,
                   Configuration a_config)
Constructor.

Parameters:
a_name - session name
a_id - request id
a_config - Configuration
Since:
3.1

JGAPRequest

public JGAPRequest(java.lang.String a_name,
                   int a_id,
                   Configuration a_config,
                   Population a_pop,
                   IWorkerEvolveStrategy a_strategy)
Constructor. Allows to specify a preset population with which the genotype will be initialized.

Parameters:
a_name - session name
a_id - request id
a_config - Configuration
a_pop - Population
a_strategy - the strategy to choose for evolution
Since:
3.2

JGAPRequest

public JGAPRequest(java.lang.String a_name,
                   int a_id,
                   Configuration a_config,
                   Population a_pop)
Constructor. Allows to specify a preset population with which the genotype will be initialized.

Parameters:
a_name - session name
a_id - request id
a_config - Configuration
a_pop - Population
Since:
3.2
Method Detail

setEvolveStrategy

public void setEvolveStrategy(IWorkerEvolveStrategy a_evolveStrategy)
Sets the strategy to use for executing the evolution with a worker for a single request.

Parameters:
a_evolveStrategy - the evolve strategy to use
Since:
3.2

getWorkerEvolveStrategy

public IWorkerEvolveStrategy getWorkerEvolveStrategy()
Returns:
the evolve strategy set
Since:
3.2

setWorkerReturnStrategy

public void setWorkerReturnStrategy(IWorkerReturnStrategy a_strategy)

getWorkerReturnStrategy

public IWorkerReturnStrategy getWorkerReturnStrategy()
Returns:
the strategy which part of a result is returned by a worker
Since:
3.2

getWorkerFeedback

public GridWorkerFeedback getWorkerFeedback()

setWorkerFeedback

public void setWorkerFeedback(GridWorkerFeedback a_feedback)

setGenotypeInitializer

public void setGenotypeInitializer(IGenotypeInitializer a_initializer)
Parameters:
a_initializer - the IGenotypeInitializer to use
Since:
3.2

getGenotypeInitializer

public IGenotypeInitializer getGenotypeInitializer()
Returns:
the IGenotypeInitializer set
Since:
3.2

setPopulation

public void setPopulation(Population a_pop)
Sets the Population to store in this request so that it can be passed to workers.

Parameters:
a_pop - the Population to store
Since:
3.2

getConfiguration

public Configuration getConfiguration()
Returns:
the configuration set
Since:
3.1

setConfiguration

public void setConfiguration(Configuration a_conf)
Set a modified configuration. Should only be used to re-set a configuration because some parts have not been serialized.

Parameters:
a_conf - the Configuration to set
Since:
3.2

getPopulation

public Population getPopulation()
Returns:
the population used to initialize new requests. May be null or empty
Since:
3.2

clone

public java.lang.Object clone()
Specified by:
clone in interface ICloneable
Returns:
deep clone of current instance
Since:
3.2

newInstance

public JGAPRequest newInstance(java.lang.String a_name,
                               int a_ID)
Creates a new instance using the given name and ID. Reason for this method: ID cannot be set other than with construction!

Parameters:
a_name - the name to set
a_ID - unique ID to set
Returns:
newly created JGAPRequest object
Since:
3.2

JGAP