From dd26097656cbf4e32132989d4d095f44c904618f Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 7 Feb 2024 10:45:38 -0800 Subject: [PATCH] remove base64 --- README.md | 1 + src/agents.py | 6 ++---- src/matrix.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 22eb862..6a6b12e 100644 --- a/README.md +++ b/README.md @@ -194,3 +194,4 @@ This should start a basic webserver that would allow us to view the game state a 2. Save as JSON map format. Move to `configs/.tmj` 3. Pass in to `engine.py` with `--environment` flag. + diff --git a/src/agents.py b/src/agents.py index 3d146af..a523ade 100644 --- a/src/agents.py +++ b/src/agents.py @@ -346,8 +346,7 @@ def talk(self, opts={}): self.last_conversation.messages.append(interaction) other_agent.last_conversation.messages.append(interaction) if self.matrix: - safe = base64.b64encode(msg.encode('utf-8')).decode('utf-8') - self.matrix.add_to_logs({"agent_id":self.id,"to_id":other_agent.id,"step_type":"talk","content": safe}) + self.matrix.add_to_logs({"agent_id":self.id,"to_id":other_agent.id,"step_type":"talk","content": msg}) return msg def talk_many(self, perceived_agents, timestamp): @@ -525,8 +524,7 @@ def addMemory(self, kind, content, timestamp=None, score=None): memory = Memory(kind, content, timestamp, timestamp, score) self.memory.append(memory) if self.matrix: - bc = base64.b64encode(content.encode('utf-8')).decode('utf-8') - self.matrix.add_to_logs({"agent_id":self.id,"step_type":"add_memory","kind":kind,"timestamp":timestamp,"last_accessed_at":timestamp,"score":score,"content": bc}) + self.matrix.add_to_logs({"agent_id":self.id,"step_type":"add_memory","kind":kind,"timestamp":timestamp,"last_accessed_at":timestamp,"score":score,"content": content}) def reflect(self, timestamp, force=False): relevant_memories = self.memory[-100:] diff --git a/src/matrix.py b/src/matrix.py index 8996979..cc3746a 100644 --- a/src/matrix.py +++ b/src/matrix.py @@ -139,7 +139,7 @@ def add_agent_to_simulation(self, agent): new_position = random.choice(valid_coordinates) agent.x = new_position[0] agent.y = new_position[1] - self.matrix.add_to_logs({"agent_id":agent.id,"step_type":"agent_set","x":agent.x,"y":agent.y}) + #self.matrix.add_to_logs({"agent_id":agent.id,"step_type":"agent_set","x":agent.x,"y":agent.y}) if agent.kind != "zombie" and self.allow_observance_flag == 1: parsed_spatial_mem = []