Show/Hide Toolbars

RiverSoftAVG Products Help

Navigation: Code Documentation > GeneticAlgorithm > RSGeneticProgramming > Classes

TRSGeneticProgrammingVariant Class

Scroll Prev Top Next More

The TRSGeneticProgrammingVariant component is the descendant class of the RSGeneticProgramming.TRSCustomGeneticProgrammingVariant component which publishes all the properties needed to use genetic algorithms in your programs.

Genetic programming is a computer science method, inspired by evolutionary biology, for automatically solving problems, without having to know or define the form or structure of optimum problem structure beforehand. You define the basic building blocks (functions, constants, and variables) of the problem and then the component does the rest. Genetic programming solves problems by evolving a group or population of candidate individuals through successive generations, selecting fitter (or better) child individuals for each generation, until a solution is found. It uses evolutionary biology techniques such as inheritance, mutation, selection, and crossover (also called recombination).

The TRSGeneticProgrammingVariant class contains a population of individuals (TRSGPPopulation<Variant>), which contain genetic program trees as DNA. These DNA are used to represent the solution to the search problem. They represent the functions, constants, and variables of each candidate solution (or individual), represented by a TRSGPIndividual<Variant> class.

After setting up the    Instructions that your genetic programs can use, you set the RSGeneticProgramming.TRSGeneticProgrammingVariant.InitialPopulation , define a fitness function ( RSGeneticProgramming.TRSGeneticProgrammingVariant.OnEvaluateFitness event) to properly "score" each individual, and then Evolve your solution.
 

alert_noteTip

The TRSGeneticProgrammingVariant component uses more memory and will be generally slower than the TRSGeneticProgramming component (which uses doubles as opposed to variants). On the other hand, variants can pass around many more types of values and generally be more flexible. However, it is important to remember that your functions must satisfy the closure property, i.e., all functions in the instructions should be able to accept any other function or terminal as inputs.

alert_noteNotes to Implementers

The TRSGeneticProgrammingVariant class redeclares the Instructions property and OnConstantMutation event to use instantiated generics types that look like non-generic types. Unfortunately, when a published property contains a generic, even an instantiated one (e.g., TRSGPInstructions<Variant>), Delphi will not publish the property and make it available at design-time.

Namespace: RSGeneticProgramming

RiverSoftAVG Products Help © 1996-2016 Thomas G. Grubb