From: Michael Andreen Date: Thu, 19 May 2005 11:03:10 +0000 (+0000) Subject: removing unsatisfiable soft conditions X-Git-Url: https://ruin.nu/git/?p=popboot.git;a=commitdiff_plain;h=dc4211bc1dc77ba3f1a71ec5737c61731614004b removing unsatisfiable soft conditions --- diff --git a/input.txt b/input.txt index fb943a8..2f52d14 100644 --- a/input.txt +++ b/input.txt @@ -8,7 +8,7 @@ # kommenatar apache -NET +NET, ?LOGGER httpd.sh 0: HTTPD, APACHE # kommentar diff --git a/node.cpp b/node.cpp index 899f38b..fb1c314 100644 --- a/node.cpp +++ b/node.cpp @@ -34,6 +34,9 @@ bool Node::executed() const{ const Literals& Node::effects() const{ return _effects; } +void Node::satisfyCondition(std::string effect){ + _preconditions.erase(_preconditions.find(effect)); +} void Node::execute(const Literals& effects){ cerr << "Executing: " << _action.name() << endl; diff --git a/node.h b/node.h index b49d010..77a9d7b 100644 --- a/node.h +++ b/node.h @@ -17,6 +17,7 @@ class Node { void execute(const Literals& effects); bool executed() const; const Literals& effects() const; + void satisfyCondition(std::string effect); protected: Action _action; diff --git a/planner.cpp b/planner.cpp index 10f5e57..747f351 100644 --- a/planner.cpp +++ b/planner.cpp @@ -63,6 +63,7 @@ void Planner::makePlan(Node* node){ }else{ cerr << "Action with effect: " << precond->first << " not found!" << endl; cerr << "This is a soft precondition, so we will continue" << endl; + node->satisfyCondition(precond->first); } } }