You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Since first_run changes to false in one of Precondition's children, the next time Precondition checks it's "if" clause, it'll return it's "else" port (FAILURE).
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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:
Since
first_run
changes to false in one ofPrecondition
's children, the next time Precondition checks it's "if" clause, it'll return it's "else" port (FAILURE).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.
Beta Was this translation helpful? Give feedback.
All reactions