de.kumpe.hadooptimizer.impl
Class DuplicatingRecombiner<I>

java.lang.Object
  extended by de.kumpe.hadooptimizer.impl.DuplicatingRecombiner<I>
Type Parameters:
I - the individual's type
All Implemented Interfaces:
NeedsRandomGenerator, Recombiner<I>, Serializable

public final class DuplicatingRecombiner<I>
extends Object
implements Recombiner<I>, NeedsRandomGenerator

A Recombiner which creates the given number of offspring by randomly selecting and duplicating a parents.

It does not copy the parents! It only "duplicate" the reference.

Author:
Christian Kumpe
See Also:
Serialized Form

Constructor Summary
DuplicatingRecombiner(int offspring)
          Creates a new DuplicatingRecombiner which generated the given number of offspring.
 
Method Summary
 int getOffspring()
           
 Collection<I> recombine(Collection<EvaluationResult<I>> parentResults)
          Recombines the children from the parents in the given evaluationResults.
 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

DuplicatingRecombiner

public DuplicatingRecombiner(int offspring)
Creates a new DuplicatingRecombiner which generated the given number of offspring.

Parameters:
offspring - the number of offspring to create in recombination
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

getOffspring

public int getOffspring()

recombine

public Collection<I> recombine(Collection<EvaluationResult<I>> parentResults)
Description copied from interface: Recombiner
Recombines the children from the parents in the given evaluationResults.

Specified by:
recombine in interface Recombiner<I>
Returns:
the newly created children, they may not be modified parent-objects
See Also:
Recombiner


Copyright © 2011 Christian Kumpe. All Rights Reserved.