Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

AgentState Class Reference

#include <agentstate.h>

Inheritance diagram for AgentState:

Inheritance graph
[legend]
Collaboration diagram for AgentState:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AgentState ()
virtual ~AgentState ()
void SetTeamIndex (TTeamIndex idx)
 set the team index
TTeamIndex GetTeamIndex () const
 returns the team index
void SetUniformNumber (int number)
 Set the uniform number.
int GetUniformNumber () const
 returns the uniform number as integer
virtual void SetID (const std::string &id, TPerceptType pt=PT_Default)
 Set the object id for perceptors.
float GetBattery () const
 Get the battery state.
void SetBattery (float battery)
 Set the battery state.
float GetTemperature () const
 Get the motor temperature.
void SetTemperature (float temperature)
 Set the temperature.
bool ReduceBattery (double consumption)
 reduce battery by the given amout.
void AddMessage (const std::string &msg, float direction, bool teamMate)
 Add a new message to the list.
void AddSelfMessage (const std::string &msg)
bool GetMessage (std::string &msg, float &direction, bool teamMate)
 Get the first message from the list.
bool GetSelfMessage (std::string &msg)

Protected Attributes

TTeamIndex mTeamIndex
 team index
int mUniformNumber
 uniform number
float mTemperature
 motor temperature
double mBattery
 battery state
std::string mSelfMsg
 self message
std::string mMateMsg
 team-mate's message
float mMateMsgDir
std::string mOppMsg
 opponent's message
float mOppMsgDir
int mHearMax
 max hear capacity units
int mHearInc
 hear capacity increase units when it's silent
int mHearDecay
 hear capacity decrease units when player hears a message
int mHearMateCap
 hear capacity for his team
int mHearOppCap
 hear capacity for opponent team
bool mIfSelfMsg
 is there any message from myself
bool mIfMateMsg
 is there any message from teammate
bool mIfOppMsg
 is there any message from oponnent

Detailed Description

Definition at line 33 of file agentstate.h.


Constructor & Destructor Documentation

AgentState::AgentState  ) 
 

Definition at line 30 of file agentstate.cpp.

References SetUniformNumber().

Here is the call graph for this function:

AgentState::~AgentState  )  [virtual]
 

Definition at line 41 of file agentstate.cpp.


Member Function Documentation

void AgentState::AddMessage const std::string &  msg,
float  direction,
bool  teamMate
 

Add a new message to the list.

void AgentState::AddSelfMessage const std::string &  msg  ) 
 

float AgentState::GetBattery  )  const
 

Get the battery state.

Definition at line 87 of file agentstate.cpp.

References mBattery.

bool AgentState::GetMessage std::string &  msg,
float &  direction,
bool  teamMate
 

Get the first message from the list.

bool AgentState::GetSelfMessage std::string &  msg  ) 
 

TTeamIndex AgentState::GetTeamIndex  )  const
 

returns the team index

Definition at line 52 of file agentstate.cpp.

References mTeamIndex.

float AgentState::GetTemperature  )  const
 

Get the motor temperature.

Definition at line 99 of file agentstate.cpp.

int AgentState::GetUniformNumber  )  const
 

returns the uniform number as integer

Definition at line 68 of file agentstate.cpp.

References mUniformNumber.

bool AgentState::ReduceBattery double  consumption  ) 
 

reduce battery by the given amout.

Parameters:
consumption the amount by which the battery is reduced if possible
Returns:
true if the battery if good enough for the given consumption

Definition at line 111 of file agentstate.cpp.

References mBattery.

void AgentState::SetBattery float  battery  ) 
 

Set the battery state.

Definition at line 93 of file agentstate.cpp.

References mBattery.

void AgentState::SetID const std::string &  id,
TPerceptType  pt = PT_Default
[virtual]
 

Set the object id for perceptors.

This method is the same as SetUniformNumber for AgentState. If id is not an integer, the object ID will not be changed.

Parameters:
id a new ID, an integer represented as std::string.
pt the percept type for which the ID is set

Definition at line 74 of file agentstate.cpp.

References mUniformNumber, and ObjectState::SetID().

Here is the call graph for this function:

void AgentState::SetTeamIndex TTeamIndex  idx  ) 
 

set the team index

Definition at line 46 of file agentstate.cpp.

References mTeamIndex.

void AgentState::SetTemperature float  temperature  ) 
 

Set the temperature.

Definition at line 105 of file agentstate.cpp.

References mTemperature.

void AgentState::SetUniformNumber int  number  ) 
 

Set the uniform number.

This sets both the uniform number as well as the object id (only the representation is different).

Definition at line 59 of file agentstate.cpp.

References mUniformNumber, and ObjectState::SetID().

Referenced by AgentState().

Here is the call graph for this function:


Member Data Documentation

double AgentState::mBattery [protected]
 

battery state

Definition at line 105 of file agentstate.h.

Referenced by GetBattery(), ReduceBattery(), and SetBattery().

int AgentState::mHearDecay [protected]
 

hear capacity decrease units when player hears a message

Definition at line 123 of file agentstate.h.

int AgentState::mHearInc [protected]
 

hear capacity increase units when it's silent

Definition at line 121 of file agentstate.h.

int AgentState::mHearMateCap [protected]
 

hear capacity for his team

Definition at line 126 of file agentstate.h.

int AgentState::mHearMax [protected]
 

max hear capacity units

Definition at line 119 of file agentstate.h.

int AgentState::mHearOppCap [protected]
 

hear capacity for opponent team

Definition at line 128 of file agentstate.h.

bool AgentState::mIfMateMsg [protected]
 

is there any message from teammate

Definition at line 133 of file agentstate.h.

bool AgentState::mIfOppMsg [protected]
 

is there any message from oponnent

Definition at line 135 of file agentstate.h.

bool AgentState::mIfSelfMsg [protected]
 

is there any message from myself

Definition at line 131 of file agentstate.h.

std::string AgentState::mMateMsg [protected]
 

team-mate's message

Definition at line 111 of file agentstate.h.

float AgentState::mMateMsgDir [protected]
 

Definition at line 112 of file agentstate.h.

std::string AgentState::mOppMsg [protected]
 

opponent's message

Definition at line 115 of file agentstate.h.

float AgentState::mOppMsgDir [protected]
 

Definition at line 116 of file agentstate.h.

std::string AgentState::mSelfMsg [protected]
 

self message

Definition at line 108 of file agentstate.h.

TTeamIndex AgentState::mTeamIndex [protected]
 

team index

Definition at line 96 of file agentstate.h.

Referenced by GetTeamIndex(), and SetTeamIndex().

float AgentState::mTemperature [protected]
 

motor temperature

Definition at line 102 of file agentstate.h.

Referenced by SetTemperature().

int AgentState::mUniformNumber [protected]
 

uniform number

Definition at line 99 of file agentstate.h.

Referenced by GetUniformNumber(), SetID(), and SetUniformNumber().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:37:32 2006 for rcssserver3d by  doxygen 1.4.4