refactor: change test folder structure, rename functions to account for (non)changing behaviours and clarity

ref: N25B-257
This commit is contained in:
Björn Otgaar
2025-11-12 12:42:54 +01:00
parent 9365f109ab
commit 7a707cf9a0
19 changed files with 79 additions and 79 deletions

View File

@@ -29,7 +29,7 @@ class ActSpeechAgent(BaseAgent):
self.address = address
self.bind = bind
class SendCommandsBehaviour(CyclicBehaviour):
class SendZMQCommandsBehaviour(CyclicBehaviour):
"""Behaviour for sending commands received from the UI."""
async def run(self):
@@ -50,7 +50,7 @@ class ActSpeechAgent(BaseAgent):
except Exception as e:
self.agent.logger.error("Error processing message: %s", e)
class SendPythonCommandsBehaviour(CyclicBehaviour):
class SendSpadeCommandsBehaviour(CyclicBehaviour):
"""Behaviour for sending commands received from other Python agents."""
async def run(self):
@@ -83,8 +83,8 @@ class ActSpeechAgent(BaseAgent):
self.subsocket.setsockopt(zmq.SUBSCRIBE, b"command")
# Add behaviour to our agent
commands_behaviour = self.SendCommandsBehaviour()
commands_behaviour = self.SendZMQCommandsBehaviour()
self.add_behaviour(commands_behaviour)
self.add_behaviour(self.SendPythonCommandsBehaviour())
self.add_behaviour(self.SendSpadeCommandsBehaviour())
self.logger.info("Finished setting up %s", self.jid)

View File

@@ -7,7 +7,7 @@ from spade.behaviour import CyclicBehaviour
from control_backend.core.config import settings
class ContinuousBeliefCollector(CyclicBehaviour):
class BelCollectorBehaviour(CyclicBehaviour):
"""
Continuously collects beliefs/emotions from extractor agents:
Then we send a unified belief packet to the BDI agent.

View File

@@ -1,11 +1,11 @@
from control_backend.agents.base import BaseAgent
from .behaviours.continuous_collect import ContinuousBeliefCollector
from .behaviours.bel_collector_behaviour import BelCollectorBehaviour
class BDIBeliefCollectorAgent(BaseAgent):
async def setup(self):
self.logger.info("BDIBeliefCollectorAgent starting (%s)", self.jid)
# Attach the continuous collector behaviour (listens and forwards to BDI)
self.add_behaviour(ContinuousBeliefCollector())
self.add_behaviour(BelCollectorBehaviour())
self.logger.info("BDIBeliefCollectorAgent ready.")

View File

@@ -7,7 +7,7 @@ from spade_bdi.bdi import BDIAgent
from control_backend.core.config import settings
from .behaviours.belief_setter import BeliefSetterBehaviour
from .behaviours.belief_setter_behaviour import BeliefSetterBehaviour
from .behaviours.receive_llm_resp_behaviour import ReceiveLLMResponseBehaviour

View File

@@ -1,8 +1,8 @@
from control_backend.agents.base import BaseAgent
from .behaviours.text_belief_extractor import BeliefFromText
from .behaviours.bdi_text_belief_behaviour import BDITextBeliefBehaviour
class BDITextBeliefAgent(BaseAgent):
async def setup(self):
self.add_behaviour(BeliefFromText())
self.add_behaviour(BDITextBeliefBehaviour())

View File

@@ -7,7 +7,7 @@ from spade.message import Message
from control_backend.core.config import settings
class BeliefFromText(CyclicBehaviour):
class BDITextBeliefBehaviour(CyclicBehaviour):
logger = logging.getLogger(__name__)
# TODO: LLM prompt nog hardcoded