47 size_t success_childred_num = 0;
48 size_t failure_childred_num = 0;
54 throw LogicError(
"Number of children is less than threshold. Can never suceed.");
58 for (
unsigned int i = 0; i < children_count; i++)
62 bool in_skip_list = (
skip_list_.count(i) != 0);
67 child_status = child_node->
status();
81 success_childred_num++;
97 failure_childred_num++;
99 if (failure_childred_num > children_count -
threshold_)
114 throw LogicError(
"A child node must never return IDLE");
unsigned int thresholdM()
const std::string & name() const
Name of the instance, not the type.
std::vector< TreeNode * > children_nodes_
const NodeConfiguration & config() const
virtual void halt() override
std::set< int > skip_list_
static constexpr const char * THRESHOLD_KEY
bool read_parameter_from_ports_
void setThresholdM(unsigned int threshold_M)
virtual void halt() override
Result getInput(const std::string &key, T &destination) const
Abstract base class for Behavior Tree Nodes.
void haltChildren(unsigned i)
call halt() for all the children in the range [i, childrenCount() )
void setRegistrationID(StringView ID)
ParallelNode(const std::string &name, unsigned threshold)
NodeStatus status() const
virtual BT::NodeStatus tick() override
Method to be implemented by the user.
virtual BT::NodeStatus executeTick()
The method that should be used to invoke tick() and setStatus();.