00001 /** 00002 * @file PassCorridorCollection.h 00003 * 00004 * The file contains the definition of the class PassCorridorCollection. 00005 * 00006 * @author <A href=mailto:marc.dassler@web.de>Marc Dassler</A> 00007 */ 00008 00009 #ifndef __PassCorridorCollection_h_ 00010 #define __PassCorridorCollection_h_ 00011 00012 #include "Tools/Streams/InOut.h" 00013 #include "Tools/Player.h" 00014 00015 /** 00016 * @class PassCorridor 00017 */ 00018 class PassCorridor 00019 { 00020 00021 public: 00022 /** 00023 * Constructor. 00024 */ 00025 PassCorridor() {} 00026 00027 void reset(); 00028 00029 /** 00030 * Index of the Player to whom the pass corridor belongs 00031 */ 00032 int playerPoseIndex; 00033 00034 Player::playerNumber playerNumber; 00035 00036 /** 00037 * Opening Angle of the Corridor. In this area is non opponent player 00038 * This name is missleading. The real opening angle is double the size 00039 * of this one. 00040 */ 00041 double openingAngle; 00042 00043 /** 00044 * Distance to the player 00045 */ 00046 double distance; 00047 00048 /** 00049 * Orthogonal distance of the pass way to the nearst opponent player 00050 */ 00051 double distanceToOppPlayer; 00052 00053 /** 00054 * Rate of the pass 00055 */ 00056 double rate; 00057 double rateDistanceToPartner, 00058 rateDistanceWin, 00059 rateDistanceBorderLine, 00060 rateWidthOfCorridor, 00061 rateAngleToPartner; 00062 }; 00063 00064 /** 00065 * Streaming operator that reads a pass corridor from a stream. 00066 * @param stream The stream from which is read. 00067 * @param passCorridor The pass corridor object. 00068 * @return The stream. 00069 */ 00070 In& operator>>(In& stream,PassCorridor& passCorridor); 00071 00072 00073 /** 00074 * Streaming operator that writes a pass corridor to a stream. 00075 * @param stream The stream to write on. 00076 * @param passCorridor The pass corridor object. 00077 * @return The stream. 00078 */ 00079 Out& operator<<(Out& stream, const PassCorridor& passCorridor); 00080 00081 /** 00082 * @class PassCorridorCollection 00083 */ 00084 class PassCorridorCollection 00085 { 00086 public: 00087 /** 00088 * Constructor 00089 */ 00090 PassCorridorCollection(); 00091 00092 /** 00093 * Reset all pass corridors 00094 */ 00095 void reset(); 00096 00097 /** 00098 * Finds the best pass corridor 00099 * @return found or not found 00100 */ 00101 bool findBestPassCorridor(); 00102 00103 /** 00104 * Number of inhabited pass corridors 00105 */ 00106 int numberOfPassCorridors; 00107 00108 /** 00109 * The index of the best pass corridor 00110 */ 00111 int bestPassCorridorIndex; 00112 00113 /** 00114 * Returns Quality of the best pass corridor 00115 */ 00116 const double getBestPassCorridorQuality() const; 00117 00118 PassCorridor* bestPassCorridor; 00119 /** 00120 * The corridors 00121 */ 00122 PassCorridor passCorridors[4]; 00123 00124 /** 00125 * This var should be a constant 00126 */ 00127 double maxPassCorridorRate; 00128 }; 00129 /** 00130 * Streaming operator that reads a pass corridor collection from a stream. 00131 * @param stream The stream from which is read. 00132 * @param passCorridorCollection The pass corridor object. 00133 * @return The stream. 00134 */ 00135 In& operator>>(In& stream,PassCorridorCollection& passCorridorCollection); 00136 /** 00137 * Streaming operator that writes a pass corridor collection to a stream. 00138 * @param stream The stream to write on. 00139 * @param passCorridorCollection The pass corridor object. 00140 * @return The stream. 00141 */ 00142 Out& operator<<(Out& stream, const PassCorridorCollection& passCorridorCollection); 00143 #endif //__PassCorridorCollection_h_
1.3.6