fix: look for goals in steps rather than plans
small bugfix, we used to look for goals in plans, but they are part of a plan. ref: N25B-400
This commit is contained in:
@@ -198,9 +198,9 @@ class BDIProgramManager(BaseAgent):
|
||||
:return: All goals within and including the given goal.
|
||||
"""
|
||||
goals: list[Goal] = [goal]
|
||||
for plan in goal.plan:
|
||||
if isinstance(plan, Goal):
|
||||
goals.extend(BDIProgramManager._extract_goals_from_goal(plan))
|
||||
for step in goal.plan.steps:
|
||||
if isinstance(step, Goal):
|
||||
goals.extend(BDIProgramManager._extract_goals_from_goal(step))
|
||||
return goals
|
||||
|
||||
def _extract_current_goals(self) -> list[Goal]:
|
||||
|
||||
@@ -336,7 +336,6 @@ class UserInterruptAgent(BaseAgent):
|
||||
else:
|
||||
self.logger.warning("Tried to send belief with unknown type")
|
||||
return
|
||||
|
||||
belief = Belief(name=belief_name, arguments=None)
|
||||
self.logger.debug(f"Sending belief to BDI Core: {belief_name}")
|
||||
# Conditional norms are unachieved by removing the belief
|
||||
|
||||
Reference in New Issue
Block a user