Package ec.eda.pbil

# Class PBILSpecies

java.lang.Object
ec.Species
ec.vector.VectorSpecies
ec.vector.IntegerVectorSpecies
ec.eda.pbil.PBILSpecies

All Implemented Interfaces:
  `Prototype`, `Setup`, `Serializable`, `Cloneable`

public class PBILSpecies extends IntegerVectorSpecies
PBILSpecies is an IntegerVectorSpecies which implements a faithful version of the PBIL algorithm. The class has two basic methods. The newIndividual(...) method generates a new random individual underneath the current PBIL marginal distribution. The updateDistribution(...) method revises the marginal distribution to reflect the fitness results of the population.

PBILSpecies must be used in combination with PBILBreeder, which will call it at appropriate times to revise the distribution and to generate a new subpopulation of individuals. Since the initial population is built based on the marginal distributions, SimpleInitializer is used to generate the initial population.

PBILSpecies needs the population size and also truncation size. The truncation size which is the 'b' parameter, denotes how many fittest individuals to pick out from the generated population of individuals. It also needs the genome size and the minimum and maximum values of the genes. The size of the range of min and max gene values should be specified for each gene in the parameters file.

PBILSpecies also uses the learning rate 'alpha' based on which it decides the amount of old distribution to be retained and how much of the new distribution to be added. 'alpha' and 'b' values are printed out when running so the user may see what values it used for that given run.

Parameters

base.`alpha` Floating-point value ranging from 0 to 1.0 | (the learning rate parameter) If not provided, this defaults to 0.05.
base.`popsize` Integer > 0 | (pop.subpop.0.size population size) This parameter must be provided.
base.`b` Integer ranging from 1 to popsize | (b truncated population size) This parameter must be provided.
base.`n` Integer > 1 | (n genome size) This parameter must be provided.

Default Base
eda.pbil.species

See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `double`
  `alpha`
  `int`
  `b`
  `static final String`
  `P_ALPHA`
  `static final String`
  `P_B`
  `static final String`
  `P_PBIL_SPECIES`

  ### Fields inherited from class ec.vector.IntegerVectorSpecies

  `C_RANDOM_WALK_MUTATION, C_RESET_MUTATION, maxGene, minGene, mutationIsBounded, mutationType, P_MAXGENE, P_MINGENE, P_MUTATION_BOUNDED, P_MUTATIONTYPE, P_NUM_SEGMENTS, P_RANDOM_WALK_PROBABILITY, P_SEGMENT, P_SEGMENT_END, P_SEGMENT_START, P_SEGMENT_TYPE, randomWalkProbability, V_RANDOM_WALK_MUTATION, V_RESET_MUTATION`

  ### Fields inherited from class ec.vector.VectorSpecies

  `C_ANY_POINT, C_GEOMETRIC, C_INTERMED_RECOMB, C_LINE_RECOMB, C_NONE, C_ONE_POINT, C_ONE_POINT_NO_NOP, C_SIMULATED_BINARY, C_TWO_POINT, C_TWO_POINT_NO_NOP, C_UNIFORM, chunksize, crossoverDistributionIndex, crossoverProbability, crossoverType, duplicateRetries, dynamicInitialSize, genomeIncreaseProbability, genomeResizeAlgorithm, genomeSize, lineDistance, maxInitialSize, minInitialSize, mutationProbability, P_CHUNKSIZE, P_CROSSOVER_DISTRIBUTION_INDEX, P_CROSSOVERPROB, P_CROSSOVERTYPE, P_DUPLICATE_RETRIES, P_GENOMESIZE, P_GEOMETRIC_PROBABILITY, P_LINEDISTANCE, P_MUTATIONPROB, P_UNIFORM_MAX, P_UNIFORM_MIN, P_VECTORSPECIES, V_ANY_POINT, V_GEOMETRIC, V_INTERMED_RECOMB, V_LINE_RECOMB, V_ONE_POINT, V_ONE_POINT_NO_NOP, V_SIMULATED_BINARY, V_TWO_POINT, V_TWO_POINT_NO_NOP, V_UNIFORM`

  ### Fields inherited from class ec.Species

  `f_prototype, i_prototype, P_FITNESS, P_INDIVIDUAL, P_PIPE, pipe_prototype`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PBILSpecies()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.
  `double[]`
  `getMarginalDistribution(int gene)`
  `Individual`
  `newIndividual(EvolutionState state, int thread)`
  Provides a brand-new individual to fill in a population.
  `void`
  `setup(EvolutionState state, Parameter base)`
  The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities.
  `void`
  `updateDistribution(EvolutionState state, Subpopulation subpop)`
  Revises the PBIL distribution to reflect the current fitness results in the provided subpopulation.

  ### Methods inherited from class ec.vector.IntegerVectorSpecies

  `inNumericalTypeRange, inNumericalTypeRange, loadParametersForGene, maxGene, minGene, mutationIsBounded, mutationType, randomWalkProbability`

  ### Methods inherited from class ec.vector.VectorSpecies

  `contains, contains, contains, contains, defaultBase, duplicateRetries, fill, fill, fill, fill, initializeGenomeSegmentsByEndIndices, initializeGenomeSegmentsByStartIndices, mutationProbability, setupGenome`

  ### Methods inherited from class ec.Species

  `buildMisc, newIndividual, newIndividual, updateIndividual, updateSubpopulation`

  ### Methods inherited from class java.lang.Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### P_PBIL_SPECIES

    public static final String P_PBIL_SPECIES
    See Also:
      - Constant Field Values

  - ### P_ALPHA

    public static final String P_ALPHA
    See Also:
      - Constant Field Values

  - ### P_B

    public static final String P_B
    See Also:
      - Constant Field Values

  - ### alpha

    public double alpha

  - ### b

    public int b

- ## Constructor Details

  - ### PBILSpecies

    public PBILSpecies()

- ## Method Details

  - ### getMarginalDistribution

    public double[] getMarginalDistribution(int gene)

  - ### setup

    public void setup(EvolutionState state, Parameter base)
    Description copied from class: `Species`
    The default version of setup(...) loads requested pipelines and calls setup(...) on them and normalizes their probabilities. If your individual prototype might need to know special things about the species (like parameters stored in it), then when you override this setup method, you'll need to set those parameters BEFORE you call super.setup(...), because the setup(...) code in Species sets up the prototype.
    Specified by:
      `setup` in interface `Prototype`
    Specified by:
      `setup` in interface `Setup`
    Overrides:
      `setup` in class `IntegerVectorSpecies`
    See Also:
      - `Prototype.setup(EvolutionState,Parameter)`

  - ### clone

    public Object clone()
    Description copied from interface: `Prototype`
    Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.

    Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:

    - If you hold objects which are shared with other instances, don't clone them.
    - If you hold objects which must be unique, clone them.
    - If you hold objects which were given to you as a gesture of kindness, and aren't owned by you, you probably shouldn't clone them.
    - DON'T attempt to clone: Singletons, Cliques, or Populations, or Subpopulation.
    - Arrays are not cloned automatically; you may need to clone an array if you're not sharing it with other instances. Arrays have the nice feature of being copyable by calling clone() on them.

    Implementations.

    - If no ancestor of yours implements clone(), and you have no need to do clone deeply, and you are abstract, then you should not declare clone().
    - If no ancestor of yours implements clone(), and you have no need to do clone deeply, and you are not abstract, then you should implement it as follows:

      ``

           public Object clone()
               {
               try
                   {
                   return super.clone();
                   }
               catch ((CloneNotSupportedException e)
                   { throw new InternalError(); } // never happens
               }

    - If no ancestor of yours implements clone(), but you need to deep-clone some things, then you should implement it as follows:

      ``

           public Object clone()
               {
               try
                   {
                   MyObject myobj = (MyObject) (super.clone());

                   // put your deep-cloning code here...
                   }
               catch ((CloneNotSupportedException e)
                   { throw new InternalError(); } // never happens
               return myobj;
               }

    - If an ancestor has implemented clone(), and you also need to deep clone some things, then you should implement it as follows:

      ``

           public Object clone()
               {
               MyObject myobj = (MyObject) (super.clone());

               // put your deep-cloning code here...

               return myobj;
               }

    Specified by:
      `clone` in interface `Prototype`
    Overrides:
      `clone` in class `Species`

  - ### newIndividual

    public Individual newIndividual(EvolutionState state, int thread)
    Description copied from class: `Species`
    Provides a brand-new individual to fill in a population. The default form simply calls clone(), creates a fitness, sets evaluated to false, and sets the species. If you need to make a more custom genotype (as is the case for GPSpecies, which requires a light rather than deep clone), you will need to override this method as you see fit.
    Overrides:
      `newIndividual` in class `VectorSpecies`

  - ### updateDistribution

    public void updateDistribution(EvolutionState state, Subpopulation subpop)
    Revises the PBIL distribution to reflect the current fitness results in the provided subpopulation.