X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=blobdiff_plain;f=node.h;h=cbe17348aa103a1befce5a11baca11391b28f424;hp=7bcf3a8c371338375df7d42604ce5d0ddf98ce74;hb=a1941ebc8535c578f0989f847794917096274f8e;hpb=e26fd7b3195576b25ffe51253a391b53f412a650 diff --git a/node.h b/node.h index 7bcf3a8..cbe1734 100644 --- a/node.h +++ b/node.h @@ -2,20 +2,44 @@ #define __node_h__ #include +#include #include "action.h" class Node { public: - Node(Action action); + Node(const Action* action); + Node(); + Node(const Node& node); + virtual ~Node(){} void addChild(Node* node); - const Action& action() const; - void execute(const literals& effects); + const Action* action() const; + void execute(); + bool executed() const; + const Literals& effects() const; + bool satisfyCondition(std::string effect); + bool satisfyConditions(const Literals& effects); + const std::vector& children() const; + const Preconditions& preconditions() const; protected: - Action _action; + const Action* _action; std::vector _children; - literals _preconditions; + 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