Hide Comments
Hide Comments

Comments (0)

Defines the base class for a component that can read and execute a genetic program. Use this class when you have already evolved a solution to your problem and need to execute the genetic program.

noteNote

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

Namespace: RSGenerics.GeneticProgramming

expandingInheritance Hierarchy

TComponent
  RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>
    RSGeneticProgramming.TRSCustomGeneticProgrammingExecutor
    RSGeneticProgramming.TRSCustomGeneticProgrammingVariantExecutor
 

expandingSyntax

Delphi

type
  TRSCustomGeneticProgrammingExecutor<T> = class(TComponent, IRSGeneticProgramEngine<T>, IRSGeneticProgramReaderWriter)
  end;
 

Type Parameters

T

expandingConstructors

 

Name

Description

public constructor

Create(TComponent)

Initializes a new instance of the TRSCustomGeneticProgrammingExecutor<T> class.

public destructor

Destroy

Represents the destructor of the TRSCustomGeneticProgrammingExecutor<T> class.

Top

expandingProperties

 

Name

Description

public property

GPProgram

Represents the genetic program tree to execute

public property

GPProgramLines

Provides an XML string representation of the genetic program

public property

Instructions

Specifies the set of instructions allowed in the genetic program, including all functions, variables and constants.

Top

expandingMethods

 

Name

Description

public method

Assign(TPersistent)

Copies properties from the Source object to the current object

noteNote

When copying a source TRSCustomGeneticProgramming<T> component or TRSCustomGeneticProgrammingExecutor<T> component, the method copies the Instructions including the event handlers. If the Source is a TRSCustomGeneticProgramming<T> component, the FittestIndividual's DNA is copied to     GPProgram.

protected method

CreateInstructions(TCollectionItemClass)

Creates the   Instructions collection of the correct class type.

protected method

CreateNode(TInstruction,TNode)

Represents method CreateNode(TInstruction,TNode).

public method

Execute(TContext)

Executes the genetic program (     GPProgram) using the specified context. The Context provides program state information (including variable values).

The function returns a value of type T

protected method

GenerateXML

Represents method GenerateXML.

protected method

InstructionNotify(TInstruction,Classes)

Represents method InstructionNotify(TInstruction,Classes).

protected method

InstructionOperationUpdate(TInstruction)

Represents method InstructionOperationUpdate(TInstruction).

protected method

InstructionUpdate(TInstruction)

Represents method InstructionUpdate(TInstruction).

public method

LoadFromFile(string)

Load the genetic programming scenario from a file specified by the filename. The   Instructions property will contain the read instructions, and the   GPProgram property will contain the genetic program of the fittest individual.

alert_cautionWarning

A genetic programming reader/writer reads and writes the metadata about instructions (i.e., name, arity, comment) but does not actually read or write the OnExecute code themselves. 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 reader 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

LoadFromStream(TStream)

Load the genetic programming scenario from a stream. The   Instructions property will contain the read instructions, and the   GPProgram property will contain the genetic program of the fittest individual.

alert_cautionWarning

A genetic programming reader/writer reads and writes the metadata about instructions (i.e., name, arity, comment) but does not actually read or write the OnExecute code themselves. 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 reader 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(IXMLGeneticProgram)

Overloaded. Load the entire genetic programming scenario from the XML. The   Instructions property will contain the read instructions, and the   GPProgram property will contain the genetic program of the fittest individual.

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. The   Instructions property will contain the read instructions, and the   GPProgram property will contain the genetic program of the fittest individual.

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.

protected method

MaxNodeArity

Returns the maximum node arity (number of children) allowed in the engine

public method

Parse

Parses the GPProgramLines property and generates the genetic program (   GPProgram) tree based on its XML

public method

SaveToFile(String)

Saves the genetic programming scenario to the file specified by the filename.

alert_cautionWarning

This component does not write the entire population of a genetic programming scenario. It only writes the fittest individual using the     GPProgram property.

public method

SaveToStream(TStream)

Saves the genetic programming scenario to the stream

alert_cautionWarning

This component does not write the entire population of a genetic programming scenario. It only writes the fittest individual using the     GPProgram property.

public method

SaveToXML(IXMLGeneticProgram)

Overloaded. Saves the genetic programming scenario to the XML

alert_cautionWarning

This component does not write the entire population of a genetic programming scenario. It only writes the fittest individual using the     GPProgram property.

public method

SaveToXML(IXMLGPDomainType)

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

alert_cautionWarning

This component does not write the entire population of a genetic programming scenario. It only writes the fittest individual using the     GPProgram property.

public method

SaveToXML(IXMLGPInstructions)

Overloaded. Saves the   Instructions to the XML

alert_cautionWarning

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

Top

expandingSee Also

Comments (0)