Trait relearn::envs::BuildEnv [−][src]
pub trait BuildEnv {
type Observation;
type Action;
type ObservationSpace: Space<Element = Self::Observation>;
type ActionSpace: Space<Element = Self::Action>;
type Environment: Environment<Observation = Self::Observation, Action = Self::Action> + EnvStructure<ObservationSpace = Self::ObservationSpace, ActionSpace = Self::ActionSpace>;
fn build_env(&self, seed: u64) -> Result<Self::Environment, BuildEnvError>;
}
Expand description
Build an Environment
.
Environment is an associated trait rather than a generic parameter to facilitate reproducibility: a given environment configuration can construct exactly one environment. The user does not need to store the environment type.
Associated Types
type Observation
type Observation
Environment observation type.
type ObservationSpace: Space<Element = Self::Observation>
type ObservationSpace: Space<Element = Self::Observation>
Environment observation space type.
type ActionSpace: Space<Element = Self::Action>
type ActionSpace: Space<Element = Self::Action>
Environment action space type.
type Environment: Environment<Observation = Self::Observation, Action = Self::Action> + EnvStructure<ObservationSpace = Self::ObservationSpace, ActionSpace = Self::ActionSpace>
type Environment: Environment<Observation = Self::Observation, Action = Self::Action> + EnvStructure<ObservationSpace = Self::ObservationSpace, ActionSpace = Self::ActionSpace>
Type of environment to build
Required methods
fn build_env(&self, seed: u64) -> Result<Self::Environment, BuildEnvError>
fn build_env(&self, seed: u64) -> Result<Self::Environment, BuildEnvError>
Build an environment instance.
Args
seed
- Seed for pseudo-randomness in the environment state and transition dynamics. The environment structure itself should not be random; seed any structural randomness from the environment configuration.