Hide Comments
Hide Comments

Comments (0)

The TRSGeneticProgrammingExecutor component is the descendant class of the RSGeneticProgramming.TRSCustomGeneticProgrammingExecutor component which publishes all the properties needed for reading and executing a genetic program. Use this class when you have already evolved a solution to your problem and need to execute the genetic program. It instantiates the RSGenerics.GeneticProgramming|TRSCustomGeneticProgrammingExector<T> generics class using TGAFloat and ensures the correct TRSGPInstruction<T> are created for it.

alert_noteNotes to Implementers

The TRSGeneticProgrammingExecutor class redeclares the Instructions property 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<TGAFloat>), Delphi will not publish the property and make it available at design-time.

Namespace: RSGeneticProgramming

expandingInheritance Hierarchy

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

expandingSyntax

Delphi

type
  TRSGeneticProgrammingExecutor = class(TRSCustomGeneticProgrammingExecutor)
  end; 
 

expandingConstructors

 

Name

Description

public constructor

Create(TComponent)

Initializes a new instance of the TRSCustomGeneticProgrammingExecutor<T> class. (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

Top

expandingProperties

 

Name

Description

public property

GPProgram

Represents the genetic program tree to execute (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

published property

GPProgramLines

Represents property GPProgramLines.

published property

Instructions

Represents property Instructions.

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. (Overrides RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.CreateInstructions(TCollectionItemClass).)

protected method

CreateNode(TRSGPInstruction<TGAFloat>,TRSGPNode<TGAFloat>)

Represents method CreateNode(TRSGPInstruction<TGAFloat>,TRSGPNode<TGAFloat>). (Inherited from RSGeneticProgramming.TRSCustomGeneticProgrammingExecutor.)

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. (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

protected method

InstructionNotify(TInstruction,Classes)

Represents method InstructionNotify(TInstruction,Classes). (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

protected method

InstructionOperationUpdate(TInstruction)

Represents method InstructionOperationUpdate(TInstruction). (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

protected method

InstructionUpdate(TInstruction)

Represents method InstructionUpdate(TInstruction). (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

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 (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

public method

Parse

Parses the GPProgramLines property and generates the genetic program (   GPProgram) tree based on its XML (Inherited from RSGenerics.GeneticProgramming.TRSCustomGeneticProgrammingExecutor<T>.)

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)