de.kumpe.hadooptimizer
Class EaOptimizerConfiguration<I>

java.lang.Object
  extended by de.kumpe.hadooptimizer.OptimizerConfiguration<I>
      extended by de.kumpe.hadooptimizer.EaOptimizerConfigurationBase<I>
          extended by de.kumpe.hadooptimizer.EaOptimizerConfiguration<I>
Type Parameters:
I - the individuals' type
All Implemented Interfaces:
Serializable, Cloneable

public class EaOptimizerConfiguration<I>
extends EaOptimizerConfigurationBase<I>

A configuration for a general evolutionary algorithm. Additionally to the components in EaOptimizerConfigurationBase it contains:

Author:
Christian Kumpe
See Also:
Serialized Form

Constructor Summary
EaOptimizerConfiguration()
           
 
Method Summary
 EaOptimizerConfiguration<I> clone()
          Returns a shallow copy of this configuration.
 boolean equals(Object obj)
           
 Recombiner<I> getRecombiner()
           
 int hashCode()
           
 void injectRandomGenerator(org.apache.commons.math.random.RandomGenerator randomGenerator)
          Will inject the given RandomGenerator instance into all contained components which are implementing NeedsRandomGenerator.
 void setRecombiner(Recombiner<I> recombiner)
           
 String toString()
           
 void validate()
          Validates the configuration for completeness and correctness.
 
Methods inherited from class de.kumpe.hadooptimizer.EaOptimizerConfigurationBase
getEvaluator, getHalter, getMutator, getParents, isPreserveParents, setEvaluator, setHalter, setMutator, setParents, setPreserveParents
 
Methods inherited from class de.kumpe.hadooptimizer.OptimizerConfiguration
deepClone, getPopulationReader, getPopulationWriter, getRandomGeneratorFactory, injectRandomGenerator, setPopulationReader, setPopulationWriter, setRandomGeneratorFactory
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EaOptimizerConfiguration

public EaOptimizerConfiguration()
Method Detail

clone

public EaOptimizerConfiguration<I> clone()
Description copied from class: OptimizerConfiguration
Returns a shallow copy of this configuration. This will not clone the configuration's components.

Subclasses should override this method to cast the result to themself.

Overrides:
clone in class OptimizerConfiguration<I>
Returns:
the shallow copy of this configuration

injectRandomGenerator

public void injectRandomGenerator(org.apache.commons.math.random.RandomGenerator randomGenerator)
Will inject the given RandomGenerator instance into all contained components which are implementing NeedsRandomGenerator.

Subclasses must override this method, if they contain additional components. Then first call this method from the superclass and then call OptimizerConfiguration.injectRandomGenerator(Object, RandomGenerator) for their additional components.

Calls OptimizerConfiguration.injectRandomGenerator(Object, RandomGenerator) on the given populationReader and populationWriter.

Additionally calls OptimizerConfiguration.injectRandomGenerator(Object, RandomGenerator) on the given halter, mutator and evaluator.

Additionally calls OptimizerConfiguration.injectRandomGenerator(Object, RandomGenerator) on the given recombiner.

Overrides:
injectRandomGenerator in class EaOptimizerConfigurationBase<I>
Parameters:
randomGenerator - the RandomGenerator instance to inject

validate

public void validate()
Validates the configuration for completeness and correctness.

Subclasses have to override this method, then first call this method from the superclass and then do their own additional validation.

Verifies that a populationReader and populationWriter has been set.

Additionally verifies that a halter, mutator and evaluator has been set.

Additionally verifies that a recombiner has been set.

Overrides:
validate in class EaOptimizerConfigurationBase<I>
Throws:
IllegalStateException - if this configuration is not valid

getRecombiner

public final Recombiner<I> getRecombiner()
Returns:
the configured Recombiner; null if none has been set

setRecombiner

public final void setRecombiner(Recombiner<I> recombiner)
Parameters:
recombiner - the Recombiner for this configuration
Throws:
NullPointerException - if recombiner is null

hashCode

public int hashCode()
Overrides:
hashCode in class EaOptimizerConfigurationBase<I>

equals

public boolean equals(Object obj)
Overrides:
equals in class EaOptimizerConfigurationBase<I>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Christian Kumpe. All Rights Reserved.