Package ec.eda.pbil

Class 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:
  • Field Details

  • 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:
    • 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.