Go to the documentation of this file.00001
00002 #ifndef actasp_Clingo4_2_h__guard
00003 #define actasp_Clingo4_2_h__guard
00004
00005 #include <actasp/FilteringQueryGenerator.h>
00006
00007 namespace actasp {
00008
00009 struct Clingo4_2 : public FilteringQueryGenerator {
00010
00011 Clingo4_2(const std::string& incrementalVar,
00012 const std::string& queryDir,
00013 const std::string& domainDir,
00014 const ActionSet& actions,
00015 unsigned int max_time = 0
00016 ) throw();
00017
00018 Clingo4_2(const std::string& incrementalVar,
00019 const std::string& queryDir,
00020 const std::string& domainDir,
00021 const ActionSet& actions,
00022 const std::string& currentFilePath,
00023 unsigned int max_time = 0
00024 ) throw();
00025
00026 std::list<actasp::AnswerSet> minimalPlanQuery(const std::vector<actasp::AspRule>& goalRules,
00027 bool filterActions,
00028 unsigned int max_plan_length,
00029 unsigned int answerset_number) const throw();
00030
00031 std::list<actasp::AnswerSet> lengthRangePlanQuery(const std::vector<actasp::AspRule>& goalRules,
00032 bool filterActions,
00033 unsigned int min_plan_length,
00034 unsigned int max_plan_length,
00035 unsigned int answerset_number) const throw();
00036
00037 actasp::AnswerSet optimalPlanQuery(const std::vector<actasp::AspRule>& goalRules,
00038 bool filterActions,
00039 unsigned int max_plan_length,
00040 unsigned int answerset_number,
00041 bool minimum) const throw();
00042
00043 std::list<actasp::AnswerSet> monitorQuery(const std::vector<actasp::AspRule>& goalRules,
00044 const AnswerSet& plan) const throw();
00045
00046
00047 AnswerSet currentStateQuery(const std::vector<actasp::AspRule>& query) const throw();
00048
00049 void setCurrentState(const std::set<actasp::AspFluent>& newState);
00050
00051 std::list<actasp::AnswerSet> filteringQuery(const AnswerSet& currentState, const AnswerSet& plan,const std::vector<actasp::AspRule>& goals);
00052
00053 std::list<actasp::AnswerSet> genericQuery(const std::vector<actasp::AspRule>& query,
00054 unsigned int timestep,
00055 const std::string& fileName,
00056 unsigned int answerSetsNumber) const throw();
00057
00058 std::list< std::list<AspAtom> > genericQuery(const std::string& query,
00059 unsigned int timestep,
00060 const std::string& fileName,
00061 unsigned int answerSetsNumber) const throw();
00062
00063 private:
00064
00065 std::list<actasp::AnswerSet> genericQuery(const std::string& query,
00066 unsigned int initialTimeStep,
00067 unsigned int finalTimeStep,
00068 const std::string& fileName,
00069 unsigned int answerSetsNumber,
00070 bool useCurrentState) const throw();
00071
00072 std::string makeQuery(const std::string& query,
00073 unsigned int initialTimeStep,
00074 unsigned int finalTimeStep,
00075 const std::string& fileName,
00076 unsigned int answerSetsNumber,
00077 bool useCurrentState
00078 ) const throw();
00079
00080 std::string generatePlanQuery(std::vector<actasp::AspRule> goalRules) const throw();
00081
00082 std::string generateMonitorQuery(const std::vector<actasp::AspRule>& goalRules, const AnswerSet& plan) const throw();
00083
00084 std::string incrementalVar;
00085 ActionSet allActions;
00086 unsigned int max_time;
00087 std::string queryDir;
00088 std::string domainDir;
00089 std::string currentFilePath;
00090
00091 };
00092
00093 }
00094
00095 #endif