Skip to content

Commit

Permalink
fixing agent history to pop first element when exceding 1000 items
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigcd committed Sep 24, 2024
1 parent 66e53e9 commit 082d5a4
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 082d5a4

Please sign in to comment.