Hide Comments
Hide Comments

Comments (0)

Defines the set of instructions allowed in a genetic program, including all functions, variables and constants. When the genetic programming component is evolving the population of genetic programs, it uses this collection to select a function, variable or constant.

Namespace: RSGenerics.GeneticProgramEngine

expandingInheritance Hierarchy

TOwnedCollection
  RSGenerics.GeneticProgramEngine.TRSGPInstructions<T>
    RSGeneticProgramming.TRSGPFloatInstructions
    RSGeneticProgramming.TRSGPVariantInstructions
 

expandingSyntax

Delphi

type 
  TRSGPInstructions<T> = class(TOwnedCollection) 
  end;  
 

Type Parameters

T

expandingConstructors

 

Name

Description

public constructor

Create(TPersistent,TCollectionItemClass)

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

Top

expandingProperties

 

Name

Description

public property

ItemByName[String]

Returns the instruction with the specified name. If no instruction exists with that name, an exception is raised.

public property

Items[Integer]

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

Top

expandingMethods

 

Name

Description

public method

Add

Creates a new instruction instance and adds it to the Items array. Call Add to create a new instruction in the collection. The new value is placed at the end of the Items array.
 
Add returns the new instruction
 

public method

AssignAll(TPersistent)

Copies all the instructions and their events from the Source object to this collection. Any instructions currently in the collection before the assign are destroyed.

protected method

AssignTo(TPersistent)

Represents method AssignTo(TPersistent).

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

FindItemName(String)

Finds an instruction with the specified name and returns that instruction. If no instruction exists with that name, the function returns nil.

public method

IndexOf(String)

Returns the index of the instruction with the specified Name. If no instruction exists with that name, the function returns -1.

public method

Insert(Integer)

Creates a new instruction and adds it to the Items array. Call Insert to add a new instruction 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 instruction.
 

protected method

InstructionOperationUpdate(TRSGPInstruction<T>)

Represents method InstructionOperationUpdate(TRSGPInstruction<T>).

public method

LoadFromXML(IXMLGPInstructions)

Loads the instructions from the XML

alert_cautionImportant Note

When reading the XML, the method will attempt to match currently existing instructions to instruction names in the XML. IF an instruction is found, the instruction will be preserved (including its OnExecute event).

After reading the XML, any instructions previously in the collection but not found in the XML will be deleted.

protected method

Notify(TCollectionItem,Classes)

Represents method Notify(TCollectionItem,Classes).

public method

SaveToXML(IXMLGPInstructions)

Saves the instructions to the XML

alert_cautionWarning

If the instruction is a function, the OnExecute event is not saved

protected method

Update(TCollectionItem)

Represents method Update(TCollectionItem).

Top

expandingSee Also

Comments (0)