Common Debugging Scenarios

From ABL
Revision as of 14:28, 25 July 2006 by Sooraj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Scenario 1

"I've added a new persistent subgoal in a parallel behavior. With the new subgoal commented out, everything is fine. But with the new subgoal active, my agent runs very slowly."

Solution

Something to check: Compile with the debugger active and check the decision cycles per second. If the decision cycle count is very high(e.g. near 1000 cycles per second or higher), this most likely means that all preconditions are failing for the family of behaviors that can accomplish the subgoal (the behaviors with the same signature as the subgoal). When no behavior can be found to accomplish a subgoal, the subgoal fails. If the subgoal has been annotated as persistent, the subgoal is immediately re-added to the ABT and ABL again tries to pursue the subgoal, again failing because no precondition tests true and so on.

We need to include an example of this. Talk about two potential bugs: either a bug in the precondition(s) (you expected them to evaulate to true but they're not) or a design bug where you're using the preconditions to poll the environment. In the later case, either replace with success_test logic (a demon - preferred ABL style), or add a lower specificity behavior that sleeps for a bit before succeeding.