Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

RS::WorldModel Class Reference

This class contains the agens model of the world. More...

Collaboration diagram for RS::WorldModel:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WorldModel ()
 Default constructor.

virtual ~WorldModel ()
 Destructor.

 WorldModel (const WorldModel &wm)
 CopyConstructor.

WorldModel & operator= (const WorldModel &wm)
 assignment operator

void addOpponent (const PlayerObject &opponent)
 Add an opponent to the agents world model.

const std::vector< PlayerObject > & getOpponents () const
 Returns the opponents the agent knows about.

const PlayerObjectgetOpponentClosestToAgent () const
 Returns the opponent closest to the agent.

const PlayerObjectgetOpponentClosestToBall () const
 Returns the opponent closest to the ball.

void setOpponentClosestToAgent (PlayerObject *player)
 Set the teammate closest to the agent.

void setOpponentClosestToBall (PlayerObject *player)
 Set the teammate closest to the ball.

std::vector< PlayerObject > & getOpponents ()
 Returns the opponets to the Strategies.

void clearOpponents ()
 Clear all the opponents from the world model.

void addTeammate (const PlayerObject &teammates)
 Add a teammate to the agents world model.

const std::vector< PlayerObject > & getTeammates () const
 Returns the teammates the agent knows about.

const PlayerObjectgetTeammateClosestToAgent () const
 Returns the opponent closest to the agent.

const PlayerObjectgetTeammateClosestToBall () const
 Returns the observed teammate which is closest to the ball.

const PlayerObjectgetTeammateIncludingAgentClosestToBall () const
 Returns the teammate, including the agent, which is closest to the ball.

void setTeammateClosestToBall (PlayerObject *player)
 Set the teammate closest to the ball.

void setTeammateClosestToAgent (PlayerObject *player)
 Set the teammate closest to the agent.

std::vector< PlayerObject > & getTeammates ()
 Returns the teammates to the Strategies.

void clearTeammates ()
 Clear all the teammates from the world model.

void addUnknown (const PlayerObject &unknown)
 Add a unknown player to the world model.

const std::vector< PlayerObject > & getUnknowns () const
 Returns the unknown players.

std::vector< PlayerObject > & getUnknowns ()
 Returns the unknown players to the strategies.

void clearUnknowns ()
 Clear all the unknown player from the world model.

void setBall (const BallObject &ball)
 Set the ball in the world model.

const BallObjectgetBall () const
 Returns the ball from the agents world model.

BallObjectgetBall ()
 Returns the ball to a Strategy.

void setAgent (const AgentObject &agent)
 Set the agents information about itself.

const AgentObjectgetAgent () const
 Get the agents model of itself.

AgentObjectgetAgent ()
 Returns the agent object to a Strategy.

void addPlayMode (const PlayMode &playMode)
 Add a playmode for the current world model.

const std::vector< PlayMode > & getPlayModes () const
 Returns the playmodes for the current world model.

std::vector< PlayMode > & getPlayModes ()
 Returns the playmodes to a Strategy.

void clearPlayModes ()
 Clear all but the last playmodes.

const PlayMode getLastPlayMode () const
 Returns the last playmode in the worldmodel.

const TimegetGameTime () const
 Return the current world models game time.

void setGameTime (Time time)
const TimeUnknowngetLastSeeTime () const
 Return the time for last visual information.

void setLastSeeTime (Time time)
const TimeUnknowngetNextSeeTime () const
 Return the time for the next visual information.

void setNextSeeTime (const TimeUnknown &time)
const TimeUnknowngetNextNextSeeTime () const
 Return the time for the second next visual information.

void setNextNextSeeTime (const TimeUnknown &time)
void addCommand (const ServerCommand *cmd)
const std::list< const ServerCommand * > & getCommands () const

Protected Attributes

std::vector< PlayModeplayModes
 Representation of the playmodes.

BallObject ball
 The model of the ball.

AgentObject agent
 The model of the agent itself.

std::vector< PlayerObjectopponents
 The models of the opponents.

PlayerObjectclosestOpponent
 The opponent closest to the player.

PlayerObjectclosestOpponentToBall
 The opponent closest to the ball.

std::vector< PlayerObjectteammates
 The models of the teammates.

PlayerObjectclosestTeammate
 The opponent closest to the player.

PlayerObjectclosestTeammateToBall
 The opponent closest to the ball.

std::vector< PlayerObjectunknowns
 The models of the unknown players.

std::string ownMessage
 Last heard message from ourself.

std::string playerMessage
 Last heard message from another player.

std::string coachMessage
 Last heard message from the coach.

Time gameTime
 Represent the game time in the current world model.

TimeUnknown lastSeeTime
 Representation of the time we last saw something.

TimeUnknown nextSeeTime
 The next cycle we should see something.

TimeUnknown nextNextSeeTime
 The second next cycle we should see something.

PlayerObject emptyPlayer
 A Unknown player for return values.

std::list< const ServerCommand * > commands
 A list of the executed commands this cycle.


Detailed Description

This class contains the agens model of the world.

The class contains fundamental information about the agents belives of the world. The agents position and speed, where the teammates and opponents are, the current playmode, and the speed and position of the ball are examples of information in the agens world model. The Worldmodel is stored in a history in WorldModelInterface and updated by the agenst Strategies.

Todo:
More information

Document interaction with Views.

Is the const/nonconst methods necessary.

Unit:
BasicSystem
Revision
1.10
Author
frehe
Date
2007/09/26 13:10:16

Definition at line 100 of file WorldModel.h.


Member Function Documentation

const PlayerObject & RS::WorldModel::getOpponentClosestToAgent   const
 

Returns the opponent closest to the agent.

* If we don't known anything at all about any opponent. A PlayerObject with all values unknown will be returned.

Definition at line 192 of file WorldModel.cc.

References closestOpponent, and emptyPlayer.

Referenced by RS::PlayerView::getOpponentClosestToAgent().

const PlayerObject & RS::WorldModel::getOpponentClosestToBall   const
 

Returns the opponent closest to the ball.

If we don't known anything at all about any opponent. A PlayerObject with all values unknown will be returned.

Definition at line 198 of file WorldModel.cc.

References closestOpponentToBall, and emptyPlayer.

Referenced by RS::PlayerView::getOpponentClosestToBall().

const PlayerObject & RS::WorldModel::getTeammateClosestToAgent   const
 

Returns the opponent closest to the agent.

If no teammate is seen then a PlayerObject with all values unknown will be returned.

Definition at line 228 of file WorldModel.cc.

References closestTeammate, and emptyPlayer.

Referenced by RS::PlayerView::getTeammateClosestToAgent().

const PlayerObject & RS::WorldModel::getTeammateClosestToBall   const
 

Returns the observed teammate which is closest to the ball.

The agent itself is not included. If no teammate is seen then a PlayerObject with all values unknown will be returned.

Definition at line 234 of file WorldModel.cc.

References closestTeammateToBall, and emptyPlayer.

Referenced by RS::PlayerView::getTeammateClosestToBall(), and getTeammateIncludingAgentClosestToBall().

const PlayerObject & RS::WorldModel::getTeammateIncludingAgentClosestToBall   const
 

Returns the teammate, including the agent, which is closest to the ball.

If no teammates are seen then the closest teammate will be the agent itself.

Definition at line 240 of file WorldModel.cc.

References agent, getAgent(), getBall(), RS::MobileObject::getPosition(), and getTeammateClosestToBall().

Referenced by RS::PlayerView::getTeammateIncludingAgentClosestToBall().


The documentation for this class was generated from the following files:
Generated on Mon Aug 29 08:27:16 2011 for RoboSoc by doxygen1.3-rc3