style: fix style
This commit is contained in:
@@ -5,13 +5,15 @@ from spade_bdi.bdi import BDIAgent
|
||||
|
||||
from control_backend.agents.bdi.behaviours.belief_setter import BeliefSetter
|
||||
|
||||
|
||||
class BDICoreAgent(BDIAgent):
|
||||
"""
|
||||
This is the Brain agent that does the belief inference with AgentSpeak.
|
||||
This is the Brain agent that does the belief inference with AgentSpeak.
|
||||
This is a continous process that happens automatically in the background.
|
||||
This class contains all the actions that can be called from AgentSpeak plans.
|
||||
It has the BeliefSetter behaviour.
|
||||
"""
|
||||
|
||||
logger = logging.getLogger("BDI Core")
|
||||
|
||||
async def setup(self):
|
||||
@@ -31,5 +33,3 @@ class BDICoreAgent(BDIAgent):
|
||||
def _send_to_llm(self, message) -> str:
|
||||
"""TODO: implement"""
|
||||
return f"This is a reply to {message}"
|
||||
|
||||
|
||||
|
||||
@@ -8,15 +8,17 @@ from spade_bdi.bdi import BDIAgent
|
||||
|
||||
from control_backend.core.config import settings
|
||||
|
||||
|
||||
class BeliefSetter(CyclicBehaviour):
|
||||
"""
|
||||
This is the behaviour that the BDI agent runs.
|
||||
This behaviour waits for incoming message and processes it based on sender.
|
||||
Currently, t only waits for messages containing beliefs from Belief Collector and adds these to its KB.
|
||||
This is the behaviour that the BDI agent runs. This behaviour waits for incoming
|
||||
message and processes it based on sender. Currently, it only waits for messages
|
||||
containing beliefs from BeliefCollector and adds these to its KB.
|
||||
"""
|
||||
|
||||
agent: BDIAgent
|
||||
logger = logging.getLogger("BDI/Belief Setter")
|
||||
|
||||
|
||||
async def run(self):
|
||||
msg = await self.receive(timeout=0.1)
|
||||
if msg:
|
||||
@@ -36,7 +38,8 @@ class BeliefSetter(CyclicBehaviour):
|
||||
pass
|
||||
|
||||
def _process_belief_message(self, message: Message):
|
||||
if not message.body: return
|
||||
if not message.body:
|
||||
return
|
||||
|
||||
match message.thread:
|
||||
case "beliefs":
|
||||
@@ -48,7 +51,6 @@ class BeliefSetter(CyclicBehaviour):
|
||||
case _:
|
||||
pass
|
||||
|
||||
|
||||
def _set_beliefs(self, beliefs: dict[str, list[list[str]]]):
|
||||
if self.agent.bdi is None:
|
||||
self.logger.warning("Cannot set beliefs, since agent's BDI is not yet initialized.")
|
||||
|
||||
Reference in New Issue
Block a user