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

# Modules/BehaviorControl/GT2005BehaviorControl/GT2005Symbols/GT2005StrategySymbols.h

Go to the documentation of this file.

    00001 /**
    00002 * @file GT2005StrategySymbols.h
    00003 *
    00004 * Declaration of class GT2005StrategySymbols.
    00005 *
    00006 * @author Martin Lötzsch
    00007 */
    00008
    00009 #ifndef __GT2005StrategySymbols_h_
    00010 #define __GT2005StrategySymbols_h_
    00011
    00012 #include "../../BehaviorControl.h"
    00013 #include "Tools/Xabsl2/Xabsl2Engine/Xabsl2Engine.h"
    00014 #include "Tools/Streams/InStreams.h"
    00015 #include "Tools/Streams/OutStreams.h"
    00016
    00017 /**
    00018 * The Xabsl2 symbols that are defined in "strategy-symbols.xml"
    00019 *
    00020 * @author Martin Lötzsch
    00021 */
    00022 class GT2005StrategySymbols : public Xabsl2FunctionProvider, public BehaviorControlInterfaces
    00023 {
    00024 public:
    00025   /*
    00026   * Constructor.
    00027   * @param interfaces The paramters of the BehaviorControl module.
    00028   */
    00029   GT2005StrategySymbols(BehaviorControlInterfaces& interfaces);
    00030
    00031   enum BehaviorTimeState
    00032   {
    00033     dontSave,
    00034     saveTime,
    00035     resetTime
    00036   };
    00037
    00038   BehaviorTimeState behaviorTimeCarryBallState;
    00039   BehaviorTimeState behaviorTimeKickState;
    00040
    00041   /** registers the symbols at an engine */
    00042   void registerSymbols(Xabsl2Engine& engine);
    00043
    00044   /** updates the symbols */
    00045   void update();
    00046
    00047   /** current estimated time to reach the ball */
    00048   double estimatedTimeToReachBall;
    00049
    00050   /** computes the estimated time to reach the ball */
    00051   void estimateTimeToReachBall();
    00052
    00053   /** current role */
    00054   BehaviorTeamMessage::DynamicRole role;
    00055
    00056   /** computes the current role */
    00057   void computeRole();
    00058
    00059   //!@name Input symbols
    00060   //!@{
    00061   /*
    00062   * A function for the symbol "robot-number".
    00063   * Returns the robots back number as read from player.cfg
    00064   */
    00065   double getRobotNumber() { return (double)(getPlayer().getPlayerNumber() + 1); };
    00066
    00067   /*!< calculates the value for the input function get-angle-to-teammate with parameter index */
    00068   double getAngleToTeammate();
    00069   /*!< the Parameter "robot-pose.get-angle-to-teammate.index" for the decimal input function "robot-pose.get-angle-to-teammate" */
    00070   double angleToTeammateIndex;
    00071
    00072   /*!< calculates the value for the input function get-time-since-last-carry-ball */
    00073   double getTimeSinceLastCarryBall();
    00074
    00075   /*!< calculates the value for the input function get-time-since-kick */
    00076   double getTimeSinceLastKick();
    00077
    00078   /** A function for the symbol "another-player-is-in-ready-state". */
    00079   bool getAnotherPlayerIsInReadyState();
    00080
    00081   /** A function for the symbol "another-player-is-in-initial-state". */
    00082   bool getAnotherPlayerIsInInitialState();
    00083
    00084   /** A function for the symbol "another-teammate-is-performing-a-kick" */
    00085   bool getAnotherTeammateIsPerformingAKick();
    00086
    00087   /** A function for the symbol "another-teammate-is-performing-a-pass" */
    00088   bool getAnotherTeammateIsPerformingAPass();
    00089
    00090   /** A function for the symbol "the-striker-is-playing-near-the-opponent-goal" */
    00091   bool getTheStrikerIsPlayingNearTheOpponentGoal();
    00092
    00093   /** A function for the symbol "the-striker-is-not-playing-near-the-opponent-goal" */
    00094   bool getTheStrikerIsNotPlayingNearTheOpponentGoal();
    00095
    00096   /** A function for the symbol "the-striker-is-playing-near-the-own-goal" */
    00097   bool getTheStrikerIsPlayingNearTheOwnGoal();
    00098
    00099   /** A function for the symbol "the-striker-is-not-playing-near-the-own-goal" */
    00100   bool getTheStrikerIsNotPlayingNearTheOwnGoal();
    00101
    00102   /** A function for the symbol "goalie-max-position-speed" */
    00103   double getGoalieMaxPositionSpeed();
    00104
    00105   /** A function for the symbol "search-ball.x" */
    00106   double getSearchBallX();
    00107
    00108   /** Whether the ball is handled at the moment */
    00109   bool ballIsHandledAtTheMoment;
    00110
    00111   /** Whether the robot is running to the interception point with the ball */
    00112   bool goingToInterceptionPoint;
    00113
    00114   /** Represents the time since last successfully ball carrying */
    00115   unsigned long timeSinceLastCarryBall;
    00116
    00117   /** Represents the time since last successfull kick */
    00118   unsigned long timeSinceLastKick;
    00119
    00120   //!@}
    00121
    00122   /** Output-Symbols for Profiler */
    00123   enum { doProfiling, dontDoProfiling} doProfile;
    00124   enum { writeProfiles, writeCompleteProfiles, dontWriteProfiles} writeProfile;
    00125
    00126 private:
    00127    bool timeSinceLastCarryBallSaved;
    00128    bool timeSinceLastKickSaved;
    00129
    00130    BehaviorTeamMessage::DynamicRole roleLastFrame;
    00131    unsigned long timeStampSinceRoleChange;
    00132 };
    00133
    00134
    00135 #endif // __GT2005StrategySymbols_h_
    00136