chore: fix style guide max characters
This commit is contained in:
@@ -17,7 +17,9 @@ class RICommunicationAgent(Agent):
|
||||
_address = ""
|
||||
_bind = True
|
||||
|
||||
def __init__(self, jid: str, password: str, port: int = 5222, verify_security: bool = False, address = "tcp://localhost:0000", bind = False):
|
||||
def __init__(self, jid: str, password: str, port: int = 5222,
|
||||
verify_security: bool = False, address = "tcp://localhost:0000",
|
||||
bind = False):
|
||||
super().__init__(jid, password, port, verify_security)
|
||||
self._address = address
|
||||
self._bind = bind
|
||||
@@ -54,7 +56,8 @@ class RICommunicationAgent(Agent):
|
||||
case "ping":
|
||||
await asyncio.sleep(1)
|
||||
case _:
|
||||
logger.info("Received message with topic different than ping, while ping expected.")
|
||||
logger.info("Received message with topic different than ping," \
|
||||
" while ping expected.")
|
||||
|
||||
|
||||
async def setup(self, max_retries: int = 5):
|
||||
@@ -82,7 +85,8 @@ class RICommunicationAgent(Agent):
|
||||
received_message = await asyncio.wait_for(self.req_socket.recv_json(), timeout=20.0)
|
||||
|
||||
except asyncio.TimeoutError:
|
||||
logger.warning("No connection established in 20 seconds (attempt %d/%d)", retries + 1, max_retries)
|
||||
logger.warning("No connection established in 20 seconds (attempt %d/%d)",
|
||||
retries + 1, max_retries)
|
||||
retries += 1
|
||||
continue
|
||||
|
||||
@@ -95,7 +99,8 @@ class RICommunicationAgent(Agent):
|
||||
endpoint = received_message.get("endpoint")
|
||||
if endpoint != "negotiate/ports":
|
||||
# TODO: Should this send a message back?
|
||||
logger.error("Invalid endpoint '%s' received (attempt %d/%d)", endpoint, retries + 1, max_retries)
|
||||
logger.error("Invalid endpoint '%s' received (attempt %d/%d)",
|
||||
endpoint, retries + 1, max_retries)
|
||||
retries += 1
|
||||
continue
|
||||
|
||||
@@ -120,7 +125,8 @@ class RICommunicationAgent(Agent):
|
||||
self.req_socket.bind(addr)
|
||||
case "actuation":
|
||||
ri_commands_agent = RICommandAgent(
|
||||
settings.agent_settings.ri_command_agent_name + '@' + settings.agent_settings.host,
|
||||
settings.agent_settings.ri_command_agent_name +
|
||||
'@' + settings.agent_settings.host,
|
||||
settings.agent_settings.ri_command_agent_name,
|
||||
address=addr,
|
||||
bind=bind )
|
||||
|
||||
@@ -33,12 +33,16 @@ async def lifespan(app: FastAPI):
|
||||
logger.info("Internal publishing socket bound to %s", internal_comm_socket)
|
||||
|
||||
# Initiate agents
|
||||
ri_communication_agent = RICommunicationAgent(settings.agent_settings.ri_communication_agent_name + '@' + settings.agent_settings.host,
|
||||
ri_communication_agent = RICommunicationAgent(settings.agent_settings.ri_communication_agent_name +
|
||||
'@' + settings.agent_settings.host,
|
||||
settings.agent_settings.ri_communication_agent_name,
|
||||
address="tcp://*:5555", bind=True)
|
||||
await ri_communication_agent.start()
|
||||
|
||||
bdi_core = BDICoreAgent(settings.agent_settings.bdi_core_agent_name + '@' + settings.agent_settings.host, settings.agent_settings.bdi_core_agent_name, "src/control_backend/agents/bdi/rules.asl")
|
||||
bdi_core = BDICoreAgent(settings.agent_settings.bdi_core_agent_name +
|
||||
'@' + settings.agent_settings.host,
|
||||
settings.agent_settings.bdi_core_agent_name,
|
||||
"src/control_backend/agents/bdi/rules.asl")
|
||||
await bdi_core.start()
|
||||
|
||||
yield
|
||||
|
||||
Reference in New Issue
Block a user