Specifies the variables of type T in the context. For every variable in your genetic programming problem, define a variable in this list.
Namespace: RSGenerics.GeneticProgramEngine
Delphi
|
public
property Values: TRSGPValues<T> read FValues write SetValues;
|
Property Value
Type: TRSGPValues<T>
The following example sets up the world state for the cart centering problem and then executes the genetic program that has been evolved for it:
Delphi
|
var
Context: TRSGeneticProgramming.TContext;
Velocity, Position: TGAFloat;
Direction: TGAFloat;
begin
Context := TRSGeneticProgramming.TContext.Create;
try
// velocity -0.75 m/s and 0.75 m/s
Velocity := 1.5 * Random - 0.75;
// position -0.75 m through 0.75 m
Position := 1.5 * Random - 0.75;
Context.Values.AddOrSetValue('Position', Position);
Context.Values.AddOrSetValue('Velocity', Velocity);
Direction := Item.Execute(Context);
finally
Context.Free;
end;
end;
|
|