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

Tools/DynamicTeamTactic/CollectedBeliefs.h

Go to the documentation of this file.
00001 /**
00002  * @file CollectedBeliefs.h
00003  * 
00004  * Declaration of class CollectedBeliefs
00005  * @author <A href=mailto:jochen@kerdels.de>Jochen Kerdels</A>
00006  */ 
00007 
00008 #ifndef __CollectedBeliefs_h_
00009 #define __CollectedBeliefs_h_
00010 
00011 #include "Modules/BehaviorControl/BehaviorControl.h"
00012 #include "Tools/Player.h"
00013 #include "Representations/Cognition/BallModel.h"
00014 #include "Representations/Cognition/RobotPose.h"
00015 #include "RateableOptions.h"
00016 #include "Tools/SlidingAverageValue.h"
00017 
00018 
00019 /**
00020  *  The class contains information on how the robot senses his
00021  *  enviroment.
00022  */
00023 class SingleBeliefs
00024 {
00025 public:
00026   /** Constructor */
00027   SingleBeliefs();
00028 
00029   /** Destructor */
00030   ~SingleBeliefs();
00031 
00032   /** Rating on all "options" */
00033   SlidingAverageValue ratedOptions[RateableOptions::numOfOptions];
00034 
00035   /** The time when the package was sent */
00036   unsigned long timeStamp;
00037 
00038   /** the timeStamps from the other SingleBeliefs
00039     * can be used to detect single sided Communication failure
00040     * based upon suggestion from Jörn (see IRC Log 6.12.2003)
00041     *
00042     * zunächst lasse ich das mal raus... mal sehen, ob wir das
00043     * wirklich brauchen
00044     */
00045   //unsigned long lastUpdateFromTeamMember[3];
00046 
00047   RateableOptions::OptionID getBestOptionInOptionClass(RateableOptions::OptionClassID id);
00048 
00049 private:
00050 
00051   RateableOptions::OptionID lastBestOpt[RateableOptions::numOfOptionClasses];
00052 
00053 };
00054 
00055 /**
00056  * Streaming operator that reads a SingleBeliefs from a stream.
00057  * @param stream The stream from which is read.
00058  * @param singleBeliefs The SingleBeliefs object.
00059  * @return The stream.
00060  */ 
00061 In& operator>>(In& stream,SingleBeliefs& singleBeliefs);
00062 
00063 /**
00064  * Streaming operator that writes a SingleBeliefs to a stream.
00065  * @param stream The stream to write on.
00066  * @param singleBeliefs The SingleBeliefs object.
00067  * @return The stream.
00068  */ 
00069 Out& operator<<(Out& stream,SingleBeliefs& singleBeliefs);
00070 
00071 
00072 
00073 /**
00074  *  This class contains the PlayerPoses of all detected robots.
00075  */
00076 class CollectedBeliefs : public BehaviorControlInterfaces
00077 {
00078 public:
00079   /** Constructor */
00080   CollectedBeliefs(const BehaviorControlInterfaces& interfaces);
00081 
00082   /** Destructor */
00083   ~CollectedBeliefs();
00084 
00085   /** 
00086    * The four SingleBeliefs of the team members.
00087    * To be adressed by (int)Player::playerNumber
00088    */
00089   SingleBeliefs singleBeliefs[Player::numOfPlayerNumbers];
00090 
00091   /**
00092    *  This method updates recently received SingleBeliefs.
00093    *  btw: the "own" SingleBeliefs is singleBeliefs[(int)(getPlayer().getPlayerRole())]
00094    */
00095   void update();
00096 
00097 
00098   /**
00099    *  This method broadcasts the own SingleBeliefs to the other robots.
00100    *  btw: the "own" SingleBeliefs is singleBeliefs[(int)(getPlayer().getPlayerRole())]
00101    */
00102   void broadcast();
00103 
00104   /**
00105    *  This method triggers all SingleBeliefs.rateOptions
00106    */
00107   void trigger();
00108 
00109 
00110 };
00111 
00112 /**
00113  * Streaming operator that reads a CollectedBeliefs from a stream.
00114  * @param stream The stream from which is read.
00115  * @param collectedBeliefs The CollectedBeliefs object.
00116  * @return The stream.
00117  */ 
00118 In& operator>>(In& stream,CollectedBeliefs& collectedBeliefs);
00119  
00120 /**
00121  * Streaming operator that writes a CollectedBeliefs to a stream.
00122  * @param stream The stream to write on.
00123  * @param collectedBeliefs The CollectedBeliefs object.
00124  * @return The stream.
00125  */ 
00126 Out& operator<<(Out& stream, const CollectedBeliefs& collectedBeliefs);
00127 
00128 
00129 #endif //__CollectedBeliefs_h_
00130 
00131 /*
00132  * Change log :
00133  * 
00134  * $Log: CollectedBeliefs.h,v $
00135  * Revision 1.3  2004/07/22 22:38:34  kerdels
00136  * added DTT used by Open Challenge, RIP and Xabsl-Options will follow
00137  *
00138  *
00139  *
00140  */

Generated on Thu Sep 23 19:57:37 2004 for GT2004 by doxygen 1.3.6