jenes.stage.operator
Class Scaling<T extends Chromosome>

java.lang.Object
  extended by jenes.stage.AbstractStage<T>
      extended by jenes.stage.operator.Operator<T>
          extended by jenes.stage.operator.Scaling<T>
Direct Known Subclasses:
RankScaling

public abstract class Scaling<T extends Chromosome>
extends Operator<T>

Author:
troiano

Nested Class Summary
 
Nested classes/interfaces inherited from class jenes.stage.operator.Operator
Operator.Statistics
 
Field Summary
 
Fields inherited from class jenes.stage.operator.Operator
random, statistics
 
Fields inherited from class jenes.stage.AbstractStage
biggerIsBetter, ga
 
Constructor Summary
Scaling()
          Constructs a new mutator instance with the specified mutator probability
 
Method Summary
 void preprocess(double[] scores, boolean[] legals)
           
 void process(Population<T> in, Population<T> out)
          Processes the input population and tranforms it into the output population.
abstract  double scale(Individual<T> ind, int pos)
           
 
Methods inherited from class jenes.stage.operator.Operator
getStatistics, updateStatistics
 
Methods inherited from class jenes.stage.AbstractStage
dispose, init, isBiggerBetter, setBiggerIsBetter, setBiggerIsBetter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scaling

public Scaling()
Constructs a new mutator instance with the specified mutator probability

Parameters:
probability - the mutator probability
Method Detail

process

public final void process(Population<T> in,
                          Population<T> out)
                   throws StageException
Description copied from class: AbstractStage
Processes the input population and tranforms it into the output population. Note: - Out population is made of recicled individuals. There is a need of new individuals to add only when there is a need to increase the population size. For pre-initalized individual just use setAs method. This is done for an efficient memory management. - A stage can modify the input population. So input passed to process method can be mutated when the process method ends.

Specified by:
process in class AbstractStage<T extends Chromosome>
Parameters:
in - the input population
out - the output population
Throws:
StageException

preprocess

public void preprocess(double[] scores,
                       boolean[] legals)

scale

public abstract double scale(Individual<T> ind,
                             int pos)