iterator
Class BasicRealEncodedGA<T extends BoundConstrainedProblem>

java.lang.Object
  extended by iterator.AbstractIterator
      extended by iterator.AbstractOptimizer<T>
          extended by iterator.AbstractInitialSampleBasedOptimizer<T>
              extended by iterator.AbstractPopulationOptimizer<T>
                  extended by iterator.BasicRealEncodedGA<T>
Type Parameters:
T -
All Implemented Interfaces:
DataListener, InitialSamplesSettable, Iterable, LoggableIterator, RepeatableLoggableIterator
Direct Known Subclasses:
NSGA2, PCGA

public abstract class BasicRealEncodedGA<T extends BoundConstrainedProblem>
extends AbstractPopulationOptimizer<T>

Base class for real-encoded GAs. Uses an n-point crossover such as that in PCGA.

Author:
dgorur

Field Summary
protected  DataPointComparer comparator
           
protected  double extrapolationFactor
           
protected  double interpolationFactor
           
protected  cern.colt.matrix.DoubleMatrix1D xMutation
           
 
Fields inherited from class iterator.AbstractPopulationOptimizer
currentBestG, lastBestG, nextBlock
 
Fields inherited from class iterator.AbstractInitialSampleBasedOptimizer
uniform
 
Fields inherited from class iterator.AbstractOptimizer
doubleFormat, funEvalCount, logWriter
 
Fields inherited from class iterator.AbstractIterator
diagnosticString, iter
 
Constructor Summary
BasicRealEncodedGA()
           
 
Method Summary
 double getExtrapolationFactor()
          Returns the extrapolation factor.
 double getInterpolationFactor()
          Returns the interpolation factor.
 Hypercube getMutationBox()
          Returns the mutation box.
 double getMutationFraction()
          Returns the mutation fraction.
 double getMutationProbability()
          Returns the probability of mutation.
 DataPoint[] getPopulation()
           
 void init()
          Initialization routine
protected  void initializePopulation()
          Creates an initial population.
protected  void makeChildren(cern.colt.matrix.DoubleMatrix1D xBetter, cern.colt.matrix.DoubleMatrix1D xWorse, cern.colt.matrix.DoubleMatrix1D xChild1, cern.colt.matrix.DoubleMatrix1D xChild2)
          Creates children from the given parents and performs mutations, restricted to problem bounds.
 void setExtrapolationFactor(double extrapolationFactor)
          Sets the extrapolation factor.
 void setInterpolationFactor(double interpolationFactor)
          Sets the interpolation factor.
 void setMutationBox(Hypercube mutationBox)
          Sets the mutation box.
 void setMutationFraction(double fraction)
          Sets the mutation fraction.
 void setMutationProbability(double mutationProbability)
          Sets the mutation probability.
 
Methods inherited from class iterator.AbstractPopulationOptimizer
computeNextPoints, evaluatePoints, getPopulationSize, setInitialSamples, setInitialSamples, setInitialSamples, setPopulationSize, singleIteration
 
Methods inherited from class iterator.AbstractInitialSampleBasedOptimizer
getRandomSeed, makeInitialSamples, setRandomSeed
 
Methods inherited from class iterator.AbstractOptimizer
clear, dataAdded, dataAdded, dataRemoved, dataRemoved, getDataHandler, getFunEvalCount, getLogFileName, getMaxFunEval, getProblem, isTerminated, iterate, setDataHandler, setFunEvalCount, setLogFileName, setMaxFunEval, setProblem, updateDiagnostics, writeInitialRunLog
 
Methods inherited from class iterator.AbstractIterator
isVerbose, printDiagnostics, setVerbose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface iterator.LoggableIterator
getLogFileName, setLogFileName
 
Methods inherited from interface iterator.Iterable
isTerminated, iterate
 

Field Detail

comparator

protected DataPointComparer comparator

extrapolationFactor

protected double extrapolationFactor

interpolationFactor

protected double interpolationFactor

xMutation

protected cern.colt.matrix.DoubleMatrix1D xMutation
Constructor Detail

BasicRealEncodedGA

public BasicRealEncodedGA()
Method Detail

getExtrapolationFactor

public double getExtrapolationFactor()
Returns the extrapolation factor. To be used in

x_child = extrapolationFactor*x_father + (1-extrapolationFactor)*x_Mother.

Returns:
the extrapolation factor.

getInterpolationFactor

public double getInterpolationFactor()
Returns the interpolation factor. To be used in

x_child = interpolationFactor*x_father + (1-interpolationFactor)*x_Mother.

Returns:
the interpolation factor.

getMutationBox

public Hypercube getMutationBox()
Returns the mutation box. Mutations are performed in an axis-aligned hypercube centered around a population member, and this box describes the extents of that hypercube..

Returns:
the mutation box.

getMutationFraction

public double getMutationFraction()
Returns the mutation fraction. This is a nice way of specifying a mutation box, each of whose sides is a fixed fraction of the corresponding problem bounds.

Returns:
the mutation fraction.

getMutationProbability

public double getMutationProbability()
Returns the probability of mutation.

Returns:
the mutation probability.

getPopulation

public DataPoint[] getPopulation()

init

public void init()
Description copied from interface: Iterable
Initialization routine

Specified by:
init in interface Iterable
Overrides:
init in class AbstractPopulationOptimizer<T extends BoundConstrainedProblem>

setExtrapolationFactor

public void setExtrapolationFactor(double extrapolationFactor)
Sets the extrapolation factor.

Parameters:
extrapolationFactor - the given extrapolation factor.

setInterpolationFactor

public void setInterpolationFactor(double interpolationFactor)
Sets the interpolation factor.

Parameters:
interpolationFactor - the given interpolation factor.

setMutationBox

public void setMutationBox(Hypercube mutationBox)
Sets the mutation box.

Parameters:
mutationBox - the given mutation box.

setMutationFraction

public void setMutationFraction(double fraction)
Sets the mutation fraction.

Parameters:
fraction - the given mutation fraction.

setMutationProbability

public void setMutationProbability(double mutationProbability)
Sets the mutation probability.

Parameters:
mutationProbability - the given mutation probability.

initializePopulation

protected void initializePopulation()
Creates an initial population.


makeChildren

protected void makeChildren(cern.colt.matrix.DoubleMatrix1D xBetter,
                            cern.colt.matrix.DoubleMatrix1D xWorse,
                            cern.colt.matrix.DoubleMatrix1D xChild1,
                            cern.colt.matrix.DoubleMatrix1D xChild2)
Creates children from the given parents and performs mutations, restricted to problem bounds.

Parameters:
xBetter - better parent.
xWorse - worse parent.