1
0
mirror of https://github.com/gryf/coach.git synced 2025-12-17 19:20:19 +01:00

'CompositeAgent' object has no attribute 'handle_episode_ended' (#136)

This commit is contained in:
Ryan Peach
2018-12-05 04:28:16 -05:00
committed by Gal Leibovich
parent 436b16016e
commit 3c58ed740b
2 changed files with 16 additions and 3 deletions

View File

@@ -162,4 +162,14 @@ class AgentInterface(object):
(could be name of level manager or composite agent)
:return: collection of all agent savers
"""
raise NotImplementedError
raise NotImplementedError("")
def handle_episode_ended(self) -> None:
"""
Make any changes needed when each episode is ended.
This includes incrementing counters, updating full episode dependent values, updating logs, etc.
This function is called right after each episode is ended.
:return: None
"""
raise NotImplementedError("")

View File

@@ -305,9 +305,12 @@ class CompositeAgent(AgentInterface):
for agent in self.agents.values():
agent.phase = val
def end_episode(self) -> None:
def handle_episode_ended(self) -> None:
"""
End an episode
Make any changes needed when each episode is ended.
This includes incrementing counters, updating full episode dependent values, updating logs, etc.
This function is called right after each episode is ended.
:return: None
"""
self.current_episode += 1