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

Tools/DynamicTeamTactic/RateableOptions.h

Go to the documentation of this file.
00001 /**
00002  * @file RateableOptions.h
00003  *
00004  * Declaration of class RateableOptions
00005  * @author <A href=mailto:jochen@kerdels.de>Jochen Kerdels</A>
00006  */
00007 
00008 #ifndef __RateableOptions_h_
00009 #define __RateableOptions_h_
00010 
00011 #include <string.h>
00012 
00013  /**
00014  *  The class contains an enumeration of rateable options
00015  */
00016 class RateableOptions
00017 {
00018 public:
00019 
00020   /**
00021    * Enumerator for available options
00022    * Add new options here.
00023    */
00024   enum OptionID
00025   {
00026     noOption = 0,                  //!<  to disable DynamicTactics and use std. Xabsl 
00027     doNothing,                     //!<  doesn't change the motion request 
00028     stand,                         //!<  standing around... 
00029     keepOption,                    //!<  keeps previous choosen option ...
00030     intro,                         //!<  the oc-intro option
00031     extro,                         //!<  the oc-extro option
00032     finished,                      //!<  the oc-finished option    
00033     gotoBitePos1,                  //!<  dog1 goes to his bite position
00034     gotoBitePos2,                  //!<  dog2 goes to his bite position
00035     gotoBitePos3,                  //!<  dog3 goes to his bite position
00036     gotoBitePos4,                  //!<  dog4 goes to his bite position
00037     bitePos1,                      //!<  dog1 bites at his position
00038     bitePos2,                      //!<  dog2 bites at his position
00039     bitePos3,                      //!<  dog3 bites at his position
00040     bitePos4,                      //!<  dog4 bites at his position 
00041     movePos1,                      //!<  dog1 moves directed by dog 5
00042     movePos2,                      //!<  dog2 moves directed by dog 5
00043     movePos3,                      //!<  dog3 moves directed by dog 5
00044     movePos4,                      //!<  dog4 moves directed by dog 5
00045     gotoBridge,                    //!<  dog5 goes to the bridge
00046     climbBridge,                   //!<  dog5 climbs the bridge
00047     waitForBiteDogs,               //!<  dog5 waits for the others to bite their positions
00048     moveBridge,                    //!<  dog5 directs the other dogs
00049     numOfOptions                   //!< Number of options 
00050   };
00051 
00052   /**
00053    * Enumerator for available options types ... NOT classes
00054    * This is used for the xabsl-interface
00055    */
00056   enum OptionType {
00057     special,
00058     gotoPos,
00059     gotoBallPos,
00060     kickAction,
00061     goalieAction,
00062     notype
00063   };
00064 
00065 
00066   enum OptionClassID
00067   {
00068     doSomething = numOfOptions,
00069     maxOptionClassID,
00070     numOfOptionClasses = maxOptionClassID - numOfOptions //!< Number of optionclasses 
00071   };
00072 
00073   typedef struct {
00074     int        id;
00075     char      *name;
00076     int        numOfSubOptions;
00077     int        changeThreshold;
00078     OptionType optionType;
00079     int        slidingAverageRange;
00080     int        ratingBoost;
00081   } OptionInfo;
00082   
00083   static OptionInfo optionInfos[];
00084  
00085   /**
00086    * Enumerator for available TacticEntryTypes used by GlobalAnalysers
00087    * Add new engines here.
00088    */
00089   enum TacticEntryTypeID {
00090 
00091     FirstTETID = 0,
00092 
00093     // Types for defaultGlobalAnalyser
00094     defGA_Neutral,               // every analyser should offer a neutral type
00095     defGA_Max,
00096 
00097     numOfTETIDs
00098   };
00099 
00100   
00101   /**
00102    * returns names for option and option class ids
00103    */
00104   static const char* getOptionName(int id);
00105   static int         getOptionID(const char*  name);
00106   static OptionType  getOptionType(int id);
00107   static int         getSlidingAverageRange(int id);
00108   static int         getRatingBoost(int id);
00109 
00110   /**
00111    * The following two functions represent the members
00112    * of a OptionClass.. kind of a hack, i know..
00113    */
00114   static int         getNumberOfClassMembers(OptionClassID id);
00115   static int         getOptionClassChangeThreshold(OptionClassID id);
00116   static OptionID    getClassMember(OptionClassID id, int idx);
00117   
00118   static bool        isOptionClass(int id);
00119   static bool        isClassMember(OptionClassID OCid, OptionID Oid);
00120 
00121   /**
00122    * Enumerator for available OptionRating engines
00123    * Add new engines here.
00124    */
00125   enum OptionRatingID
00126   {
00127     defaultOptionRating = 0, //!< default engine
00128     numOfOptionRatings       //!< Number of engines
00129   };
00130 
00131   /**
00132    * Enumerator for available TacticChooser engines
00133    * Add new engines here.
00134    */
00135   enum TacticChooserID
00136   {
00137     defaultTacticChooser = 0, //!< default engine 
00138     numOfTacticChoosers       //!< Number of engines 
00139   };
00140 
00141 
00142 
00143   /**
00144    * Enumerator for available GlobalAnalyser engines
00145    * Add new engines here.
00146    */
00147   enum GlobalAnalyserID
00148   {
00149     defaultGlobalAnalyser = 0, //!< default engine
00150     numOfGlobalAnalysers       //!< Number of engines 
00151   };
00152 
00153   /**
00154    * returns names of a TETID
00155    * Add new IDs here
00156    */
00157   static const char* getTETIDName(TacticEntryTypeID id)
00158   {
00159     switch (id) {
00160       case defGA_Neutral        : return "Neutral";
00161       default: return "please edit RateableOptions::getTETIDName";
00162     }
00163   }
00164 
00165   /** 
00166    * returns names of GlobalAnalysers engines
00167    * Add new engines here
00168    */
00169   static const char* getGlobalAnalyserName(GlobalAnalyserID id)
00170   {
00171     switch (id)
00172     {
00173       case defaultGlobalAnalyser       : return "DefGlobalAnalyser";
00174       default: return "please edit RateableOptions::getGlobalAnalyserName";
00175     }
00176   }
00177 
00178   /** returns the base index of TETIDs of a GlobalAnalysers engine
00179    * Add new engines here
00180    */
00181   static int getGlobalAnalyserTETBase(GlobalAnalyserID id)
00182   {
00183     switch (id)  {
00184       case defaultGlobalAnalyser : return (int)defGA_Neutral;
00185       default: return -1;
00186     }
00187   }
00188 
00189   /** returns the TETID Count of a GlobalAnalysers engine
00190    * Add new engines here
00191    */
00192   static int getGlobalAnalyserTETCount(GlobalAnalyserID id)
00193   {
00194     switch (id)  {
00195       case defaultGlobalAnalyser : return ((int)defGA_Max - (int)defGA_Neutral);
00196       default: return -1;
00197     }
00198   }
00199 
00200   /** returns the neutral TETID of a GlobalAnalysers engine
00201    * Add new engines here
00202    */
00203   static TacticEntryTypeID getGlobalAnalyserNeutralTETID(GlobalAnalyserID id)
00204   {
00205     switch (id) {
00206       case defaultGlobalAnalyser : return defGA_Neutral;
00207       default: return FirstTETID;
00208     }
00209   }
00210 
00211   /**
00212    * returns ids for TETID names
00213    * Add new IDs here
00214    */
00215   static TacticEntryTypeID getTETID(GlobalAnalyserID id, const char*  name)
00216   {
00217     switch (id) {
00218       case defaultGlobalAnalyser: {
00219         if (strcmp(name, "Neutral") == 0)
00220           return defGA_Neutral;
00221         else
00222           return FirstTETID;
00223                            } break;
00224 
00225       default: return FirstTETID;
00226     }
00227   }
00228 
00229 };
00230 
00231 #endif //__RateableOptions_h_
00232 
00233 /*
00234  * Change log :
00235  * $Log: RateableOptions.h,v $
00236  * Revision 1.3  2004/07/22 22:38:34  kerdels
00237  * added DTT used by Open Challenge, RIP and Xabsl-Options will follow
00238  *
00239  *
00240  */

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