From 20c0083217c8827d78bba4221bb430acb34f6781 Mon Sep 17 00:00:00 2001 From: Luis Rodrigues Date: Thu, 19 Mar 2026 21:30:29 +0000 Subject: [PATCH] =?UTF-8?q?redefini=C3=A7=C3=A3o=20de=20tipos=20de=20atrib?= =?UTF-8?q?utos=20da=20classe=20'Agente'=20e=20parametros=20de=20construto?= =?UTF-8?q?r=20de=20objecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/agente.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/agente.py b/modules/agente.py index b9db2b0..df06a5f 100644 --- a/modules/agente.py +++ b/modules/agente.py @@ -13,11 +13,13 @@ class Agente: "memoria": 0.0, } pontuacao: int = 0 - estrategia: str | None = None + estrategia: str = "" id_agente: int = 0 - banco_memoria: dict[int, list] = {} + # banco de memoria + banco_memoria: dict[int, list[int]] = {} + posicao: tuple[int, int] - def __init__(self, estrategia: str): + def __init__(self, estrategia: str = "", posicao: tuple[int, int] = (0, 0)): # definir estrategia aleatoriamente self.estrategia = estrategia # definir personalidade com base na estratégia @@ -25,6 +27,7 @@ class Agente: # identificador de agente self.id_agente = id(self) self.pontuacao = 0 + self.posicao = posicao def __str__(self): return f"Dados Agente ({self.id_agente})\n \