00001 /** 00002 * @file BehaviorTeamMessage.h 00003 * 00004 * Declaration of class BehaviorTeamMessage 00005 * 00006 * @author Martin Lötzsch 00007 */ 00008 00009 #ifndef __BehaviorTeamMessage_h_ 00010 #define __BehaviorTeamMessage_h_ 00011 00012 #include "Tools/Streams/InOut.h" 00013 #include "Tools/Player.h" 00014 #include "Tools/DynamicTeamTactic/RateableOptions.h" 00015 00016 00017 00018 00019 /** 00020 * @class BehaviorTeamMessage 00021 * 00022 * Represents a message that is exchanged between the behaviors of different robots. 00023 * 00024 * @author Martin Loetzsch 00025 */ 00026 class BehaviorTeamMessage 00027 { 00028 public: 00029 /** 00030 * Constructor. 00031 */ 00032 BehaviorTeamMessage(); 00033 00034 /** The time that the sender of the message estimates for reaching the ball */ 00035 double estimatedTimeToReachBall; 00036 00037 /** 00038 * Different discrete messages that can be exchanged. 00039 * Used by XabslBehaviorControl. 00040 */ 00041 enum Message 00042 { 00043 none, /*!< no message */ 00044 00045 justPerformedAKick, /*!< The player performed a kick. Used by GT2003BehaviorControl */ 00046 performingAKick, /*!< The player performes a kick. Used by GT2003BehaviorControl */ 00047 preparingAKick, /*!< The player prepares a kick. Used by GT2003BehaviorControl */ 00048 sync /*!< The player sends a sync signal. Used to synchronise behavior */ 00049 }; 00050 00051 /** the message */ 00052 Message message; 00053 00054 /** 00055 * The game state of the sender. 00056 * Used by Humboldt2003BehaviorControl and GT2003BehaviorControl. 00057 */ 00058 enum GameState { sleep, initial, ready, set, playing, penalized, finished } gameState; 00059 00060 /** 00061 * The dynamic role of the sender. 00062 * Used by DDD2003BehaviorControl and GT2003BehaviorControl. 00063 */ 00064 enum DynamicRole { goalie, striker, offensiveSupporter, defensiveSupporter } dynamicRole; 00065 00066 /** 00067 * The ratedOptions of the sender. 00068 * Used by GT2004BehaviorControl 00069 */ 00070 unsigned char ratedOptions[RateableOptions::numOfOptions]; 00071 00072 typedef struct WalkR 00073 { 00074 double type; 00075 double x; 00076 double y; 00077 double rotation; 00078 } WalkRequest; 00079 00080 /** 00081 * the MothionRequest from the Dog at the bridge. 00082 * Used by OpenChallange04 00083 */ 00084 WalkR walkRequest; 00085 00086 /** the status of the open challenge */ 00087 int ocStatus; 00088 int masterWaitState; 00089 }; 00090 00091 00092 00093 /** 00094 * Streaming operator that reads a BehaviorTeamMessage from a stream. 00095 * @param stream The stream from which is read. 00096 * @param behaviorTeamMessage The BehaviorTeamMessage object. 00097 * @return The stream. 00098 */ 00099 In& operator>>(In& stream,BehaviorTeamMessage& behaviorTeamMessage); 00100 00101 /** 00102 * Streaming operator that writes a BehaviorTeamMessage to a stream. 00103 * @param stream The stream to write on. 00104 * @param behaviorTeamMessage The BehaviorTeamMessage object. 00105 * @return The stream. 00106 */ 00107 Out& operator<<(Out& stream, const BehaviorTeamMessage& behaviorTeamMessage); 00108 00109 #endif //__BehaviorTeamMessage_h_ 00110 00111 /* 00112 * Change log : 00113 * 00114 * $Log: BehaviorTeamMessage.h,v $ 00115 * Revision 1.3 2004/07/22 22:38:24 kerdels 00116 * added DTT used by Open Challenge, RIP and Xabsl-Options will follow 00117 * 00118 * Revision 1.2 2004/05/22 22:31:16 loetzsch 00119 * removed 00120 * 00121 * Revision 1.1.1.1 2004/05/22 17:26:04 cvsadm 00122 * created new repository GT2004_WM 00123 * 00124 * Revision 1.8 2004/05/17 17:17:50 kerdels 00125 * added symbols for the sequence control of the open challenge, 00126 * fixed a bug concerning 5-dog-mode and distribution of option-ratings, 00127 * set one = 0 in enum Player::playerNumber --> just to be sure ;-) 00128 * 00129 * Revision 1.7 2004/05/08 16:18:13 hamerla 00130 * Open Challenge 00131 * 00132 * Revision 1.6 2004/05/03 22:23:36 risler 00133 * added goal and final stuff 00134 * 00135 * Revision 1.5 2004/03/25 17:37:42 loetzsch 00136 * added a few elements in sent-game-state 00137 * 00138 * Revision 1.4 2004/03/24 14:02:33 tim 00139 * added "set" state 00140 * 00141 * Revision 1.3 2004/01/25 16:17:12 kerdels 00142 * fixed a bug and reduced network traffic 00143 * 00144 * Revision 1.2 2003/12/17 20:09:59 kerdels 00145 * BehaviorTeamMessage um eine Eigenschaft ratedOptions erweitert, 00146 * CollectedBeliefs.update() und .broadcast() implementiert. 00147 * 00148 * Revision 1.1 2003/10/07 10:09:36 cvsadm 00149 * Created GT2004 (M.J.) 00150 * 00151 * Revision 1.3 2003/07/02 20:43:34 dueffert 00152 * warning removed 00153 * 00154 * Revision 1.2 2003/07/02 19:14:23 loetzsch 00155 * bug fixes, removed unused functions 00156 * 00157 * Revision 1.1.1.1 2003/07/02 09:40:23 cvsadm 00158 * created new repository for the competitions in Padova from the 00159 * tamara CVS (Tuesday 2:00 pm) 00160 * 00161 * removed unused solutions 00162 * 00163 * Revision 1.8 2003/05/31 14:37:47 loetzsch 00164 * removed conflicts 00165 * 00166 * Revision 1.7 2003/05/30 13:17:26 timrie 00167 * added symbols: 00168 * performingAKick 00169 * preparingAKick 00170 * 00171 * Revision 1.6 2003/05/27 16:52:53 loetzsch 00172 * first passing experiments 00173 * 00174 * Revision 1.5 2003/05/08 00:23:44 risler 00175 * added strategy symbols 00176 * 00177 * Revision 1.4 2003/04/15 15:52:12 risler 00178 * DDD GO 2003 code integrated 00179 * 00180 * Revision 1.5 2003/04/11 04:14:52 max 00181 * added symbol all players sync 00182 * 00183 * Revision 1.4 2003/04/06 18:52:03 dthomas 00184 * modified: dynamicRole added to BehaviorTeamMessage, moved functions to DDD-behavior-control and updated all calls 00185 * 00186 * Revision 1.3 2003/03/28 14:43:57 max 00187 * tamara update 00188 * 00189 * Revision 1.3 2003/03/28 14:14:25 loetzsch 00190 * removed bar challenge related messages, 00191 * added gameState 00192 * 00193 * Revision 1.2 2002/09/22 18:40:51 risler 00194 * added new math functions, removed GTMath library 00195 * 00196 * Revision 1.1 2002/09/10 15:26:41 cvsadm 00197 * Created new project GT2003 (M.L.) 00198 * - Cleaned up the /Src/DataTypes directory 00199 * - Removed Challenge Code 00200 * - Removed processing of incoming audio data 00201 * - Renamed AcousticMessage to SoundRequest 00202 * 00203 * Revision 1.6 2002/08/29 14:41:13 dueffert 00204 * includes in correct case, system includes in <> 00205 * 00206 * Revision 1.5 2002/07/23 13:32:57 loetzsch 00207 * new streaming classes 00208 * 00209 * removed many #include statements 00210 * 00211 * Revision 1.4 2002/06/12 13:24:22 loetzsch 00212 * added behavior team messages for the strikers 00213 * pattern challenge behavior 00214 * 00215 * Revision 1.3 2002/06/12 10:28:34 risler 00216 * behavior team messages added as xabsl symbols 00217 * 00218 * Revision 1.2 2002/06/09 15:24:51 loetzsch 00219 * Added TeamMessageCollection and BehaviorTeamMessage to the execute of BehaviorControl 00220 * 00221 * Revision 1.1.1.1 2002/05/10 12:40:13 cvsadm 00222 * Moved GT2002 Project from ute to tamara. 00223 * 00224 * Revision 1.1 2002/05/05 14:05:39 loetzsch 00225 * first draft 00226 * 00227 */ 00228