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

Representations/WLan/BehaviorTeamMessage.cpp

Go to the documentation of this file.
00001 /**
00002 * @file BehaviorTeamMessage.cpp
00003 *
00004 * Implementation of class BehaviorTeamMessage.
00005 *
00006 * @author Martin Loetzsch
00007 */
00008 
00009 #include "BehaviorTeamMessage.h"
00010 
00011 BehaviorTeamMessage::BehaviorTeamMessage() : 
00012 estimatedTimeToReachBall(1000),
00013 message(none),
00014 gameState(sleep),
00015 dynamicRole(striker)
00016 {
00017   for (int j=0; j<RateableOptions::numOfOptions; ++j)
00018     ratedOptions[j] = 0;
00019   walkRequest.type = 0;
00020   walkRequest.x = 0;
00021   walkRequest.y = 0;
00022   walkRequest.rotation = 0;
00023   ocStatus = 0;
00024   masterWaitState = 0;
00025 }
00026 
00027 In& operator>>(In& stream,BehaviorTeamMessage& behaviorTeamMessage)
00028 {
00029   stream >> behaviorTeamMessage.estimatedTimeToReachBall;
00030   char a;
00031   stream >> a;
00032   behaviorTeamMessage.message = (BehaviorTeamMessage::Message)a;
00033   stream >> a;
00034   behaviorTeamMessage.gameState = (BehaviorTeamMessage::GameState)a;
00035   stream >> a;
00036   behaviorTeamMessage.dynamicRole = (BehaviorTeamMessage::DynamicRole)a;
00037 
00038   for (int i=0; i<RateableOptions::numOfOptions; ++i)
00039     stream >> behaviorTeamMessage.ratedOptions[i];
00040 
00041   stream >> behaviorTeamMessage.walkRequest.type;
00042   stream >> behaviorTeamMessage.walkRequest.x;
00043   stream >> behaviorTeamMessage.walkRequest.y;
00044   stream >> behaviorTeamMessage.walkRequest.rotation;
00045   
00046   stream >> behaviorTeamMessage.ocStatus;
00047   stream >> behaviorTeamMessage.masterWaitState;
00048   return stream;
00049 }
00050 
00051 Out& operator<<(Out& stream, const BehaviorTeamMessage& behaviorTeamMessage)
00052 {
00053   stream << behaviorTeamMessage.estimatedTimeToReachBall
00054     << (char)behaviorTeamMessage.message 
00055     << (char)behaviorTeamMessage.gameState
00056     << (char)behaviorTeamMessage.dynamicRole;
00057 
00058   for (int i=0; i<RateableOptions::numOfOptions; ++i)
00059     stream << behaviorTeamMessage.ratedOptions[i]; 
00060 
00061   stream << behaviorTeamMessage.walkRequest.type;
00062   stream << behaviorTeamMessage.walkRequest.x;
00063   stream << behaviorTeamMessage.walkRequest.y;
00064   stream << behaviorTeamMessage.walkRequest.rotation;
00065 
00066   stream << behaviorTeamMessage.ocStatus;
00067   stream << behaviorTeamMessage.masterWaitState;
00068   return stream;
00069 }
00070 
00071 /*
00072 * Change log :
00073 * 
00074 * $Log: BehaviorTeamMessage.cpp,v $
00075 * Revision 1.3  2004/07/22 22:38:24  kerdels
00076 * added DTT used by Open Challenge, RIP and Xabsl-Options will follow
00077 *
00078 * Revision 1.2  2004/05/22 22:31:16  loetzsch
00079 * removed
00080 *
00081 * Revision 1.1.1.1  2004/05/22 17:26:04  cvsadm
00082 * created new repository GT2004_WM
00083 *
00084 * Revision 1.5  2004/05/17 17:17:50  kerdels
00085 * added symbols for the sequence control of the open challenge,
00086 * fixed a bug concerning 5-dog-mode and distribution of option-ratings,
00087 * set one = 0 in enum Player::playerNumber --> just to be sure ;-)
00088 *
00089 * Revision 1.4  2004/05/08 16:18:13  hamerla
00090 * Open Challenge
00091 *
00092 * Revision 1.3  2004/03/25 17:37:42  loetzsch
00093 * added a few elements in sent-game-state
00094 *
00095 * Revision 1.2  2003/12/17 20:09:58  kerdels
00096 * BehaviorTeamMessage um eine Eigenschaft ratedOptions erweitert,
00097 * CollectedBeliefs.update() und .broadcast() implementiert.
00098 *
00099 * Revision 1.1  2003/10/07 10:09:36  cvsadm
00100 * Created GT2004 (M.J.)
00101 *
00102 * Revision 1.1.1.1  2003/07/02 09:40:23  cvsadm
00103 * created new repository for the competitions in Padova from the 
00104 * tamara CVS (Tuesday 2:00 pm)
00105 *
00106 * removed unused solutions
00107 *
00108 * Revision 1.4  2003/04/15 15:52:12  risler
00109 * DDD GO 2003 code integrated
00110 *
00111 * Revision 1.4  2003/04/06 18:52:03  dthomas
00112 * modified: dynamicRole added to BehaviorTeamMessage, moved functions to DDD-behavior-control and updated all calls
00113 *
00114 * Revision 1.3  2003/03/28 14:14:25  loetzsch
00115 * removed bar challenge related messages,
00116 * added gameState
00117 *
00118 * Revision 1.2  2003/03/06 11:07:01  dueffert
00119 * re-order warning removed
00120 *
00121 * Revision 1.1  2002/09/10 15:26:41  cvsadm
00122 * Created new project GT2003 (M.L.)
00123 * - Cleaned up the /Src/DataTypes directory
00124 * - Removed Challenge Code
00125 * - Removed processing of incoming audio data
00126 * - Renamed AcousticMessage to SoundRequest
00127 *
00128 * Revision 1.6  2002/06/20 00:40:19  Thomas Röfer
00129 * WLan crash removed
00130 *
00131 * Revision 1.5  2002/06/18 11:58:33  loetzsch
00132 * Game against UPenn
00133 *
00134 * Revision 1.4  2002/06/18 04:07:56  loetzsch
00135 * temporarily removed negotiate for who is closer to the ball
00136 *
00137 * Revision 1.3  2002/06/13 21:51:38  loetzsch
00138 * smarter streaming operators
00139 *
00140 * Revision 1.2  2002/06/09 15:24:51  loetzsch
00141 * Added TeamMessageCollection and BehaviorTeamMessage to the execute of BehaviorControl
00142 *
00143 * Revision 1.1.1.1  2002/05/10 12:40:13  cvsadm
00144 * Moved GT2002 Project from ute to tamara.
00145 *
00146 * Revision 1.1  2002/05/05 14:05:39  loetzsch
00147 * first draft
00148 *
00149 * Revision 1.1  2002/05/04 17:41:49  loetzsch
00150 * added BehaviorTeamMessage to the Project
00151 *
00152 */

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