de.kumpe.hadooptimizer.examples.tutorial
Class GaussianMutator

java.lang.Object
  extended by de.kumpe.hadooptimizer.examples.tutorial.GaussianMutator
All Implemented Interfaces:
Mutator<Double>, NeedsRandomGenerator, Serializable

public class GaussianMutator
extends Object
implements Mutator<Double>, NeedsRandomGenerator

See Also:
Serialized Form

Constructor Summary
GaussianMutator(double variance)
           
 
Method Summary
 Double mutate(Double individual)
          Creates a mutant of the given individual.
 void setRandomGenerator(org.apache.commons.math.random.RandomGenerator randomGenerator)
          Injects a RandomGenerator instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaussianMutator

public GaussianMutator(double variance)
Method Detail

setRandomGenerator

public void setRandomGenerator(org.apache.commons.math.random.RandomGenerator randomGenerator)
Description copied from interface: NeedsRandomGenerator
Injects a RandomGenerator instance.

Specified by:
setRandomGenerator in interface NeedsRandomGenerator
Parameters:
randomGenerator - the new RandomGenerator instance

mutate

public Double mutate(Double individual)
Description copied from interface: Mutator
Creates a mutant of the given individual.

The general contract is to not modify the given individual, but return a mutated copy.

Specified by:
mutate in interface Mutator<Double>
Parameters:
individual - the individual to mutate
Returns:
the mutant of the passed individual


Copyright © 2011 Christian Kumpe. All Rights Reserved.