Skip to content

Implement BDI plan step failure #2

@dhixsingh

Description

@dhixsingh

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();
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions