iterator
Class AbstractPopulationOptimizer<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>
Type Parameters:
T - the type of OptimizationProblem being solved.
All Implemented Interfaces:
DataListener, InitialSamplesSettable, Iterable, LoggableIterator, RepeatableLoggableIterator
Direct Known Subclasses:
BasicRealEncodedGA, ISIS

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

Optimization algorithm that evaluates an entire population at each iteration.

Author:
dgorur

Field Summary
protected  double currentBestG
           
protected  double lastBestG
           
protected  DataBlock 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
AbstractPopulationOptimizer()
           
 
Method Summary
protected abstract  cern.colt.matrix.DoubleMatrix2D computeNextPoints()
          Computes the next set of candidate solutions.
protected  void evaluatePoints(cern.colt.matrix.DoubleMatrix2D nextPoints)
          Evaluates the objective (and constraints) given set of points.
 int getPopulationSize()
          Returns the population size.
 void init()
          Initialization routine
 void setInitialSamples(DataBlock block)
          Sets the given block of samples as the set of initial samples.
 void setInitialSamples(cern.colt.matrix.DoubleMatrix2D initialSamples)
           
 void setInitialSamples(cern.colt.matrix.DoubleMatrix2D x, cern.colt.matrix.DoubleMatrix2D y)
          Sets the initial samples as per the given inputs and outputs.
 void setPopulationSize(int populationSize)
          Sets the population size.
 void singleIteration()
          Performs a single iteration.
 
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

currentBestG

protected double currentBestG

lastBestG

protected double lastBestG

nextBlock

protected DataBlock nextBlock
Constructor Detail

AbstractPopulationOptimizer

public AbstractPopulationOptimizer()
Method Detail

getPopulationSize

public int getPopulationSize()
Returns the population size.

Returns:
the population size.

init

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

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

setInitialSamples

public void setInitialSamples(DataBlock block)
Description copied from interface: InitialSamplesSettable
Sets the given block of samples as the set of initial samples. Note: this block contains inputs and outputs.

Parameters:
block - the given DataBlock.

setInitialSamples

public void setInitialSamples(cern.colt.matrix.DoubleMatrix2D initialSamples)
Parameters:
initialSamples - initial matrix of points, stored row-wise.

setInitialSamples

public void setInitialSamples(cern.colt.matrix.DoubleMatrix2D x,
                              cern.colt.matrix.DoubleMatrix2D y)
Description copied from interface: InitialSamplesSettable
Sets the initial samples as per the given inputs and outputs.

Parameters:
x - the given set of inputs.
y - the given set of outputs.

setPopulationSize

public void setPopulationSize(int populationSize)
Sets the population size.

Parameters:
populationSize - the given population size.

singleIteration

public void singleIteration()
Description copied from interface: Iterable
Performs a single iteration.


computeNextPoints

protected abstract cern.colt.matrix.DoubleMatrix2D computeNextPoints()
Computes the next set of candidate solutions.

Returns:
a DoubleMatrix2D containing design points row-wise.

evaluatePoints

protected void evaluatePoints(cern.colt.matrix.DoubleMatrix2D nextPoints)
Evaluates the objective (and constraints) given set of points.

Parameters:
nextPoints - the given set of inputs, row-wise.