]> ruin.nu Git - popboot.git/commitdiff
small change
authorMichael Andreen <harv@ruin.nu>
Wed, 18 May 2005 16:04:25 +0000 (16:04 +0000)
committerMichael Andreen <harv@ruin.nu>
Wed, 18 May 2005 16:04:25 +0000 (16:04 +0000)
input.txt
node.cpp
node.h
planner.cpp

index 9bfc0c0a95b3a9b0ad8c940a6e0e9c8c5a828261..26792d30e02b1c4f65260ddcb6a1dde6622d261b 100644 (file)
--- a/input.txt
+++ b/input.txt
@@ -9,7 +9,7 @@ httpd.sh
 #32 
 #dasdssad
 eth0
-"1"
+A # test 
 "ifconfig up eth0"
 0: NET # kommentar
 
index 9bedf3834d34c4786dddbd46354f4879af759f07..1efdf6a03199e01f882e27e4d4d7de499f01a27b 100644 (file)
--- a/node.cpp
+++ b/node.cpp
@@ -34,11 +34,11 @@ const Literals& Node::effects() const{
        return _effects;
 }
 
-void Node::execute(bool strict, const Literals& effects){
+void Node::execute(const Literals& effects){
        for (Literals::const_iterator effect = effects.begin(); effect != effects.end(); ++effect){
                _preconditions.erase(_preconditions.find(*effect));
        }
-       if ((_preconditions.size() != 0 && strict) || _executed)
+       if ((_preconditions.size() != 0) || _executed)
                return;
 
        if (_preconditions.size() != 0){
@@ -53,7 +53,7 @@ void Node::execute(bool strict, const Literals& effects){
        _effects = _action.effects(value);
 
        for(vector<Node*>::iterator child = _children.begin(); child != _children.end(); ++child){
-               (*child)->execute(strict,effects);
+               (*child)->execute(effects);
        }
 }
 
diff --git a/node.h b/node.h
index 28a828728e9109a73181baf6fde79d98198ed908..b49d0109ee042005010a2bae4eb455395db8b57c 100644 (file)
--- a/node.h
+++ b/node.h
@@ -14,7 +14,7 @@ class Node {
                virtual ~Node(){}
                void addChild(Node* node);
                const Action& action() const;
-               void execute(bool strict, const Literals& effects);
+               void execute(const Literals& effects);
                bool executed() const;
                const Literals& effects() const;
 
index 884567dea5c4329e43b6d0020bd05bd5c12af1fc..d49fb911beb267aa1b7005a8bdd9a729b84f2e22 100644 (file)
@@ -82,9 +82,9 @@ void Planner::addNode(Node* node){
 
 
 void Planner::execute(){
-       _start->execute(true,Literals());
+       _start->execute(Literals());
        /*for (hash_map<string,Node*>::iterator node = _addedNodes.begin(); node != _addedNodes.end(); ++node){
                if (node->second->executed()){
        }*/
-       _start->execute(false,Literals());
+       _start->execute(Literals());
 }