9 * A node in the plan graph, corresponds to a single action.
15 * Creates a node for the given action.
17 Node(const Action* action);
20 * Creates an empty, non-functional, node.
25 * Creates a copy of the given node.
27 Node(const Node& node);
31 * Add a child node, which will be executed after this node.
33 void addChild(Node* node);
36 * Returns the action this node corresponds to.
38 const Action* action() const;
41 * Execute this node, and hence the corresponding action.
42 * Sets the effects achieved.
44 * If _executed is true or _preconditions.size() > 0 this method will
50 * Checks if this node has been executed or not.
52 bool executed() const;
55 * Returns the effects that was achieved from execution.
57 const Literals& effects() const;
60 * Satisfy a single condition.
62 bool satisfyCondition(std::string effect);
65 * Satisfies a list of conditions.
67 bool satisfyConditions(const Literals& effects);
70 * Returns all the children to this node.
72 const std::vector<Node*>& children() const;
75 * Returns the unsatisfied preconditions.
77 const Preconditions& preconditions() const;
80 //! The action this node corresponds to.
81 const Action* _action;
82 //! The list of children to this node.
83 std::vector<Node*> _children;
84 //! The, so far, unsatisfied preconditions.
85 Preconditions _preconditions;
86 //! Will be true if this node has been executed.
88 //! The effects which were achieved by the execution.
93 * Class which is used as the start node in the plan graph.
95 class StartNode :public Node {
97 StartNode(const Literals& init);
98 ~StartNode(){delete _action;}
102 * Class which is used as the end node in the plan graph.
104 class EndNode :public Node {
106 EndNode(const Literals& goal);
107 ~EndNode(){delete _action;}