Orbital library

orbital.algorithm.evolutionary
Class PopulationImpl

java.lang.Object
  extended by orbital.algorithm.evolutionary.Population
      extended by orbital.algorithm.evolutionary.PopulationImpl
All Implemented Interfaces:
java.io.Serializable

public class PopulationImpl
extends Population

This class implements a population of genomes and provides methods for genetic algorithms.

Author:
André Platzer
See Also:
Serialized Form

Constructor Summary
PopulationImpl()
          Construct a new population with no properties set.
PopulationImpl(double maximumRecombination, double maximumMutation)
          Construct a new population.
PopulationImpl(int parentCount, int childrenCount, double maximumRecombination, double maximumMutation)
          Construct a new population.
 
Method Summary
 java.lang.Object clone()
          Returns a deep copy of this population.
static Population create(Genome prototype, int size)
           
 int getChildrenCount()
          Get the number of children produced with one reproduction involving parentCount parents.
 double getMaximumMutation()
          Get the maximum probability rating of mutation level for reproduction.
 double getMaximumRecombination()
          Get the maximum probability rating of recombining parental genomes per production.
 int getParentCount()
          Get the number of abstract parents required to produce children.
 void setChildrenCount(int n)
          Set the number of children produced with one reproduction involving parentCount parents.
 void setMaximumMutation(double mutation)
          Set the maximum probability rating of mutation level for reproduction.
 void setMaximumRecombination(double recombination)
          Set the maximum probability rating of recombining parental genomes per production.
 void setParentCount(int n)
          Set the number of abstract parents required to produce children.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class orbital.algorithm.evolutionary.Population
add, create, equals, evaluate, get, get, getFitnessArray, getGeneration, getMembers, getOverallDistance, hashCode, iterator, listIterator, listIterator, remove, remove, setGeneration, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PopulationImpl

public PopulationImpl()
Construct a new population with no properties set. The properties must be set, lateron, like the other constructors already do initially.


PopulationImpl

public PopulationImpl(int parentCount,
                      int childrenCount,
                      double maximumRecombination,
                      double maximumMutation)
Construct a new population.

Parameters:
parentCount - The number of abstract parents required to produce children.
childrenCount - The number of children produced with one reproduction involving parentCount parents.
maximumRecombination - Maximum recombination rating. Maximum probability rating of recombining parental genomes per production.
maximumMutation - Maximum mutation rating. Maximum probability rating of mutation level for reproduction.

PopulationImpl

public PopulationImpl(double maximumRecombination,
                      double maximumMutation)
Construct a new population. Default number of childrens and parents used for reproduction is 2.

Method Detail

clone

public java.lang.Object clone()
Returns a deep copy of this population.

Overrides:
clone in class Population

toString

public java.lang.String toString()
Description copied from class: Population
Returns a string representation of the object.

Overrides:
toString in class Population

getParentCount

public int getParentCount()
Get the number of abstract parents required to produce children.


setParentCount

public void setParentCount(int n)
Set the number of abstract parents required to produce children.

Preconditions:
n > 0

getChildrenCount

public int getChildrenCount()
Get the number of children produced with one reproduction involving parentCount parents.


setChildrenCount

public void setChildrenCount(int n)
Set the number of children produced with one reproduction involving parentCount parents.

Preconditions:
n >= 0

getMaximumRecombination

public double getMaximumRecombination()
Get the maximum probability rating of recombining parental genomes per production.


setMaximumRecombination

public void setMaximumRecombination(double recombination)
Set the maximum probability rating of recombining parental genomes per production.

Preconditions:
recombination∈[0,1] is a probability

getMaximumMutation

public double getMaximumMutation()
Get the maximum probability rating of mutation level for reproduction.


setMaximumMutation

public void setMaximumMutation(double mutation)
Set the maximum probability rating of mutation level for reproduction.

Preconditions:
mutation∈[0,1] is a probability

create

public static Population create(Genome prototype,
                                int size)

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.