⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 worldmodel.h

📁 robocup 3d, a 3d base team similar to UvA 2d
💻 H
字号:
/***********************************************************************************                            In the name of Almighty                            **                                                                               **           WorldModel.h : Robocup 3D Soccer Simulation Team Zigorat            **                     (This team was previously named Gcyrus)                   **                                                                               **  Date: 03/20/2007                                                             **  Author: Mahdi Hamdarsi                                                       **  Comments: This is the agents memory of outside world                         **                                                                               ***********************************************************************************//*! \file WorldModel.h<pre><b>File:</b>          WorldModel.h<b>Project:</b>       Robocup Soccer Simulation Team: Zigorat<b>Authors:</b>       Mahdi Hamdarsi<b>Created:</b>       03/20/2007<b>Last Revision:</b> $ID$<b>Contents:</b>      This is the agents memory of outside world<hr size=2><h2><b>Changes</b></h2><b>Date</b>             <b>Author</b>          <b>Comment</b>03/20/2007       Mahdi           Initial version created</pre>*/#ifndef WORLD_MODEL#define WORLD_MODEL#include "SoccerTypes.h"      // needed for JointT#include "Objects.h"          // Needed for Joint#include "Formations.h"/*****************************************************************************//********************** CLASS WORLDMODEL *************************************//*****************************************************************************//*! The Class WorlModel contains all the RoboCup information that is available    on the field. It contains information about the players, ball, flags and    lines. Furthermore it contains methods to extract useful information.    The (large amount of) attributes can be separated into different groups:    - Environmental information: specific information about the soccer server    - Match information: general information about the current state of a match    - Object information: all the objects on the soccer field    - Action information: actions that the agent has performed    The methods can also be divided into different groups:    - Retrieval methods: directly retrieving information of objects    - Update methods: update world based on new sensory information    - Prediction methods: predict future states based on past perceptions    - High-Level methods: deriving high-level conclusions from basic worldstate*/class WorldModel{private:  /***************************************************************************/  /*************************** ATTRIBUTES ************************************/  /***************************************************************************/  double       m_SimulatorTime;                     /*!< Simulator time in seconds */  double       m_GameTime;                          /*!< Game time in seconds      */  double       m_SimulatorStep;                     /*!< Simulator Step in seconds */  double       m_GoalWidth;                         /*!< Goal width total          */  double       m_GoalHeight;                        /*!< Goal height total         */  double       m_FieldLength;                       /*!< Field height total        */  double       m_FieldWidth;                        /*!< Fieldwidth total          */    int          m_AgentNumber;                       /*!< Agent number on field     */  unsigned     m_CurrentCycle;                      /*!< Currnt cycle of simulation*/  string       m_TeamName;                          /*!< Team name of the agent    */  Formations * m_Formations;                        /*!< Formations of the agent   */  PlayModeT    m_PlayMode;                          /*!< Current play mode         */  SideT        m_Side;                              /*!< Side which agent plays for*/  ////////////////////////// OBJECTS //////////////////////////////////////////  BallObject   m_Ball;                         /*!< Ball                      */  FlagObject   m_Flags[4];                     /*!< Flags                     */  FlagObject   m_Goals[4];                     /*!< Flags                     */  PlayerObject m_Teammates[MAX_TEAMMATES];    /*! Teammates information      */  PlayerObject m_Opponents[MAX_TEAMMATES];    /*! Opponents information      */  AgentObject  m_Agent;                        /*!< Agent Object reference    */  TSensor      m_Sensors[MAX_SENSORS];         /*!< Sensors of the robot      */  Joint        m_Joints[MAX_JOINTS];            /*!< Joints of the agent body  */  VecPosition  m_Gyroscope;                    /*!< Gyroscope of the torso    */  //////////////////////////// UPDATE OPERATIONS //////////////////////////////  /// Parsers  bool          updateTime                 ( char **strMsg                   );  bool          updateSensors              ( char **strMsg                   );  bool          updateGyroscope            ( char **strMsg                   );  bool          updateUniversalJoint       ( char **strMsg                   );  bool          updateHingeJoint           ( char **strMsg                   );  bool          updateBallPosition         ( char **strMsg                   );  bool          updateFlagPosition         ( char **strMsg                   );  bool          updatePositions            ( char **strMsg                   );  bool          updateGameState            ( char **strMsg                   );  /// Mid-level Updaters  VecPosition   getRawPosition             (  ObjectT objFlag                ) const;  bool          updateCoordinates          (                                 );  bool          updateGlobalFromRelative   (                                 );  /// Methods used to log the world model  void          logWorldModel              (                                 );	  /// Internal affairs of the WorldModel :)  bool          setJoint                   ( JointT ID, const Joint & jnt    );  bool          setJoint                   ( JointT ID, double axis1 = 0,                                                        double rate1 = 0,                                                        double axis2 = 0,                                                        double rate2 = 0     );public:  /////////////////////////// DIRECT RETRIEVAL ///////////////////////////////  /// get and set methods of attributes in WorldModel itself                WorldModel                 ( Formations * formations         );              ~ WorldModel                 (                                 );  double        getSimulatorTime           (                                 ) const;  double        getSimulatorStep           (                                 ) const;  double        getTime                    (                                 ) const;  unsigned      getCurrentCycle            (                                 ) const;  PlayModeT     getPlayMode                (                                 ) const;  SideT         getSide                    (                                 ) const;  double        getGoalWidth               (                                 ) const;  bool          setGoalWidth               ( const double & value            );  double        getGoalHeight              (                                 ) const;  bool          setGoalHeight              ( const double & value            );  double        getFieldLength             (                                 ) const;  bool          setFieldLength             ( const double & value            );  double        getFieldWidth              (                                 ) const;  bool          setFieldWidth              ( const double & value            );  Rect          getFieldRect               (                                 ) const;  VecPosition   getBallPosition            (                                 ) const;  VecPosition   getGlobalPositionFlag      ( ObjectT objFlag                 ) const;    bool          isConfidenceGood           ( ObjectT obj                     ) const;  Time          getTimeLastSeen            ( ObjectT obj                     ) const;  VecPosition   getPosition                ( ObjectT obj                     ) const;  Joint         getJoint                   ( JointT ID                       ) const;  double        getSensor                  ( SensorT sensor                  ) const;  VecPosition   getGyroscope               (                                 ) const;  AngDeg        getAgentPhi                (                                 ) const;  AngDeg        getAgentDirection          (                                 ) const;  VecPosition   getAgentPosition           (                                 ) const;  double        getAgentMass               (                                 ) const;  double        getAgentBattery            (                                 ) const;  double        getAgentTemprature         (                                 ) const;  int           getAgentNumber             (                                 ) const;  bool          setAgentNumber             ( const int & number              );  string        getTeamName                (                                 ) const;  bool          setTeamName                ( const string & name             );  /// Formations related tasks  FormationT    getCurrentFormation        (                                 ) const;  bool          setCurrentFormation        ( FormationT formation            );  VecPosition   getStrategicPosition       ( int number = -1,                                             FormationT formation=FT_ILLEGAL ) const;  ////////////////////////////// UPDATE METHODS ///////////////////////////////  bool          updateAll                  (                                 );  bool          updateFromServerMsg        ( char ** msg                     );};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -