BWAPI
|
00001 #pragma once 00002 #include "BWAPI.h" 00003 #include "Utils/CSingleton.h" 00004 #include "serialized_tables.h" 00005 #include <vector> 00006 #include <set> 00007 #include <string> 00008 #include "Defines.h" 00009 00010 /*** 00011 *********************** 00012 *openingsProba content* 00013 *********************** 00014 |=============| 00015 |Ben's labels:| (extracted with rules) 00016 |=============| 00017 00018 Terran openings, in order (in the vector): 00019 - Bio 00020 - TwoFactory 00021 - VultureHarass 00022 - SiegeExpand 00023 - Standard 00024 - FastDropship 00025 - Unknown 00026 00027 Protoss openings, in order (in the vector): 00028 - FastLegs 00029 - FastDT 00030 - FastObs 00031 - ReaverDrop 00032 - Carrier 00033 - FastExpand 00034 - Unknown 00035 00036 Zerg openings, in order (in the vector): 00037 - TwoHatchMuta 00038 - ThreeHatchMuta 00039 - HydraRush 00040 - Standard 00041 - HydraMass 00042 - Lurker 00043 - Unknown 00044 00045 |==========| 00046 |My labels:| (extracted by clustering) 00047 |==========| 00048 00049 Terran openings, in order (in the vector): 00050 - bio 00051 - rax_fe 00052 - two_facto 00053 - vultures 00054 - drop 00055 - unknown 00056 00057 Protoss openings, in order (in the vector): 00058 - two_gates 00059 - fast_dt 00060 - templar 00061 - speedzeal 00062 - corsair 00063 - nony 00064 - reaver_drop 00065 - unknown 00066 00067 Zerg openings, in order (in the vector): 00068 - fast_mutas 00069 - mutas 00070 - lurkers 00071 - hydras 00072 - unknown 00073 */ 00074 00075 class ETechEstimator : public CSingleton<ETechEstimator> 00076 { 00077 friend class CSingleton<ETechEstimator>; 00078 ETechEstimator(); 00079 ~ETechEstimator(); 00080 serialized_tables st; 00081 std::vector<long double> openingsProbas; // see the big fat comment above 00082 std::set<BWAPI::Unit*> buildingsSeen; 00083 std::set<int> buildingsTypesSeen; 00084 bool notFirstOverlord; 00085 std::set<BWAPI::UnitType> _alreadySawUnitTypes; 00086 inline bool alreadySaw(BWAPI::UnitType ut); 00087 bool insertBuilding(BWAPI::Unit* u); 00088 bool insertBuilding(BWAPI::UnitType ut); 00089 void computeDistribOpenings(int time); 00090 inline void useDistribOpenings(); 00091 inline bool testBuildTreePossible(int indBuildTree, 00092 const std::set<int>& setObs); 00093 public: 00094 const std::vector<long double>& getOpeningsProbas() const; 00095 bool hasInfered; 00096 void onUnitDestroy(BWAPI::Unit* u); 00097 void onUnitShow(BWAPI::Unit* u); 00098 void onUnitHide(BWAPI::Unit* u); 00099 #ifdef __DEBUG__ 00100 void onFrame(); 00101 #endif 00102 };