pddl_planner
PDDLPlannerTypes.hpp
Go to the documentation of this file.
1 #ifndef PDDL_PLANNER_TYPES
2 #define PDDL_PLANNER_TYPES
3 
4 #include <string>
5 #include <vector>
6 #include <sstream>
7 #include <stdexcept>
8 #include <boost/algorithm/string.hpp>
9 
10 namespace pddl_planner
11 {
12  class PlanGenerationException : public std::runtime_error
13  {
14  public:
15  PlanGenerationException(const std::string& msg) : std::runtime_error("PlanGenerationException: " + msg)
16  {}
17 
18  PlanGenerationException() : std::runtime_error("PlanGenerationException")
19  {}
20  };
21 
22  struct Action
23  {
24  // name of action
25  std::string name;
26  // arguments of this action
27  std::vector<std::string> arguments;
28 
33  Action(const std::string& name ="");
34 
39  void addArgument(const std::string& argument);
40 
45  std::string toString() const;
46  };
47 
48  // Plan as a sequence of actions
49  struct Plan
50  {
51  std::vector<Action> action_sequence;
52 
57  void addAction(const Action& action);
58 
63  std::string toString() const;
64  };
65 
67  {
68  std::vector<Plan> plans;
69 
74  void addPlan(const Plan& plan);
75 
80  std::string toString() const;
81  };
82 
83 
84 }
85 #endif // PDDL_PLANNER_TYPES
std::string name
Definition: PDDLPlannerTypes.hpp:25
Definition: PDDLPlannerTypes.hpp:49
std::vector< Action > action_sequence
Definition: PDDLPlannerTypes.hpp:51
Definition: Debug.hpp:10
PlanGenerationException(const std::string &msg)
Definition: PDDLPlannerTypes.hpp:15
Definition: PDDLPlannerInterface.cpp:18
Definition: PDDLPlannerTypes.hpp:66
std::vector< std::string > arguments
Definition: PDDLPlannerTypes.hpp:27
std::vector< Plan > plans
Definition: PDDLPlannerTypes.hpp:68
PlanGenerationException()
Definition: PDDLPlannerTypes.hpp:18
Definition: PDDLPlannerTypes.hpp:12
Definition: PDDLPlannerTypes.hpp:22