Hide Comments
Hide Comments

Comments (0)

expandingMethods

 

Name

Description

public method

Assign(TPersistent)

Represents method Assign(TPersistent). (Overrides RSGeneticBase.TRSCustomGeneticComponent.Assign(TPersistent).)

public method

AssignAll(TPersistent)

Represents method AssignAll(TPersistent).

protected method

CreateInstructions(TCollectionItemClass)

Creates the instructions collection

public method

CreateNode(TInstruction,TNode)

Creates a node (genetic program element) of the correct type and initializes its Instruction and Parent to the parameters

noteNote

This method ensures the     MaxNodeArity limit is not violated. Call this function when you want to create a node to use with this component.

protected method

CreatePopulation(TRSIndividualClass)

Creates the population collection (Overrides RSGeneticBase.TRSCustomGeneticComponent.CreatePopulation(TRSIndividualClass).)

protected method

DefineProperties(TFiler)

Represents method DefineProperties(TFiler). (Overrides RSGeneticBase.TRSCustomGeneticComponent.DefineProperties(TFiler).)

public method

Describe(TStrings,String)

Provides a description of the genetic programming component and its important properties. The description is added to the Strings parameter. The TabStr parameter specifies the indentation to use when adding sub-strings. (Overrides RSGeneticBase.TRSCustomGeneticComponent.Describe(TStrings,String).)

protected method

DoAntiBloating(TRSIndividual,TRSIndividual,TRSIndividual,Boolean)

Performs the actual anti-bloating strategy after the new child has been created. The IsChildModified parameter indicates if the child was mutated or inverted

noteNote

Not all anti-bloating strategies occur in this method

protected method

DoCalculateWeightedFitnessStatistics

Calculates the weighted fitness statistics (max, min, avg) for one generation. The method accesses each individual's WeightedFitness property which may force a fitness evaulation to occur. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoCalculateWeightedFitnessStatistics.)

protected method

DoConstantMutation(TIndividual)

Performs a constant mutation (changes the constant of a tree node)

protected method

DoCrossover(TRSIndividual,TRSIndividual,TRSIndividual,TRSIndividual)

Performs the actual crossover operation. The decision to crossover has already been decided by the time this method is called. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoCrossover(TRSIndividual,TRSIndividual,TRSIndividual,TRSIndividual).)

protected method

DoEvaluateWeightedFitness(TRSIndividual)

Calls the OnEvaluateWeightedFitness event and returns the result. If the event handler has not been defined, this method returns the regular fitness (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoEvaluateWeightedFitness(TRSIndividual).)

protected method

DoFairCrossover(TRSIndividual,TRSIndividual,TRSIndividual)

Represents method DoFairCrossover(TRSIndividual,TRSIndividual,TRSIndividual).

protected method

DoHoistMutation(TIndividual)

Performs a hoist mutation. Hoist mutation replaces the entire child program tree with a subtree from the child (the subtree becomes the root node). This has the effect of reducing the complexity of the child.

protected method

DoInitialize

Performs the actual initialization of the Population before evolution occurs.

The method returns number of duplicates fixed.

protected method

DoInitializeFull(TNode,Integer,Integer)

Initializes a genetic program tree to the full depth.

The Full method creates trees that all equal the     InitializationDepth (think full, bushy trees). There are not necessarily all the same size (number of nodes) as they depends on the arity of the instructions, but the same initial depth. The Full method creates trees by selecting only functions with arity greater than 0 until the initialization depth is reached; after which only terminals are selected.
 

protected method

DoInitializeGrow(TNode,Integer,Integer)

Initializes a genetic program tree by growing to the depth indicated.

The Grow method creates trees of a wider variety of shapes and sizes than the full method. In the Grow method, nodes for the trees are selected from the full set of primitives (functions, constants, and variables) until the initialization depth is reached. Since an early node could select a terminal (constant, variable, or function of arity = 0), that node's subtree stops growing before the initialization depth.
 

protected method

DoInvert(TRSIndividual)

Performs the actual inversion of the individual. The decision to invert the individual has already been made before calling this method. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoInvert(TRSIndividual).)

protected method

DoMutate(TRSIndividual)

Performs the actual mutation of the individual. The decision to mutat the individual has already been made before calling this method. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoMutate(TRSIndividual).)

protected method

DoPointMutation(TIndividual)

Overloaded. Performs point mutation. A random node is selected and the primitive
stored there is replaced with a different random primitive of the same arity taken from the primitive set
 

protected method

DoPointMutation(TIndividual,TNode)

Overloaded.  Performs point mutation on the tree. A random node is selected and the primitive stored there is replaced with a different random primitive of the same arity taken from the primitive set

Returns true if a point mutation occurred. Point mutation can occur more than once based on     PointMutationMethod.
 

protected method

DoReplacementMutation(TIndividual)

Performs a replacement mutation (replace a subtree of the individual with another subtree that starts with the same arity)

protected method

DoReproduce(TRSIndividual,TRSIndividual,TRSIndividual)

Performs the actual reproduction operation by combining the two parents to make the new Child. The Child must already exist but may be uninitialized. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoReproduce(TRSIndividual,TRSIndividual,TRSIndividual).)

protected method

DoReproduce(TRSIndividual,TRSIndividual,TRSIndividual,TRSIndividual)

Performs the actual reproduction operation by combining the two parents to make two new children. The children must already exist but may be uninitialized. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoReproduce(TRSIndividual,TRSIndividual,TRSIndividual,TRSIndividual).)

protected method

DoShrinkMutation(TIndividual)

Performs a shrink mutation. Shrink mutation replaces a subtree of the child with a terminal. This has the effect of reducing the complexity of the child.

protected method

DoStartEvolve

Performs initial steps for one evolution phase. Called by DoEvolve. (Overrides RSGeneticBase.TRSCustomGeneticComponent.DoStartEvolve.)

protected method

DoSubtreeMutation(TIndividual)

Performs a subtree mutation (replace a subtree of the individual with another subtree)

public method

EvaluateFitness(TRSIndividual,Boolean)

Returns a fitness estimation of the passed in RSGeneticBase.TRSIndividual . It uses your     OnEvaluateFitness event handler to return the value.

Defining your fitness function is a highly important part of defining a genetic algorithm or genetic program. The fitness function returns a floating point value that specifies the correctness of the individual solution. The fitness function needs to be able to allow the genetic component to decide which solution is better than another. The genetic component will seek to either maximize the solution (e.g., keep evolving for individuals whose fitness are greater than other individuals in the population) or to minimize the solution (e.g., find the individuals whose fitness are less than other individuals). Note you can specify which direction to evolve towards with the     FitnessMethod property.

The overloaded     EvaluateFitness method evaluates the fitness for every individual of the Population (and calculates the     MaxFitness,     MinFitness, and     AvgFitness).
 

protected method

GetNode(TNode,Integer)

Overloaded. Creates and returns a node for the specified parent node. The node may be a function, constant, or variable node

protected method

GetNode(TNode,TNode,Integer)

Overloaded. Creates and returns a node for the specified parent node. The node is similar (of the same type and arity of the Similar node parameter)

protected method

GetOperationNode(TNode,Integer)

Creates and returns a function node for the specified parent node from the list of   Operations

protected method

GetSimilarInstruction(TInstruction)

Returns an instruction that is similar (of same type and arity)

protected method

GetTerminalNode(TNode,Integer)

Creates and returns a terminal (constants, variables, and functions of arity=0) node for the specified parent node from the list of   Terminals

protected method

InstructionNotify(TInstruction,Classes)

Called when an instruction is added or removed from the   Instructions

protected method

InstructionOperationUpdate(TInstruction)

Called when an instruction's Operation is changed (i.e., it changes from a function to a constant or a variable to a function, etc)

protected method

InstructionUpdate(TInstruction)

Called when an instruction is changed

public method

LoadFromFile(string)

Loads the entire genetic component from the XML file specified by the Filename parameter, including the Genes (genetic algorithms) or Instructions (genetic programming) and the Population. Use the LoadFromFile and SaveToFile methods to stream in and out the genetic component in XML format. The format of the XML is defined in the GeneticAlgorithm.xsd and GeneticProgramming.xsd schema files. (Overrides RSGeneticBase.TRSCustomGeneticComponent.LoadFromFile(string).)

public method

LoadFromStream(TStream)

Loads the entire genetic component from the XML stream specified by the stream parameter, including the Genes (genetic algorithms) or Instructions (genetic programming) and the Population. Use the LoadFromStream and SaveToStream methods to stream in and out the genetic component in XML format. The format of the XML is defined in the GeneticAlgorithm.xsd and GeneticProgramming.xsd schema files. (Overrides RSGeneticBase.TRSCustomGeneticComponent.LoadFromStream(TStream).)

public method

LoadFromXML(IXMLGeneticProgram)

Overloaded. Load the entire genetic programming scenario from the XML

alert_cautionWarning

The component reads and writes the metadata about instructions (i.e., name, arity, comment) but does not actually read or write the OnExecute code. After reading a genetic programming scenario, you need to add OnExecute event handlers to instructions.

alert_cautionImportant Note

When reading a genetic programming scenario, the component will attempt to match currently existing instructions to instruction names in the scenario. IF an instruction is found, the instruction will be preserved (including its OnExecute event).

After reading the scenario, any previous instructions not found in the scenario will be deleted.

public method

LoadFromXML(IXMLGPDomainType)

Overloaded. Load the genetic programming domain ( instructions, fittest individual, population) from the XML

alert_cautionWarning

The component reads and writes the metadata about instructions (i.e., name, arity, comment) but does not actually read or write the OnExecute code. After reading a genetic programming scenario, you need to add OnExecute event handlers to instructions.

alert_cautionImportant Note

When reading a genetic programming scenario, the component will attempt to match currently existing instructions to instruction names in the scenario. IF an instruction is found, the instruction will be preserved (including its OnExecute event).

After reading the scenario, any previous instructions not found in the scenario will be deleted.

public method

LoadFromXML(IXMLGPInstructions)

Overloaded. Load the genetic programming instructions from the XML

alert_cautionWarning

The component reads and writes the metadata about instructions (i.e., name, arity, comment) but does not actually read or write the OnExecute code. After reading a genetic programming scenario, you need to add OnExecute event handlers to instructions.

alert_cautionImportant Note

When reading a genetic programming scenario, the component will attempt to match currently existing instructions to instruction names in the scenario. IF an instruction is found, the instruction will be preserved (including its OnExecute event).

After reading the scenario, any previous instructions not found in the scenario will be deleted.

public method

MaxNodeArity

Returns the maximum number of children and node ( RSGenerics.GeneticProgramEngine.TRSGPNode<T> ) in the component can accept

public method

Mutate(TIndividual,TGPMutationMethod)

Overloaded.  Mutates the DNA of the individual using the Mutation method. The mutation method controls how the genetic program tree is modified.

This method is called by the overloaded Mutate method when mutation is found to have occurred by its probability.
 

public method

SaveToStream(TStream)

Saves the entire genetic component to the XML stream specified by the stream parameter, including the Genes (genetic algorithms) or Instructions (genetic programming) and the Population. Use the LoadFromFile and SaveToFile methods to stream in and out the genetic component in XML format. The format of the XML is defined in the GeneticAlgorithm.xsd and GeneticProgramming.xsd schema files. (Overrides RSGeneticBase.TRSCustomGeneticComponent.SaveToStream(TStream).)

public method

SaveToXML(IXMLGeneticProgram)

Overloaded. Saves the genetic programming scenario to XML

alert_cautionWarning

The component writes the metadata about instructions (i.e., name, arity, comment) but does not actually write the OnExecute code.

public method

SaveToXML(IXMLGPDomainType)

Overloaded. Saves the genetic programming domain ( instructions, fittest individual, population) to XML

alert_cautionWarning

The component writes the metadata about instructions (i.e., name, arity, comment) but does not actually write the OnExecute code.

public method

SaveToXML(IXMLGPInstructions)

Overloaded. Saves the genetic programming instructions to XML

alert_cautionWarning

The component writes the metadata about instructions (i.e., name, arity, comment) but does not actually write the OnExecute code.

public method

SearchSpaceSize(Cardinal)

Returns the size of size of the total set of trees from one level of nodes up to a maximum size identified by the variable level. This space contains every combination of the functions and terminals, and the arity of each function arity for every tree of depth 1 up to the stated maximum depth. This number is useful for getting an idea of the size of the search space and may encourage you to reduce the number of functions, terminals, or arity of functions.

protected method

SelectTournament(TObject,TRSPopulation,TRSIndividual)

Selected a Parent individual from the Population using the Tournament method.

Select "best" parents from a tournament field (size of tournament field is determined by the     TournamentField property), e.g., select the best parent from randomly selecting individuals TournamentField times and then choosing the "winner" of the tournament. Note: for speed purposes, this selection method does not ensure that the same individual cannot be picked twice
 

protected method

SumOfWeights(TGPMutationMethodWeights)

Calculates the sum of all the   MutationWeights

Top

Comments (0)