Skip to content

Commit

Permalink
Set max_episode_steps
Browse files Browse the repository at this point in the history
  • Loading branch information
carlogrisetti committed Aug 23, 2022
1 parent 1091e33 commit 475c71e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tensortrade/env/generic/environment.py
Expand Up @@ -66,6 +66,7 @@ def __init__(self,
informer: Informer,
renderer: Renderer,
min_periods: int = None,
max_episode_steps: int = None,
random_start_pct: float = 0.00,
**kwargs) -> None:
super().__init__()
Expand All @@ -80,6 +81,13 @@ def __init__(self,
self.min_periods = min_periods
self.random_start_pct = random_start_pct

# Register the environment in Gym and fetch spec
gym.envs.register(
id='TensorTrade-v0',
max_episode_steps=max_episode_steps,
)
self.spec = gym.spec(id='TensorTrade-v0')

for c in self.components.values():
c.clock = self.clock

Expand Down

0 comments on commit 475c71e

Please sign in to comment.