Planner::Planner(std::vector<Action> actions, literals init, literals goal){
_start = new Node(Action("start",literals(), init));
- addNode(_start);
Node* finish = new Node(Action("finish",goal,literals()));
for(vector<Action>::iterator action = actions.begin(); action != actions.end(); ++action){
const literals& preconds = node->action().preconditions();
cerr << "done" << endl;
+ addNode(node);
+
if (preconds.size() == 0){
cerr << "Found no preconds" << endl;
_start->addChild(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;