Clingo.h
Go to the documentation of this file.
00001 
00002 #ifndef actasp_Clingo_h__guard
00003 #define actasp_Clingo_h__guard
00004 
00005 #include <actasp/AspKR.h>
00006 #include <actasp/MultiPolicy.h>
00007 
00008 #include <string>
00009 #include <vector>
00010 #include <map>
00011 #include <memory>
00012 #include <stdexcept>
00013 #include <set>
00014 
00015 namespace actasp {
00016 
00017 class Action;
00018 
00019 class Clingo : public AspKR {
00020 public:
00021 
00022         Clingo(unsigned int max_n,
00023          const std::string& incrementalVar,
00024                const std::string& queryDir,
00025                const std::string& domainDir,
00026                const ActionSet& actions,
00027          unsigned int max_time = 0
00028         ) throw();
00029 
00030   ActionSet availableActions() const throw();
00031         
00032         AnswerSet currentStateQuery(const std::vector<actasp::AspRule>& query) const throw();
00033         
00034         bool updateFluents(const std::vector<actasp::AspFluent> &observations) throw();
00035   
00036   std::list< std::list<AspAtom> > query(const std::string &queryString, unsigned int initialTimeStep,
00037                                    unsigned int finalTimeStep) const throw();
00038         
00039         bool isPlanValid(const AnswerSet& plan, const std::vector<actasp::AspRule>& goal)  const throw();
00040   
00041   void reset() throw();
00042 
00043         AnswerSet computePlan(const std::vector<actasp::AspRule>& goal) const throw ();
00044         
00045         std::vector< AnswerSet> computeAllPlans(const std::vector<actasp::AspRule>& goal, double suboptimality) const throw ();
00046         
00047         MultiPolicy computePolicy(const std::vector<actasp::AspRule>& goal, double suboptimality) const throw (std::logic_error);
00048         
00049         void setMaxTimeStep(unsigned int max_n) throw() {
00050                 this->max_n = max_n;
00051   }
00052 
00053 private:
00054 
00055         unsigned int max_n;
00056   std::string incrementalVar;
00057   unsigned int max_time;
00058         std::string queryDir;
00059         std::string domainDir;
00060   ActionSet allActions;
00061   std::string actionFilter;
00062 
00063         std::string generatePlanQuery(  const std::vector<actasp::AspRule>& goalRules,
00064                                                                         bool filterActions) const throw();
00065 
00066         std::list<actasp::AnswerSet> krQuery(   const std::string& query, 
00067                                                                                         unsigned int initialTimeStep,
00068                       unsigned int finalTimeStep,
00069                                                                                         const std::string& fileName, 
00070                                                                                         unsigned int answerSetsNumber) const throw();
00071                       
00072 
00073 };
00074 
00075 }
00076 #endif


bwi_kr_execution
Author(s): Matteo Leonetti, Piyush Khandelwal
autogenerated on Fri Aug 28 2015 10:14:46