Go to the documentation of this file.00001 #ifndef PLANNER_INTERFACE_H
00002 #define PLANNER_INTERFACE_H
00003
00004 #include <string>
00005 #include <vector>
00006 #include "continual_planning_executive/plan.h"
00007 #include "continual_planning_executive/symbolicState.h"
00008
00009 namespace continual_planning_executive
00010 {
00011
00013 class PlannerInterface
00014 {
00015 public:
00016 enum PlannerResult {
00017 PR_SUCCESS,
00018 PR_SUCCESS_TIMEOUT,
00019 PR_FAILURE_TIMEOUT,
00020 PR_FAILURE_UNREACHABLE,
00021 PR_FAILURE_OTHER,
00022 };
00023
00025 PlannerInterface() {}
00026 virtual ~PlannerInterface() {}
00027
00029
00033 virtual void initialize(const std::string & domainFile, const std::vector<std::string> & options) = 0;
00034
00036
00041 virtual PlannerResult plan(const SymbolicState & init, const SymbolicState & goal, Plan & plan) = 0;
00042
00044
00049 virtual PlannerResult monitor(const SymbolicState & init, const SymbolicState & goal, const Plan & plan) = 0;
00050
00051 virtual void setTimeout(double secs) = 0;
00052
00053 static std::string PlannerResultStr(enum PlannerResult pr);
00054 };
00055
00056 inline std::string PlannerInterface::PlannerResultStr(enum PlannerResult pr)
00057 {
00058 switch(pr) {
00059 case PR_SUCCESS:
00060 return "PR_SUCCESS";
00061 case PR_SUCCESS_TIMEOUT:
00062 return "PR_SUCCESS_TIMEOUT";
00063 case PR_FAILURE_TIMEOUT:
00064 return "PR_FAILURE_TIMEOUT";
00065 case PR_FAILURE_UNREACHABLE:
00066 return "PR_FAILURE_UNREACHABLE";
00067 case PR_FAILURE_OTHER:
00068 return "PR_FAILURE_OTHER";
00069 }
00070 return "INVALID PLANNER RESULT";
00071 }
00072
00073 };
00074
00075 #endif
00076