Skip to content

Commit

Permalink
more generic way to specify count from child nodes size
Browse files Browse the repository at this point in the history
  • Loading branch information
zflat committed Apr 15, 2022
1 parent b176ed9 commit fd4763c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/controls/parallel_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ void ParallelNode::halt()

unsigned int ParallelNode::thresholdM()
{
return success_threshold_ == -1
? children_nodes_.size()
return success_threshold_ < 0
? children_nodes_.size() + success_threshold_ + 1
: success_threshold_;
}

unsigned int ParallelNode::thresholdFM()
{
return failure_threshold_ == -1
? children_nodes_.size()
return failure_threshold_ < 0
? children_nodes_.size() + success_threshold_ + 1
: failure_threshold_;
}

Expand Down

0 comments on commit fd4763c

Please sign in to comment.