#define __node_h__
#include <vector>
+#include <utility>
#include "action.h"
class Node {
- Node(Action action, std::vector<Node&> children);
-
- addChild(Node& node);
+ public:
+ Node(const Action* action);
+ Node();
+ Node(const Node& node);
+ virtual ~Node(){}
+ void addChild(Node* node);
+ const Action* action() const;
+ void execute(const Literals& effects);
+ bool executed() const;
+ const Literals& effects() const;
+ void satisfyCondition(std::string effect);
protected:
- Action _action;
- std::vector<Node&> _children;
+ const Action* _action;
+ std::vector<Node*> _children;
+ Preconditions _preconditions;
+ bool _executed;
+ Literals _effects;
+};
+
+class StartNode :public Node {
+ public:
+ StartNode(const Literals& init);
+ ~StartNode(){delete _action;}
+};
+
+class EndNode :public Node {
+ public:
+ EndNode(const Literals& goal);
+ ~EndNode(){delete _action;}
};
#endif