- Notifications
You must be signed in to change notification settings - Fork778
-
Should the Precondition Node check it's "if" clause once before running it's children, or should it check it's "if" clause while it's children are running?I've encountered the latter, but I think it should be the former and I've drafted a PR to fix this in#904, but I wanted to open a discussion to make sure. Suppose you implement "Run Once" as the following tree: <Sequence> <Scriptcode="first_run := true" /> <Preconditionif="first_run == true"else="FAILURE"> <Sequence> <Scriptcode="first_run := false" /> <OtherAction /> </Control> </Decorator> </Control> Since If this tree should check the Precondition "if" clause again, when should it do so?The current implementation checks the "if" clause before every tick. If the children of Precondition can all run within one tick (immediately succeeding behaviors get chained together within the same tick), then all of the child nodes are run to completion. However if a child is some long running behavior that runs over multiple ticks, then the Precondition Node check's it's "if" clause again and with the previous tree, Precondition would fail early. I feel that the implementation details of child nodes running over multiple ticks or not should not matter to the Precondition node and so it would make more sense for the "if" clause to be checked before a new child is run. |
BetaWas this translation helpful?Give feedback.