]> ruin.nu Git - popboot.git/blobdiff - planner.cpp
only execute an action when all preconditions are are true
[popboot.git] / planner.cpp
index b675ce061f6f8b29a3e0ee0352548616ab22e715..a15028e29a3175e8fa316e2e6e6a37e2dc41194f 100644 (file)
@@ -6,9 +6,9 @@ using namespace __gnu_cxx;
 
 Planner::Planner(std::vector<Action> actions, literals init, literals goal){
 
-       _start = new Node(Action("",literals(), init));
+       _start = new Node(Action("start",literals(), init));
        addNode(_start);
-       Node* finish = new Node(Action("",goal,literals()));
+       Node* finish = new Node(Action("finish",goal,literals()));
 
        for(vector<Action>::iterator action = actions.begin(); action != actions.end(); ++action){
                literals effects = action->effects();
@@ -58,3 +58,8 @@ void Planner::addNode(Node* node){
                _addedNodes[*effect] = node;
        }
 }
+
+
+void Planner::execute(){
+       _start->execute(literals());
+}