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

Object Class Reference

#include <Objects.h>

Inheritance diagram for Object:

Inheritance graph
[legend]
Collaboration diagram for Object:

Collaboration graph
[legend]
List of all members.

Public Methods

 Object ()
virtual void show (ostream &os=cout)=0
AngDeg getRelativeAngle ()
double getRelativeDistance ()
double getConfidence (Time time)
bool setType (ObjectT o)
ObjectT getType () const
bool setRelativePosition (double dDist, AngDeg dAng, Time time)
bool setRelativePosition (VecPosition v, Time time)
VecPosition getRelativePosition () const
bool setTimeRelativePosition (Time time)
Time getTimeRelativePosition () const
bool setGlobalPosition (VecPosition p, Time time)
VecPosition getGlobalPosition () const
bool setTimeGlobalPosition (Time time)
Time getTimeGlobalPosition () const
bool setGlobalPositionLastSee (VecPosition p, Time time)
VecPosition getGlobalPositionLastSee () const
bool setTimeGlobalPosDerivedFromSee (Time time)
Time getTimeGlobalPosDerivedFromSee () const
bool setTimeLastSeen (Time time)
Time getTimeLastSeen () const

Protected Attributes

ObjectT objectType
Time timeLastSeen
VecPosition posGlobal
Time timeGlobalPosition
VecPosition posRelative
Time timeRelativePosition
VecPosition posGlobalLastSee
Time timeGlobalPosDerivedFromSee

Detailed Description

Class Object contains RoboCup information that is available for all objects in the simulation. All (relative) information is relative to an agent as declared in AgentObject. Update of an object (or one of the subclasses) happens by calling the standard get and set methods available in these classes. Calculations on these attributes do not occur in these classes, but in the update methods of the WorldModel.

Definition at line 61 of file Objects.h.


Constructor & Destructor Documentation

Object::Object  
 

This constructor creates an object, all variables are initialized by default (illegal) values

Definition at line 62 of file Objects.cpp.

References OBJECT_ILLEGAL, and objectType.


Member Function Documentation

double Object::getConfidence Time    time
 

This method returns the confidence of the information of this object. The confidence is related to the last time this object was seen and the specified time (normally the time of the last received message).

Parameters:
time  current time to compare with time object was last seen
Returns:
confidence factor of this object

Definition at line 88 of file Objects.cpp.

References Time::getTime(), Time::getTimeDifference(), max(), and timeLastSeen.

Referenced by WorldModel::getConfidence(), WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), and PlayerObject::show().

VecPosition Object::getGlobalPosition   const
 

This method returns the global position of this object. The time of this information is related to the time returned by getTimeGlobalPosition(), but is not checked. So if you want to know the relevance of this position use this method.

Returns:
global position of this object

Definition at line 186 of file Objects.cpp.

References posGlobal.

Referenced by WorldModel::getAgentGlobalPosition(), WorldModel::getGlobalPosition(), WorldModel::getLastOpponentDefender(), WorldModel::getOppGoalieType(), WorldModel::getOwnGoalieType(), WorldModel::updateAgentObjectAfterSee(), and WorldModel::updateObjectRelativeFromGlobal().

VecPosition Object::getGlobalPositionLastSee   const
 

This method returns the global position of this object at the time of the last see message. The time of this information is related to the time returned by getTimeGlobalPosDerivedFromSee().

Returns:
global position of this object

Definition at line 226 of file Objects.cpp.

References posGlobalLastSee.

Referenced by WorldModel::calculateStateBall(), and WorldModel::getGlobalPositionLastSee().

AngDeg Object::getRelativeAngle  
 

This method returns the relative angle of this object to the agent. This equals the angle of the relative position vector.

Returns:
relative angle to this object

Definition at line 70 of file Objects.cpp.

References AngDeg, VecPosition::getDirection(), VecPosition::normalizeAngle(), and posRelative.

Referenced by WorldModel::getRelativeAngle().

double Object::getRelativeDistance  
 

This method returns the relative distance to this object. This equals the magnitude of the relative position vector.

Returns:
relative distance to this object

Definition at line 78 of file Objects.cpp.

References VecPosition::getMagnitude(), and posRelative.

Referenced by WorldModel::getRelativeDistance(), and WorldModel::mapUnknownPlayers().

VecPosition Object::getRelativePosition   const
 

This method returns the relative position of this object. The time of this information is related to the time returned by getTimeRelativePosition(), but is not checked. So if you want to know the relevance of this position use this method.

Returns:
relative position of this object

Definition at line 147 of file Objects.cpp.

References posRelative.

Referenced by WorldModel::getRelativePosition(), and WorldModel::processNewObjectInfo().

Time Object::getTimeGlobalPosDerivedFromSee   const
 

This method returns the time that the global position was calculated using a see message.

Returns:
time of the global position of this object during the last see

Definition at line 244 of file Objects.cpp.

References timeGlobalPosDerivedFromSee.

Referenced by WorldModel::calculateStateBall(), and WorldModel::getTimeGlobalPositionLastSee().

Time Object::getTimeGlobalPosition   const
 

This method returns the time that corresponds to the global position of this object.

Returns:
time of the global position of this object

Definition at line 203 of file Objects.cpp.

References timeGlobalPosition.

Referenced by WorldModel::getTimeGlobalPosition(), WorldModel::removeGhosts(), WorldModel::updateAll(), and WorldModel::updateObjectRelativeFromGlobal().

Time Object::getTimeLastSeen   const
 

This method returns the time that corresponds to the time this object was located in the last see message.

Returns:
time of the last see message that was used to update this object

Definition at line 262 of file Objects.cpp.

References timeLastSeen.

Referenced by WorldModel::getTimeLastSeen(), WorldModel::isVisible(), and WorldModel::show().

Time Object::getTimeRelativePosition   const
 

This method returns the time that corresponds to the relative position of this object.

Returns:
time of the relative position of this object

Definition at line 164 of file Objects.cpp.

References timeRelativePosition.

Referenced by WorldModel::initParticlesBall().

ObjectT Object::getType   const
 

This method returns the type of this object.

Returns:
type of this object

Definition at line 111 of file Objects.cpp.

References ObjectT, and objectType.

Referenced by WorldModel::getAgentObjectType(), FixedObject::getGlobalAngle(), WorldModel::getLastOpponentDefender(), WorldModel::getObjectPtrFromType(), WorldModel::getOppGoalieType(), WorldModel::getOwnGoalieType(), and WorldModel::mapUnknownPlayers().

bool Object::setGlobalPosition VecPosition    p,
Time    time
 

This method sets the global position and the time this information was calculated.

Parameters:
p  new global position
time  time global position was received
Returns:
bool indicating whether the values were set

Definition at line 174 of file Objects.cpp.

References posGlobal, and setTimeGlobalPosition().

Referenced by WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), WorldModel::processSeeGlobalInfo(), WorldModel::removeGhosts(), WorldModel::updateAfterSenseMessage(), WorldModel::updateAgentAndBallAfterSense(), WorldModel::updateAgentObjectAfterSee(), WorldModel::updateBallAfterKick(), WorldModel::updateBallForCollision(), WorldModel::updateDynamicObjectAfterSee(), and WorldModel::updateDynamicObjectForNextCycle().

bool Object::setGlobalPositionLastSee VecPosition    p,
Time    time
 

This method sets the global position calculated using the last see message and the time of this see message. This opposed to the "normal" global position that is also updated when no see message has arrived in a new cycle.

Parameters:
p  new global position
time  time global position was received
Returns:
bool indicating whether the values were set

Definition at line 215 of file Objects.cpp.

References posGlobalLastSee, and setTimeGlobalPosDerivedFromSee().

Referenced by WorldModel::processSeeGlobalInfo(), WorldModel::updateAfterSenseMessage(), WorldModel::updateAgentObjectAfterSee(), and WorldModel::updateDynamicObjectAfterSee().

bool Object::setRelativePosition VecPosition    v,
Time    time
 

This method sets the relative position and the time this information was received using a vecPosition.

Parameters:
p  new relative position
time  time relative position was received
Returns:
bool indicating whether the values were set

Definition at line 135 of file Objects.cpp.

References posRelative, and setTimeRelativePosition().

bool Object::setRelativePosition double    dDist,
AngDeg    ang,
Time    time
 

This method sets the relative position and the time this information was received. The relative position is calculated using the given distance and the given (relative) angle.

Parameters:
dDist  relative distance to object
ang  relative angle to object
time  time relative position was received
Returns:
bool indicating whether the values were set

Definition at line 123 of file Objects.cpp.

References AngDeg, POLAR, posRelative, setTimeRelativePosition(), and VecPosition::setVecPosition().

Referenced by WorldModel::processNewObjectInfo(), and WorldModel::updateObjectRelativeFromGlobal().

bool Object::setTimeGlobalPosDerivedFromSee Time    time
 

This method sets the time the global position was calculated using a see message.

Parameters:
time  time global position was calculated with see message
Returns:
bool indicating whether the value was set

Definition at line 235 of file Objects.cpp.

References timeGlobalPosDerivedFromSee.

Referenced by setGlobalPositionLastSee().

bool Object::setTimeGlobalPosition Time    time
 

This method sets the time the global position was calculated

Parameters:
time  time global position was calculated
Returns:
bool indicating whether the value was set

Definition at line 194 of file Objects.cpp.

References timeGlobalPosition.

Referenced by setGlobalPosition().

bool Object::setTimeLastSeen Time    time
 

This method sets the time of the last see message in which this object was seen.

Parameters:
time  time this object was last seen
Returns:
bool indicating whether the value was set

Definition at line 253 of file Objects.cpp.

References timeLastSeen.

Referenced by WorldModel::processNewObjectInfo(), WorldModel::processPerfectHearInfo(), WorldModel::processPerfectHearInfoBall(), WorldModel::processSeeGlobalInfo(), WorldModel::removeGhosts(), WorldModel::resetTimeObjects(), WorldModel::setTimeLastSeen(), WorldModel::updateAfterSenseMessage(), and WorldModel::updateAgentObjectAfterSee().

bool Object::setTimeRelativePosition Time    time
 

This method sets the time the relative position was received.

Parameters:
time  time relative position was received
Returns:
bool indicating whether the value was set

Definition at line 155 of file Objects.cpp.

References timeRelativePosition.

Referenced by setRelativePosition().

bool Object::setType ObjectT    o
 

This method sets the type of this object (i.e. OBJECT_BALL, FLAG_L_R_T).

Parameters:
o  ObjectT representing the type of this object
Returns:
bool indicating whether value was set.

Definition at line 103 of file Objects.cpp.

References ObjectT, and objectType.

Referenced by WorldModel::mapUnknownPlayers(), WorldModel::processNewObjectInfo(), WorldModel::setAgentObjectType(), and WorldModel::WorldModel().

virtual void Object::show ostream &    os = cout [pure virtual]
 

abstract function that should be defined in a subclass

Reimplemented in FixedObject, PlayerObject, BallObject, and AgentObject.

Referenced by WorldModel::show().


Member Data Documentation

ObjectT Object::objectType [protected]
 

Type of this object

Definition at line 64 of file Objects.h.

Referenced by getType(), Object(), setType(), AgentObject::show(), BallObject::show(), PlayerObject::show(), and FixedObject::show().

VecPosition Object::posGlobal [protected]
 

Global position in the field

Definition at line 67 of file Objects.h.

Referenced by getGlobalPosition(), setGlobalPosition(), AgentObject::show(), BallObject::show(), and PlayerObject::show().

VecPosition Object::posGlobalLastSee [protected]
 

Global position of last see msg

Definition at line 71 of file Objects.h.

Referenced by getGlobalPositionLastSee(), and setGlobalPositionLastSee().

VecPosition Object::posRelative [protected]
 

Relative position of the object

Definition at line 69 of file Objects.h.

Referenced by getRelativeAngle(), getRelativeDistance(), getRelativePosition(), setRelativePosition(), BallObject::show(), and FixedObject::show().

Time Object::timeGlobalPosDerivedFromSee [protected]
 

Time pos derived from see msg

Definition at line 72 of file Objects.h.

Referenced by getTimeGlobalPosDerivedFromSee(), setTimeGlobalPosDerivedFromSee(), and BallObject::show().

Time Object::timeGlobalPosition [protected]
 

Server time of global position

Definition at line 68 of file Objects.h.

Referenced by getTimeGlobalPosition(), setTimeGlobalPosition(), AgentObject::show(), BallObject::show(), and PlayerObject::show().

Time Object::timeLastSeen [protected]
 

Time last see message has arrived

Definition at line 65 of file Objects.h.

Referenced by getConfidence(), getTimeLastSeen(), setTimeLastSeen(), BallObject::show(), PlayerObject::show(), and FixedObject::show().

Time Object::timeRelativePosition [protected]
 

Server time of relative position

Definition at line 70 of file Objects.h.

Referenced by getTimeRelativePosition(), setTimeRelativePosition(), BallObject::show(), and FixedObject::show().


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