#2879: Write seed value to log file.
This commit is contained in:
@@ -62,6 +62,13 @@ def set_random_seed(seed: int, generate_seed_value: bool) -> Union[None, int]:
|
|||||||
return seed
|
return seed
|
||||||
|
|
||||||
|
|
||||||
|
def log_seed_value(seed: int):
|
||||||
|
"""Log the selected seed value to file."""
|
||||||
|
path = SIM_OUTPUT.path / "seed.log"
|
||||||
|
with open(path, "w") as file:
|
||||||
|
file.write(f"Seed value = {seed}")
|
||||||
|
|
||||||
|
|
||||||
class PrimaiteGymEnv(gymnasium.Env):
|
class PrimaiteGymEnv(gymnasium.Env):
|
||||||
"""
|
"""
|
||||||
Thin wrapper env to provide agents with a gymnasium API.
|
Thin wrapper env to provide agents with a gymnasium API.
|
||||||
@@ -92,6 +99,8 @@ class PrimaiteGymEnv(gymnasium.Env):
|
|||||||
|
|
||||||
_LOGGER.info(f"PrimaiteGymEnv RNG seed = {self.seed}")
|
_LOGGER.info(f"PrimaiteGymEnv RNG seed = {self.seed}")
|
||||||
|
|
||||||
|
log_seed_value(self.seed)
|
||||||
|
|
||||||
def action_masks(self) -> np.ndarray:
|
def action_masks(self) -> np.ndarray:
|
||||||
"""
|
"""
|
||||||
Return the action mask for the agent.
|
Return the action mask for the agent.
|
||||||
|
|||||||
Reference in New Issue
Block a user