Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decorator limiter would not limiter the time between two tick from tree #25

Open
linhaiwei123 opened this issue Mar 19, 2017 · 6 comments

Comments

@linhaiwei123
Copy link

linhaiwei123 commented Mar 19, 2017

the tree is as below
image

and i do enter the limiter but when i tick the tree in the update again the time of the limiter would reset to zero again.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@linhaiwei123
Copy link
Author

linhaiwei123 commented Mar 19, 2017

i found the bug here. in limiter we should return the b3.RUNNING instead of b3.SUCCESS or b3.FAILURE
cause the b3.SUCCESS or b3.FAILURE would exit the running state and reset the time in open when we tick again

@linhaiwei123
Copy link
Author

yep i found that return b3.RUNNING in limiter still not work well. the only way to fix it is to check whether the key i is set or not. and set it in the first time we enter the open callback

@danielepolencic
Copy link
Collaborator

@linhaiwei123 would you be able to submit a PR with the failing test or a simple way to reproduce the bug?

@wqhk
Copy link

wqhk commented Oct 20, 2017

open: function(tick) {
tick.blackboard.set('i', 0, tick.tree.id, this.id);
},
The Decorator of Limiter will reset "i" to zero when child status == b3.SUCCESS || status == b3.FAILURE。 +1 ,reset 0, +1 ,reset 0……

@danielepolencic
Copy link
Collaborator

@wqhk would you be able to submit a PR with a failing test?

@wqhk
Copy link

wqhk commented Oct 21, 2017

@danielepolencic I submit a PR. Learn BT this week, maybe misunderstand the usage of Limiter =。=

magicsea added a commit to magicsea/behavior3go that referenced this issue Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants