ec.de
Class Rand1EitherOrDEBreeder

java.lang.Object
  extended by ec.Breeder
      extended by ec.de.DEBreeder
          extended by ec.de.Rand1EitherOrDEBreeder
All Implemented Interfaces:
Setup, Singleton, java.io.Serializable

public class Rand1EitherOrDEBreeder
extends DEBreeder

Rand1EitherOrDEBreeder is a differential evolution breeding operator. The code is derived from a DE algorithm, known as DE/rand/1/either-or, found on page 141 of "Differential Evolution: A Practical Approach to Global Optimization" by Kenneth Price, Rainer Storn, and Jouni Lampinen.

Rand1EitherOrDEBreeder requires that all individuals be DoubleVectorIndividuals.

In short, the algorithm is as follows. For each individual in the population, we produce a child by selecting three (different) individuals, none the original individual, called r0, r1, and r2. We then create an individal c, defined either c = r0 + F * (r1 - r2), or as c = r0 + 0.5 * (F+1) * (r1 + r2 - 2 * r0), depending on a coin flip of probability "PF" (if 'true', the first equation is used, else the second). Unlike the other DEBreeders in this package, we do *not* cross over the child with the original individual. In fact, if the crossover probability is specified, Rand1EitherOrDEBreeder will issue a warning that it's not using it.

This class should be used in conjunction with DEEvaluator, which allows the children to enter the population only if they're superior to their parents (the original individuals). If so, they replace their parents.

Parameters

base.pf
0.0 <= double <= 1.0
The "PF" probability of mutation type

See Also:
Serialized Form

Field Summary
static java.lang.String P_PF
           
 double PF
           
 
Fields inherited from class ec.de.DEBreeder
bestSoFarIndex, Cr, CR_UNSPECIFIED, F, P_Cr, P_F, previousPopulation
 
Constructor Summary
Rand1EitherOrDEBreeder()
           
 
Method Summary
 DoubleVectorIndividual createIndividual(EvolutionState state, int subpop, int index, int thread)
           
 void setup(EvolutionState state, Parameter base)
          Sets up the object by reading it from the parameters stored in state, built off of the parameter base base.
 
Methods inherited from class ec.de.DEBreeder
breedPopulation, crossover, prepareDEBreeder, valid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PF

public double PF

P_PF

public static final java.lang.String P_PF
See Also:
Constant Field Values
Constructor Detail

Rand1EitherOrDEBreeder

public Rand1EitherOrDEBreeder()
Method Detail

setup

public void setup(EvolutionState state,
                  Parameter base)
Description copied from interface: Setup
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. If an ancestor implements this method, be sure to call super.setup(state,base); before you do anything else.

Specified by:
setup in interface Setup
Overrides:
setup in class DEBreeder

createIndividual

public DoubleVectorIndividual createIndividual(EvolutionState state,
                                               int subpop,
                                               int index,
                                               int thread)
Overrides:
createIndividual in class DEBreeder