refactor: remove constants and put in config file
removed all constants from all files and put them in src/control_backend/core/config.py also removed some old mock agents that we don't use anymore ref: N25B-236
This commit is contained in:
@@ -21,9 +21,9 @@ class RICommunicationAgent(Agent):
|
||||
self,
|
||||
jid: str,
|
||||
password: str,
|
||||
port: int = 5222,
|
||||
port: int = settings.agent_settings.default_spade_port,
|
||||
verify_security: bool = False,
|
||||
address="tcp://localhost:0000",
|
||||
address=settings.zmq_settings.ri_command_address,
|
||||
bind=False,
|
||||
):
|
||||
super().__init__(jid, password, port, verify_security)
|
||||
@@ -58,13 +58,13 @@ class RICommunicationAgent(Agent):
|
||||
# See what endpoint we received
|
||||
match message["endpoint"]:
|
||||
case "ping":
|
||||
await asyncio.sleep(1)
|
||||
await asyncio.sleep(settings.agent_settings.behaviour_settings.ping_sleep_s)
|
||||
case _:
|
||||
logger.info(
|
||||
"Received message with topic different than ping, while ping expected."
|
||||
)
|
||||
|
||||
async def setup(self, max_retries: int = 5):
|
||||
async def setup(self, max_retries: int = settings.behaviour_settings.comm_setup_max_retries):
|
||||
"""
|
||||
Try to setup the communication agent, we have 5 retries in case we dont have a response yet.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user