Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

AgentObject Class Reference

#include <Objects.h>

Inheritance diagram for AgentObject:

Inheritance graph
[legend]
Collaboration diagram for AgentObject:

Collaboration graph
[legend]
List of all members.

Public Methods

 AgentObject (double dStaminaMax=4000)
void show (ostream &os=cout)
void show (const char *strTeamName, ostream &os=cout)
VecPosition getPositionDifference () const
bool setPositionDifference (VecPosition v)
ViewAngleT getViewAngle () const
bool setViewAngle (ViewAngleT v)
ViewQualityT getViewQuality () const
bool setViewQuality (ViewQualityT v)
Stamina getStamina () const
bool setStamina (Stamina sta)
VecPosition getSpeedRelToNeck () const
bool setSpeedRelToNeck (VecPosition v)
bool setGlobalNeckAngle (AngDeg ang)
AngDeg getBodyAngleRelToNeck () const
bool setBodyAngleRelToNeck (AngDeg ang)
bool getArmMovable () const
bool setArmMovable (bool b)
int getArmExpires () const
bool setArmExpires (int i)
VecPosition getGlobalArmPosition () const
bool setGlobalArmPosition (VecPosition v)
int getTackleExpires () const
bool setTackleExpires (int i)

Private Attributes

ViewAngleT viewAngle
ViewQualityT viewQuality
Stamina stamina
VecPosition velSpeedRelToNeck
AngDeg angBodyAngleRelToNeck
VecPosition posPositionDifference
bool m_bArmMovable
int m_iArmExpires
VecPosition m_posGlobalArm
int m_iTackleExpires

Detailed Description

Class AgentObject contains RoboCup information that is available for the agent. New variables are declared that extend a normal PlayerObject.

Definition at line 319 of file Objects.h.


Constructor & Destructor Documentation

AgentObject::AgentObject double    dStaminaMax = 4000
 

This is the constructor for the class AgentObject and initializes the variables with the AgentObject. This the class that contains information about the agent itself.

Parameters:
dStaminaMax  maximum stamina for this agent (default 4000.0)

Definition at line 843 of file Objects.cpp.

References angBodyAngleRelToNeck, PlayerObject::angGlobalNeckAngle, Stamina::setEffort(), Stamina::setRecovery(), Stamina::setStamina(), VecPosition::setVecPosition(), stamina, UnknownAngleValue, VA_NORMAL, velSpeedRelToNeck, viewAngle, viewQuality, and VQ_HIGH.


Member Function Documentation

int AgentObject::getArmExpires   const
 

This method returns the numer of cycles it will take the arm to expire. In case of zero, the arm doesn't point anymore and the other players won't see the arm pointing anymore.

Definition at line 1019 of file Objects.cpp.

References m_iArmExpires.

Referenced by WorldModel::getAgentArmExpires().

bool AgentObject::getArmMovable   const
 

This method sets whether it is allowed to move the arm of the agent.

Definition at line 1004 of file Objects.cpp.

References m_bArmMovable.

Referenced by WorldModel::getAgentArmMovable().

AngDeg AgentObject::getBodyAngleRelToNeck   const
 

This method returns the relative angle of the body to the neck of this AgentObject. Example: global angle neck is 90 degrees and global body angle is 0, means that relative angle of body to neck is -90 degrees.

Returns:
relative body angle to the neck

Definition at line 988 of file Objects.cpp.

References angBodyAngleRelToNeck, and AngDeg.

Referenced by WorldModel::getAgentBodyAngleRelToNeck(), and setGlobalNeckAngle().

VecPosition AgentObject::getGlobalArmPosition   const
 

This method returns the global position to which the arm points. If 'getArmExpires' returns zero, it means that the arm doesn't point anymore and this value is invalid.

Definition at line 1036 of file Objects.cpp.

References m_posGlobalArm.

Referenced by WorldModel::getAgentArmPosition().

VecPosition AgentObject::getPositionDifference   const
 

This method returns the difference between the predicted global position of the agent and the actual derived global position. This difference can be used in determining the actual movement of other objects since the noise caused by the difference in the global position of the agent is then filtered out.

Definition at line 896 of file Objects.cpp.

References posPositionDifference.

Referenced by WorldModel::calculateStateBall().

VecPosition AgentObject::getSpeedRelToNeck   const
 

This method returns the velocity (speed and direction) of this AgentObject. This information is directly availablefrom the sense message, in which the speed factor and the angle of this speed (relative to the neck) are given.

Returns:
velocity agent relative to the neck.

Definition at line 958 of file Objects.cpp.

References velSpeedRelToNeck.

Referenced by WorldModel::calculateStateAgent(), WorldModel::calculateStateAgent2(), WorldModel::calculateStateAgent3(), and WorldModel::updateAgentAndBallAfterSense().

Stamina AgentObject::getStamina   const
 

This method returns the Stamina of the AgentObject.

Returns:
stamina from the agent.

Definition at line 940 of file Objects.cpp.

References stamina.

Referenced by WorldModel::getAgentEffort(), WorldModel::getAgentStamina(), and WorldModel::processNewAgentInfo().

int AgentObject::getTackleExpires   const
 

This method returns the number of cycles it will take the tackle to expire. In case of 0 a tackle command can be issued.

Definition at line 1050 of file Objects.cpp.

References m_iTackleExpires.

Referenced by WorldModel::getTackleExpires().

ViewAngleT AgentObject::getViewAngle   const
 

This method returns the view angle of this PlayerObject. The view angle equals VA_NARROW, VA_NORMAL, VA_WIDE or VA_ILLEGAL.

Returns:
view angle of this PlayerObject

Definition at line 886 of file Objects.cpp.

References viewAngle, and ViewAngleT.

Referenced by WorldModel::getAgentViewAngle(), and WorldModel::removeGhosts().

ViewQualityT AgentObject::getViewQuality   const
 

This method returns the view quality of this AgentObject. The view angle equals VQ_LOW, VQ_HIGH, or VQ_ILLEGAL.

Returns:
view quality of this AgentObject

Definition at line 924 of file Objects.cpp.

References viewQuality, and ViewQualityT.

Referenced by WorldModel::getAgentViewQuality().

bool AgentObject::setArmExpires int    i
 

This method sets the numer of cycles it will take the arm to expire. In case of zero, the arm doesn't point anymore and the other players won't see the arm pointing anymore.

Definition at line 1027 of file Objects.cpp.

References m_iArmExpires.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setArmMovable bool    b
 

This method returns whether it is allowed to move the arm of the agent.

Definition at line 1010 of file Objects.cpp.

References m_bArmMovable.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setBodyAngleRelToNeck AngDeg    ang
 

This method sets the relative body angle to the neck for this AgentObject.

Parameters:
ang  relative body angle to the neck
Returns:
bool indicating whether value was set

Definition at line 996 of file Objects.cpp.

References angBodyAngleRelToNeck, and AngDeg.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setGlobalArmPosition VecPosition    v
 

This method sets the global position to which the arm points.

Definition at line 1042 of file Objects.cpp.

References m_posGlobalArm.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setGlobalNeckAngle AngDeg    ang
 

This method sets the global neck angle for this AgentObject.

Parameters:
ang  value for the global neck angle.
Returns:
bool indicating whether value was set

Definition at line 976 of file Objects.cpp.

References AngDeg, PlayerObject::angGlobalBodyAngle, PlayerObject::angGlobalNeckAngle, getBodyAngleRelToNeck(), and VecPosition::normalizeAngle().

Referenced by WorldModel::updateAgentAndBallAfterSense(), and WorldModel::updateAgentObjectAfterSee().

bool AgentObject::setPositionDifference VecPosition    p
 

This method sets the position difference between the derived global position from the previous cycle information and the global position from the latest see message.

Parameters:
p  new position difference
Returns:
bool indicating whether the update was succesfull.

Definition at line 906 of file Objects.cpp.

References posPositionDifference.

Referenced by WorldModel::updateAgentObjectAfterSee().

bool AgentObject::setSpeedRelToNeck VecPosition    v
 

This method sets the velocity (speed and direction) of this AgentObject. This information comes directly from the sense message.

Parameters:
v  new velocity for this agentobject
Returns:
bool indicating whether value was set

Definition at line 967 of file Objects.cpp.

References velSpeedRelToNeck.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setStamina Stamina    sta
 

This method sets the stamina of this AgentObject.

Parameters:
sta  new stamina for this AgentObject
Returns:
bool indicating whether value was set

Definition at line 948 of file Objects.cpp.

References stamina.

Referenced by WorldModel::processNewAgentInfo(), and WorldModel::WorldModel().

bool AgentObject::setTackleExpires int    i
 

This method sets the number of cycles it will take the tackle to expire. In case of 0 a tackle command can be issued.

Definition at line 1057 of file Objects.cpp.

References m_iTackleExpires.

Referenced by WorldModel::processNewAgentInfo().

bool AgentObject::setViewAngle ViewAngleT    v
 

This method sets the view angle of this AgentObject.

Parameters:
v  new view angle (VA_NARROW, VA_NORMAL, VA_WIDE or VA_ILLEGAL)
Returns:
bool indicating whether value was set

Definition at line 915 of file Objects.cpp.

References viewAngle, and ViewAngleT.

Referenced by WorldModel::processNewAgentInfo(), and WorldModel::setAgentViewAngle().

bool AgentObject::setViewQuality ViewQualityT    v
 

Set the view quality of this AgentObject.

Parameters:
v  new view quality (VQ_LOW, VQ_HIGH, VQ_ILLEGAL)
Returns:
bool indicating whether value was set

Definition at line 932 of file Objects.cpp.

References viewQuality, and ViewQualityT.

Referenced by WorldModel::processNewAgentInfo(), and WorldModel::setAgentViewQuality().

void AgentObject::show const char *    strTeamName,
ostream &    os = cout
 

This methods prints the information about this AgentObject to the specified output stream. The specified team name is used as the name

Parameters:
strTeamName  team name for this agent.
os  output stream to which information is written.

Reimplemented from PlayerObject.

Definition at line 869 of file Objects.cpp.

References angBodyAngleRelToNeck, PlayerObject::angGlobalNeckAngle, SoccerTypes::getObjectStr(), MAX_TEAM_NAME_LENGTH, Object::objectType, Object::posGlobal, Stamina::show(), stamina, Object::timeGlobalPosition, DynamicObject::timeGlobalVelocity, and DynamicObject::vecGlobalVelocity.

void AgentObject::show ostream &    os = cout [virtual]
 

This methods prints the information about this AgentObject to the specified output stream. The default team name is used as the name.

Parameters:
os  output stream to which information is written.

Reimplemented from PlayerObject.

Definition at line 860 of file Objects.cpp.

References DEFAULT_TEAM_NAME.

Referenced by WorldModel::show().


Member Data Documentation

AngDeg AgentObject::angBodyAngleRelToNeck [private]
 

Relative angle of body with neck

Definition at line 326 of file Objects.h.

Referenced by AgentObject(), getBodyAngleRelToNeck(), setBodyAngleRelToNeck(), and show().

bool AgentObject::m_bArmMovable [private]
 

Indicates whether can move arm.

Definition at line 330 of file Objects.h.

Referenced by getArmMovable(), and setArmMovable().

int AgentObject::m_iArmExpires [private]
 

Nr. of cycles till arm expires

Definition at line 331 of file Objects.h.

Referenced by getArmExpires(), and setArmExpires().

int AgentObject::m_iTackleExpires [private]
 

Nr. of cycles till tackle expires

Definition at line 333 of file Objects.h.

Referenced by getTackleExpires(), and setTackleExpires().

VecPosition AgentObject::m_posGlobalArm [private]
 

Definition at line 332 of file Objects.h.

Referenced by getGlobalArmPosition(), and setGlobalArmPosition().

VecPosition AgentObject::posPositionDifference [private]
 

Global pos difference with lastsee

Definition at line 328 of file Objects.h.

Referenced by getPositionDifference(), and setPositionDifference().

Stamina AgentObject::stamina [private]
 

Stamina (stamina, effort, recovery

Definition at line 324 of file Objects.h.

Referenced by AgentObject(), getStamina(), setStamina(), and show().

VecPosition AgentObject::velSpeedRelToNeck [private]
 

Velocity vector relative to neck

Definition at line 325 of file Objects.h.

Referenced by AgentObject(), getSpeedRelToNeck(), and setSpeedRelToNeck().

ViewAngleT AgentObject::viewAngle [private]
 

View angle of this agent

Definition at line 321 of file Objects.h.

Referenced by AgentObject(), getViewAngle(), and setViewAngle().

ViewQualityT AgentObject::viewQuality [private]
 

View quality of this agent

Definition at line 322 of file Objects.h.

Referenced by AgentObject(), getViewQuality(), and setViewQuality().


The documentation for this class was generated from the following files:
Generated on Fri Nov 7 11:45:58 2003 for UvA Trilearn 2003 Base Code by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001