From dd978b636c2ea409b7b5e013930a0662c4aec9bd Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Tue, 26 Sep 2023 15:05:37 +0200 Subject: [PATCH] Add class doc for BTProbabilitySelector --- doc_classes/BTProbabilitySelector.xml | 59 +++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 doc_classes/BTProbabilitySelector.xml diff --git a/doc_classes/BTProbabilitySelector.xml b/doc_classes/BTProbabilitySelector.xml new file mode 100644 index 0000000..3eb00c9 --- /dev/null +++ b/doc_classes/BTProbabilitySelector.xml @@ -0,0 +1,59 @@ + + + + BT composite that chooses a child task to execute based on attached probabilities. + + + BTProbabilitySelector chooses a child task to execute based on attached probabilities. It is typically used for decision-making purposes. Probability distribution is calculated based on weights assigned to each child task. + Returns [code]SUCCESS[/code] when a child task returns [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] when a child task returns [code]RUNNING[/code]. + The behavior of BTProbabilitySelector when a child task results in [code]FAILURE[/code] depends on the value of the [member abort_on_failure] property: + - If [member abort_on_failure] is [code]false[/code], when a child task results in [code]FAILURE[/code], BTProbabilitySelector will normalize the probability distribution over the remaiming children and choose a new child task to be executed. If all child tasks fail, the composite will return [code]FAILURE[/code]. + - If [member abort_on_failure] is [code]true[/code], when a child task results in [code]FAILURE[/code], BTProbabilitySelector will not choose another child task to be executed and will immediately return [code]FAILURE[/code]. + + + + + + + + + Returns the child task's selection probability. + + + + + + Returns the total weight of all child tasks. + + + + + + + Returns the child task's weight within the weighted probability selection algorithm. + + + + + + + + Sets the child task's weight calculated based on the desired probability. + + + + + + + + Sets the child task's weight for the weighted probability selection algorithm. + + + + + + If [code]true[/code], BTProbabilitySelector will not choose another child to execute and will return [code]FAILURE[/code] when a child task results in [code]FAILURE[/code]. + + +