Skip to content

Commit

Permalink
Merge pull request #111 from SainsburyWellcomeCentre/history_agent_fix
Browse files Browse the repository at this point in the history
fixing agent history to pop first element when exceding 1000 items
  • Loading branch information
rodrigcd authored Oct 15, 2024
2 parents 66e53e9 + 082d5a4 commit 24be1d0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions neuralplayground/agents/agent_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ def act(self, obs, policy_func=None):

self.obs_history.append(obs)
if len(self.obs_history) >= 1000: # reset every 1000
self.obs_history = [
obs,
]
self.obs_history.pop(0)
if policy_func is not None:
return policy_func(obs)

Expand Down

0 comments on commit 24be1d0

Please sign in to comment.