From 895d43297511597e9d8734c0fd5ba534f551de5f Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Mon, 9 May 2005 10:44:55 +0000 Subject: [PATCH] moved addNode --- planner.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/planner.cpp b/planner.cpp index 6d70ae4..1210d04 100644 --- a/planner.cpp +++ b/planner.cpp @@ -7,7 +7,6 @@ using namespace __gnu_cxx; Planner::Planner(std::vector actions, literals init, literals goal){ _start = new Node(Action("start",literals(), init)); - addNode(_start); Node* finish = new Node(Action("finish",goal,literals())); for(vector::iterator action = actions.begin(); action != actions.end(); ++action){ @@ -33,6 +32,8 @@ void Planner::makePlan(Node* node){ const literals& preconds = node->action().preconditions(); cerr << "done" << endl; + addNode(node); + if (preconds.size() == 0){ cerr << "Found no preconds" << endl; _start->addChild(node); @@ -49,7 +50,6 @@ void Planner::makePlan(Node* node){ cerr << "Adding new node" << endl; Node* newnode = new Node(action->second); newnode->addChild(node); - addNode(newnode); makePlan(newnode); }else{ cerr << "Action with effect: " << *precond << " not found!" << endl; -- 2.39.2