EnvironmentState
python
EnvironmentState(n_step: int, gamma: float, action_shape: int, state: np.ndarray | None = None, action: int = 0, episode_reward: float = 0.0, episode_length: int = 0, trajectory_session: ActiveTrajectorySession = ActiveTrajectorySession.normal()) -> NoneState tracked per-environment in the Trainer.
Methods
reset
python
reset(observation: np.ndarray | None, trajectory_session: ActiveTrajectorySession | None = None) -> NoneReset the environment state for a new episode.
Parameters:
observation(ndarray | None) – The initial observation, if needed for the next step plan.trajectory_session(ActiveTrajectorySession | None) – The trajectory source state for the new episode, orNonefor a normal episode.
Values
action
python
action: int = 0Last action taken.
action_counts
python
action_counts: np.ndarray = field(init=False, repr=False)Count of each action taken in the current episode.
action_shape
python
action_shape: intNumber of possible actions.
episode_length
python
episode_length: int = 0Number of steps in the current episode.
episode_reward
python
episode_reward: float = 0.0Cumulative reward for the current episode.
gamma
python
gamma: floatDiscount factor.
n_step
python
n_step: intNumber of steps for the n-step buffer.
n_step_buffer
python
n_step_buffer: NStepBuffer = field(init=False, repr=False)Buffer for computing n-step returns.
state
python
state: np.ndarray | None = field(default=None, repr=False)Current state observation.
trajectory_session
python
trajectory_session: ActiveTrajectorySession = field(default_factory=ActiveTrajectorySession.normal, repr=False)Trajectory source state for the current episode.