Skip to content

Found incorrect behavior (I think). Wrote some tests.#2

Open
gaboose wants to merge 4 commits into
eykd:masterfrom
gaboose:master
Open

Found incorrect behavior (I think). Wrote some tests.#2
gaboose wants to merge 4 commits into
eykd:masterfrom
gaboose:master

Conversation

@gaboose

@gaboose gaboose commented Dec 15, 2014

Copy link
Copy Markdown

I'm kind of new to behavior trees so it'd be nice if someone confirmed whether these failures are real / tests are correct. Though I'm fairly certain repeatUntilSucceed and repeatUntilFail should execute its child more than once to operate correctly.

Here's how the tests fail:

FAIL: testParallel_DelayedFailure (__main__.OwylTests)
Can parallel fail if child fails later (all succeed)?
AssertionError: Lists differ: [True] != [False]

FAIL: testParallel_DelayedSuccess (__main__.OwylTests)
Can parallel succeed if child succeeds later (one succeeds)?
AssertionError: Lists differ: [False] != [True]

FAIL: testRepeatAlways_Count (__main__.OwylTests)
Does repeatAlways execute its child with every tick?
AssertionError: 50 != 100

FAIL: testRepeatUntilFail_Count (__main__.OwylTests)
Does repeatUntilFail execute its child with every tick?
AssertionError: 1 != 100

FAIL: testRepeatUntilSucceed_Count (__main__.OwylTests)
Does repeatUntilSucceed execute its child with every tick?
AssertionError: 1 != 100

@linas

linas commented Dec 15, 2014

Copy link
Copy Markdown
Contributor

Did you mean "more than once" or "more than zero?" Normally, if one is asked to do something until one suceeds, and one gets it on the very first try, you get a gold star, and don't have to do it again.

If precision is a requirement, then the semantics are usually "at least once, and at most once". For example: an automated banking machine: "(repeat-until-success: call bank; decrement account balance $50); then dispense cash-money $50" -- You don't want to decrement $50 twice: you want to keep trying till you contact the bank, but once you succeeed, you are done.

@gaboose

gaboose commented Dec 15, 2014

Copy link
Copy Markdown
Author

I get that. But here, following your example, the success-check "try call bank" gets executed only once even though the network is down (the test is rigged so the repeatUntilSucceed never succeeds) and I stepped through the tree 100 times.

@eykd

eykd commented Dec 16, 2014

Copy link
Copy Markdown
Owner

Yes, there's something wrong with parallel. Good find! I'm looking into it.

@linas

linas commented Dec 31, 2014

Copy link
Copy Markdown
Contributor

Any reason this pull request cannot be merged?

Since Gaboose and I plan to use behvaior trees more and more, would it be possible to be listed as a project participant/maintainer for this project?

@gaboose

gaboose commented Jan 6, 2015

Copy link
Copy Markdown
Author

@eykd I took the liberty of fixing these myself 5d73706 . All tests succeed.

@eykd

eykd commented Jan 6, 2015

Copy link
Copy Markdown
Owner

Hey guys, sorry for the radio silence. I took a couple weeks off around Christmas and the New Year, and now I'm catching up on everything. In investigating this issue I discovered #3 which is potentially a serious issue as well. I was working on a fix before the break. I'll try to have that packaged up this week, potentially incorporating your changes @gaboose once I've reviewed them. Thanks.

@gaboose

gaboose commented Jan 12, 2015

Copy link
Copy Markdown
Author

Thanks for looking into this. I myself can't tell whether visit's leaky values are an issue or not.

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

Successfully merging this pull request may close these issues.

3 participants