Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expected behavior for Precondition Node#906

Unanswered
dsobek asked this question inQ&A
Discussion options

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>

Sincefirst_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.

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@dsobek

[8]ページ先頭

©2009-2025 Movatter.jp