Class TMotorBehavior

DescriptionHierarchyFieldsMethodsProperties

Unit

Behaviors

Declaration

type TMotorBehavior = class(TBehavior)

Description

Class extending TBehavior to include motor output. Motor output (zero by default) can be changed by accessing the property OutputVariables.

Hierarchy

TMotorBehavior > TBehavior > TTenaciousObject > TPersistent

Fields

 NameDescription
Protected fOutputVariables

Vector containing the motor output values. The size of this vector should match the number of motors present in TBody (see TBody.Motors.NumberOfMotors). See also TransferMotorSignals for transferring the motor output value(s) to the actual motor(s).

Methods

Overview

Public constructor Create; override;
Public constructor CreateAndSet(B: TBehavior); override;
Public destructor Destroy; override;
Public function Copy: TBehavior; override;
Public procedure LoadFromDefinition(ObjDef: TObjectDefinition); override;
Public procedure TransferMotorSignals(Motors: TMotors); virtual;

Description

Public constructor Create; override;

Default constructor.

Public constructor CreateAndSet(B: TBehavior); override;

Copy constructor. Note that this constructor sets the length of the fOutputVariables vector but does not copy the values in that vector.

parameters
B
is the motor behavior to be copied.
Public destructor Destroy; override;

Destructor

Public function Copy: TBehavior; override;

Creates a copy of the motor behavior by calling the copy constructor CreateAndSet.

returns

A copy of the motor behavior.

Public procedure LoadFromDefinition(ObjDef: TObjectDefinition); override;

Procedure for processing the definition of a motor behavior (as parsed from the definition text file). This procedure only calls the inherited procedure LoadFromDefinition (as required by all descendants).

Public procedure TransferMotorSignals(Motors: TMotors); virtual;

Transfers the values in OutputVariables to the actual motors. To transfer the motor output values, the procedure TMotor.SetSignal is called for each motor. It is assumed that the number of motors and the size of the vector OutputVariables are equal. This procedure is called in the procedure TBrain.Step and does not need to be called explicitly.

Properties

Overview

Public property OutputVariables: TVector;

Description

Public property OutputVariables: TVector;

Provides read access to the variable fOutputVariables.


Generated by PasDoc 0.8.8.3 on 2005-05-28 08:13:49