fix choose_retrieved

This commit is contained in:
better629 2023-10-14 11:01:54 +08:00
parent 9e19575a99
commit 8bd76a1f14
2 changed files with 5 additions and 4 deletions

View file

@ -44,7 +44,7 @@ def plan(role: "STRole", maze: Maze, roles: dict["STRole"], new_day: bool, retri
# ["thoughts"] = [<ConceptNode>, ...]}
focused_event = False
if retrieved.keys():
focused_event = _choose_retrieved(role, retrieved)
focused_event = _choose_retrieved(role.name, retrieved)
# Step 2: Once we choose an event, we need to determine whether the
# role will take any actions for the perceived event. There are

View file

@ -17,10 +17,11 @@ def test_should_react():
observed = role_ir.observe()
retrieved = role_ir.retrieve(observed)
focused_event = _choose_retrieved(role_ir, retrieved)
focused_event = _choose_retrieved(role_ir.name, retrieved)
reaction_mode = _should_react(role_ir, focused_event, roles) # chat with Isabella Rodriguez
assert "chat with" in reaction_mode
if focused_event:
reaction_mode = _should_react(role_ir, focused_event, roles) # chat with Isabella Rodriguez
assert "chat with" in reaction_mode
def test_wait_react():