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.
|
:return: All goals within and including the given goal.
|
||||||
"""
|
"""
|
||||||
goals: list[Goal] = [goal]
|
goals: list[Goal] = [goal]
|
||||||
for plan in goal.plan:
|
for step in goal.plan.steps:
|
||||||
if isinstance(plan, Goal):
|
if isinstance(step, Goal):
|
||||||
goals.extend(BDIProgramManager._extract_goals_from_goal(plan))
|
goals.extend(BDIProgramManager._extract_goals_from_goal(step))
|
||||||
return goals
|
return goals
|
||||||
|
|
||||||
def _extract_current_goals(self) -> list[Goal]:
|
def _extract_current_goals(self) -> list[Goal]:
|
||||||
|
|||||||
@@ -336,7 +336,6 @@ class UserInterruptAgent(BaseAgent):
|
|||||||
else:
|
else:
|
||||||
self.logger.warning("Tried to send belief with unknown type")
|
self.logger.warning("Tried to send belief with unknown type")
|
||||||
return
|
return
|
||||||
|
|
||||||
belief = Belief(name=belief_name, arguments=None)
|
belief = Belief(name=belief_name, arguments=None)
|
||||||
self.logger.debug(f"Sending belief to BDI Core: {belief_name}")
|
self.logger.debug(f"Sending belief to BDI Core: {belief_name}")
|
||||||
# Conditional norms are unachieved by removing the belief
|
# Conditional norms are unachieved by removing the belief
|
||||||
|
|||||||
Reference in New Issue
Block a user