#2085: generate time based log files
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import os
|
||||
# import os
|
||||
from typing import Any, Dict, Final, Optional, SupportsFloat, Tuple
|
||||
|
||||
import gymnasium
|
||||
@@ -37,11 +37,11 @@ class PrimaiteGymEnv(gymnasium.Env):
|
||||
dump_state = {self.game.episode_counter: {self.game.step_counter: state}}
|
||||
|
||||
# Dump to file
|
||||
if os.path.isfile(PRIMAITE_PATHS.episode_steps_log_file_path):
|
||||
with open(PRIMAITE_PATHS.episode_steps_log_file_path, "a", encoding="utf-8") as f:
|
||||
f.write(str(dump_state))
|
||||
f.write("\n=================\n")
|
||||
f.flush()
|
||||
# if os.path.isfile(PRIMAITE_PATHS.episode_steps_log_file_path):
|
||||
with open(PRIMAITE_PATHS.episode_log_file_path, "a", encoding="utf-8") as f:
|
||||
f.write(str(dump_state))
|
||||
f.write("\n=================\n")
|
||||
f.flush()
|
||||
|
||||
self.game.update_agents(state)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user