Skip to content

Commit

Permalink
remove base64
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason committed Feb 7, 2024
1 parent 565d83f commit dd26097
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/<your_map_name>.tmj`

3. Pass in to `engine.py` with `--environment` flag.

6 changes: 2 additions & 4 deletions src/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:]
Expand Down
2 changes: 1 addition & 1 deletion src/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down

0 comments on commit dd26097

Please sign in to comment.