00001 00002 #ifndef bwi_krexec_RemoteReasoner_h__guard 00003 #define bwi_krexec_RemoteReasoner_h__guard 00004 00005 #include "actasp/AspAtom.h" 00006 #include "actasp/AspKR.h" 00007 #include "actasp/reasoners/Reasoner.h" 00008 #include <actasp/reasoners/FilteringReasoner.h> 00009 #include <actasp/FilteringQueryGenerator.h> 00010 00011 namespace bwi_krexec { 00012 00013 class RemoteReasoner : public actasp::FilteringKR { 00014 public: 00015 00016 RemoteReasoner(actasp::FilteringQueryGenerator *actualReasoner,unsigned int max_n,const actasp::ActionSet& allActions); 00017 00018 actasp::ActionSet availableActions() const throw(); 00019 00020 actasp::AnswerSet currentStateQuery(const std::vector<actasp::AspRule>& query) const throw(); 00021 00022 bool updateFluents(const std::vector<actasp::AspFluent> &observations) throw(); 00023 00024 bool isPlanValid(const actasp::AnswerSet& plan, const std::vector<actasp::AspRule>& goal) const throw(); 00025 00026 std::vector< actasp::AnswerSet > computeAllPlans(const std::vector<actasp::AspRule>& goal, double suboptimality) const throw (std::logic_error); 00027 00028 void resetCurrentState() throw(); 00029 00030 actasp::AnswerSet computePlan(const std::vector<actasp::AspRule>& goal) const throw (std::logic_error); 00031 00032 actasp::GraphPolicy* computePolicy(const std::vector<actasp::AspRule>& goal, double suboptimality) const throw (std::logic_error); 00033 00034 actasp::AnswerSet filterState(const std::vector<actasp::AnswerSet>& plans, const std::vector<actasp::AspRule>& goals); 00035 00036 std::list< std::list<actasp::AspAtom> > query(const std::string &queryString, unsigned int timeStep) const throw(); 00037 00038 private: 00039 actasp::FilteringReasoner local; 00040 00041 }; 00042 } 00043 00044 #endif