+bool Node::executed() const{
+ return _executed;
+}
+
+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;
+ for (Literals::const_iterator effect = effects.begin(); effect != effects.end(); ++effect){
+ cerr << "Satisfied effect: " << *effect << endl;
+ _preconditions.erase(_preconditions.find(*effect));
+ }
+ cerr << "Number of preconditions left: " << _preconditions.size() << endl;
+ if(_executed)
+ cerr << "Already executed" << endl;
+ if ((_preconditions.size() != 0) || _executed)
+ return;
+
+ _executed = true;
+ int value = _action->execute();
+ _effects = _action->effects(value);
+
+ cerr << "Got returnvalue: " << value << ", number of effects: " << _effects.size() << endl;