25 int failure_threshold) :
56 size_t success_childred_num = 0;
57 size_t failure_childred_num = 0;
63 throw LogicError(
"Number of children is less than threshold. Can never succeed.");
68 throw LogicError(
"Number of children is less than threshold. Can never fail.");
72 for (
unsigned int i = 0; i < children_count; i++)
76 bool in_skip_list = (
skip_list_.count(i) != 0);
81 child_status = child_node->
status();
95 success_childred_num++;
111 failure_childred_num++;
131 throw LogicError(
"A child node must never return IDLE");
size_t failureThreshold() const
std::vector< TreeNode * > children_nodes_
virtual void halt() override
const NodeConfiguration & config() const
NodeStatus status() const
static constexpr const char * THRESHOLD_SUCCESS
ParallelNode(const std::string &name, int success_threshold, int failure_threshold=1)
static constexpr const char * THRESHOLD_FAILURE
const std::string & name() const
Name of the instance, not the type.
std::set< int > skip_list_
bool read_parameter_from_ports_
void setSuccessThreshold(int threshold_M)
Result getInput(const std::string &key, T &destination) const
virtual void halt() override
Abstract base class for Behavior Tree Nodes.
void setFailureThreshold(int threshold_M)
void setRegistrationID(StringView ID)
size_t successThreshold() 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();.