| Description | Hierarchy | Fields | Methods | Properties |
type TAgent = class(TTenaciousObject)
Abstract base class whose main purpose is to provide the basic interface to the evolutionary algorithm (see TEA and TPopulation). Currently there is only one concrete class implementing the interface of TAgent, namely TRobot.
When implementing a specific class by deriving from TAgent, be sure to implement all methods in TAgent.
| Name | Description | |
|---|---|---|
![]() |
fGenome |
A member variable containing the agent's genome. This is the hart of the agent. |
![]() |
fTime |
Variable holding the actual simulation time of an agent. |
![]() |
constructor Create; virtual; |
![]() |
constructor CreateAndSet(Agent: TAgent); virtual; |
![]() |
destructor Destroy; override; |
![]() |
function Copy: TAgent; virtual; |
![]() |
procedure DecodeGenome; virtual; abstract; |
![]() |
procedure Initialize; virtual; abstract; |
![]() |
procedure Move(TimeStep: real; const Arena: TArena); virtual; abstract; |
![]() |
procedure Mutate(MutationParameters: TMutationParameters); virtual; abstract; |
![]() |
constructor Create; virtual; |
Default constructor. By default, this constructor creates the member variable fGenome (also, see the Genome property).
![]() |
constructor CreateAndSet(Agent: TAgent); virtual; |
Copy constructor. The copy constructor copies everything except the protected variable fTime which is always initialized to zero when creating a new object.
![]() |
destructor Destroy; override; |
Default destructor. Be sure to call the inherited destructor in any dervied classes in order to avoid memory leaks. The main purpose of this destructor is to free the member fGenome by calling its destructor TGenome.Destroy.
![]() |
function Copy: TAgent; virtual; |
Creates a copy by calling the copy constructor CreateAndSet.
![]() |
procedure DecodeGenome; virtual; abstract; |
Procedure responsible for decoding the member variable Genome. This procedure must be defined by the user in order to decode the Genome into something useful (such as e.g. an artificial neural network or a behavioral organizer).
![]() |
procedure Initialize; virtual; abstract; |
Abstract procedure that can be used for initialization of variables prior to evaluation.
![]() |
procedure Move(TimeStep: real; const Arena: TArena); virtual; abstract; |
Procedure called every time step and closely connected to the dynamics of an agent. This procedure can be used for calculating properties that needs updating every time step. Such calculations could be the integration of the equations of motion, updating sensors, or checking for collisions (see TDifferentiallySteeredBody.Move for a concrete example).
![]() |
procedure Mutate(MutationParameters: TMutationParameters); virtual; abstract; |
Abstract procedure for performing a mutation of the agent's genome (fGenome). This procedure must be implemented in descendant classes.
![]() |
property CrossoverDefined: Boolean; |
![]() |
property Fitness: real; |
![]() |
property Genome: TGenome; |
![]() |
property RankedFitness: real; |
![]() |
property SubPopulationIndex: integer; |
![]() |
property Time: real; |
![]() |
property CrossoverDefined: Boolean; |
Boolean property that indicates wether a crossover operator is defined for this object or not. Returns True if the crossover operator exists and False otherwise (default state is False).
![]() |
property Fitness: real; |
Property containing the fitness of an agent (as assigned during evaluation).
![]() |
property Genome: TGenome; |
See the variable fGenome.
![]() |
property RankedFitness: real; |
Currently not used.
![]() |
property SubPopulationIndex: integer; |
Currently not used.
![]() |
property Time: real; |
See variable fTime.