3 #ifndef _COMPOSITE_SEQUENTIAL_NODE_CPP 4 #define _COMPOSITE_SEQUENTIAL_NODE_CPP 6 #ifndef _MADARA_NO_KARL_ 37 for (ComponentNodes::iterator i =
nodes_.begin ();
38 i !=
nodes_.end (); ++i, ++j)
40 bool value_changes =
false;
42 value = (*i)->prune (value_changes);
43 if (!value_changes && dynamic_cast <LeafNode *> (*i) == 0)
49 if (j == 0 || value < return_value)
52 can_change = can_change || value_changes;
68 for (ComponentNodes::iterator i =
nodes_.begin ();
69 i !=
nodes_.end (); ++i, ++j)
73 if (j == 0 || value < return_value)
84 visitor.
visit (*
this);
87 #endif // _MADARA_NO_KARL_ This class encapsulates an entry in a KnowledgeBase.
virtual void accept(Visitor &visitor) const
Accepts a visitor subclassed from the Visitor class.
madara::knowledge::KnowledgeRecord KnowledgeRecord
std::deque< ComponentNode * > ComponentNodes
a vector of Component Nodes
virtual madara::knowledge::KnowledgeRecord item(void) const
Returns the printable character of the node.
logger::Logger * logger_
handle the context
Defines a node that contains a madara::knowledge::KnowledgeRecord::Integer value. ...
Provides knowledge logging services to files and terminals.
A multi-threaded logger for logging to one or more destinations.
Abstract base class for all visitors to all classes that derive from ComponentNode.
virtual madara::knowledge::KnowledgeRecord prune(bool &can_change)
Prunes the expression tree of unnecessary nodes.
Settings for applying knowledge updates.
virtual void visit(const LeafNode &node)=0
Visit a LeafNode.
Copyright (c) 2015 Carnegie Mellon University.
virtual madara::knowledge::KnowledgeRecord evaluate(const madara::knowledge::KnowledgeUpdateSettings &settings)
Evaluates the node.
CompositeSequentialNode(logger::Logger &logger, const ComponentNodes &nodes)
Constructor.