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

Implement BDI plan step failure #2

Open
dhixsingh opened this issue May 29, 2018 · 0 comments
Open

Implement BDI plan step failure #2

dhixsingh opened this issue May 29, 2018 · 0 comments
Assignees

Comments

@dhixsingh
Copy link
Contributor

What is required is the ability to allow plan steps to fail. BDI plans are currently described by a sequence of plan steps as below:

PlanStep[] steps = {new PlanStep() {
public void step() {
((TestAgent) getAgent()).setStatus(((TestAgent) getAgent()).getStatus() | 0x0001);
}
}, new PlanStep() {
public void step() {
post(new GoalB("gB"));
}
}, new PlanStep() {
public void step() {
post(new GoalC("gC"));
}
},};

The solution is to update the following step() function to instead return a boolean to indicate if the step (which could be an atomic action in the environment, or a sub-goal) has failed:

Then the intention selction machinery should to be updated to handle cases where a plan step returns false. If it does, then the plan must be aborted ie no further steps should be executed, and the plan itself should be failed (no mechanism to indicate plan failure exists yet either). The relevant code for this is here:

} else {
logger.debug(Log.logPrefix(agentIndex) + " is executing a step of plan "
+ node.getClass().getSimpleName());
node.step();
}

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

1 participant