Hide Comments
Hide Comments

Comments (0)

Represents the entire population (collection of RSGenerics.GeneticProgramming.TRSGPIndividual<T> ) in a genetic programming problem. The population class represents the set of candidate solutions in a genetic programming problem. In genetic programming ( RSGenerics.GeneticProgramming.TRSCustomGeneticProgramming<T> component), there is a population of individuals (TRSGPPopulation<T>), which contain tree-based DNA programs. Each candidate individual (represented by a TRSGPIndividual<T> class) has "DNA", which contains one program containing functions and terminals (constants and variables)

Genetic Programming works by evolving your population towards the solution of the problem. Parents are selected from the current generation to reproduce the children of the next generation. Evolving a new generation involves:
 

Selecting 2 parents (Individuals) to reproduce
Splicing the DNA program trees of the 2 parents together to make a child (the child inherits the parents trees or sub-trees)
Optionally Mutating and Inverting the DNA trees of the child to provide randomness
Repeating the above steps until the population of the new generation has been produced.

noteNote

This is a generics-based implementation of a genetic programming population. For the RSGeneticProgramming|TRSGeneticProgramming class, the generics class is instantiated as floating point values. However, you can define your own genetic programming component using whatever type you want.

Namespace: RSGenerics.GeneticProgramming

expandingInheritance Hierarchy

TOwnedCollection
  RSGeneticBase.TRSPopulation
    RSGenerics.GeneticProgramming.TRSGPPopulation<T>
 

expandingSyntax

Delphi

type
  TRSGPPopulation<T> = class(TRSPopulation)
  end; 
 

Type Parameters

T

expandingProperties

 

Name

Description

public property

Items[Integer]

Lists the individuals of the population object. Use the Items property to iterate through all the individuals. Index identifies the index in the range 0 to Count - 1.
 

Top

expandingMethods

 

Name

Description

public method

Add

creates a new individual (TRSGPIndividual<T>) and adds it to the Items array. Call Add to create an individual or solution in the collection. The new individual is placed at the end of the Items array. The Add method returns the new individual.

public method

Engine

Returns the IRSGeneticProgramEngine<T> that owns the collection (or nil if there is no owner that supports the IRSGeneticProgramEngine<T> interface)

public method

FindItemID(Integer)

Returns the Item with the specified ID. The FindItemID method returns the item in the collection whose ID property is passed to it as a parameter. If no item has the specified ID, FindItemID returns nil.

public method

Insert(Integer)

Creates a new instance and adds it to the Items array. Call Insert to add a new individual at a specified position in the collection. Existing items (starting from the specified position) are moved up in the Items array.

Insert returns the new individual.
 

public method

LoadFromXML(IXMLGPPopulation)

Overloaded. Loads an entire population and their dna from the XML parameter. The old population is first cleared.

public method

LoadFromXML(IXMLNode)

Overloaded. Loads an entire population and their dna from the XML parameter. The old population is first cleared. (Overrides RSGeneticBase.TRSPopulation.LoadFromXML(IXMLNode).)

protected method

Notify(TCollectionItem,TCollectionNotification)

Represents method Notify(TCollectionItem,TCollectionNotification). (Inherited from RSGeneticBase.TRSPopulation.)

public method

Owner

Returns the RSGeneticBase.TRSCustomGeneticComponent that owns the population. (Inherited from RSGeneticBase.TRSPopulation.)

public method

SaveToXML(IXMLGPPopulation)

Overloaded. Saves every individual of the population and its DNA to the XML parameter.

public method

SaveToXML(IXMLNode)

Overloaded. Saves every individual of the population and its chromosomes to the XML parameter. (Overrides RSGeneticBase.TRSPopulation.SaveToXML(IXMLNode).)

protected method

Update(TCollectionItem)

Represents method Update(TCollectionItem). (Inherited from RSGeneticBase.TRSPopulation.)

Top

expandingSee Also

Comments (0)