BWAPI
|
00001 #ifndef ARBITRATOR_H 00002 #define ARBITRATOR_H 00003 #include "GoalTypes.h" 00004 #include "GoalDescriptor.h" 00005 //#include "AgentPool.h" 00006 #include "BidManager.h" 00007 #include <map> 00008 #include <vector> 00009 #include <algorithm> 00010 class AgentPool; 00011 00012 class Arbitrator { 00013 00014 public: 00015 00016 Arbitrator(AgentPool* p); 00017 ~Arbitrator(); 00018 00019 bool Arbitrator::declareIntention(GoalDescriptor* g); 00020 bool Arbitrator::canDeclareIntention(int g); 00021 void Arbitrator::performInitialArbitraton(); 00022 void Arbitrator::appendSubSet(std::vector<GoalDescriptor*> goals); 00023 void Arbitrator::performArbitraton(); 00024 void Arbitrator::cleanUp(); 00025 std::pair<int,int> Arbitrator::estimateCost(std::vector<GoalDescriptor*> g); 00026 std::vector<GoalDescriptor*> Arbitrator::getExecutingGoals(); 00027 00028 GoalDescriptor* Arbitrator::getWinner(); 00029 GoalDescriptor* winner; 00030 00031 BidManager* Arbitrator::getBidManager(); 00032 00033 std::vector<GoalDescriptor*> Arbitrator::getActiveGoals(); 00034 std::vector<GoalDescriptor*> Arbitrator::getAchievableGoals(); 00035 private: 00036 void Arbitrator::popGoal(GoalDescriptor* goal); 00037 void Arbitrator::pushGoal(GoalDescriptor* goal); 00038 bool isGoalActive(int goal); 00039 AgentPool* agentPool; 00040 BidManager* bidManager; 00041 std::vector<GoalDescriptor*> acceptedGoalSet; 00042 std::vector<GoalDescriptor*> activeGoalSet; 00043 std::vector<GoalDescriptor*> achievableGoalsSet; 00044 00045 }; 00046 00047 00048 00049 #endif