pub struct EnvFunctions {
pub name: String,
pub action_space: ActionSpace,
pub num_obs: usize,
pub reset: Function,
pub step: Function,
pub legal_action_mask: Option<Function>,
}Expand description
The functions of an environment, from which generate_from_functions
generates a CompiledEnv: traced from an Environment (as
generate does) or imported from JAX (ruxla-import, crate::jax_env).
The parameters are fixed (constants of the
functions); keys are u32[2], and states and observations are tuples of
leaves.
Fields§
§name: StringThe environment’s name.
action_space: ActionSpaceThe actions.
num_obs: usizeThe number of leaves of an observation.
reset: Functionreset(key) -> (obs..., state...).
step: FunctionThe step with the automatic reset: step(key, state..., action) -> (obs..., state..., reward: f32, terminated: bool, truncated: bool, final_obs..., discount: f32).
legal_action_mask: Option<Function>legal_action_mask(state...) -> bool[n] over the joint actions, if
the environment has one.
Trait Implementations§
Source§impl Clone for EnvFunctions
impl Clone for EnvFunctions
Auto Trait Implementations§
impl !RefUnwindSafe for EnvFunctions
impl !UnwindSafe for EnvFunctions
impl Freeze for EnvFunctions
impl Send for EnvFunctions
impl Sync for EnvFunctions
impl Unpin for EnvFunctions
impl UnsafeUnpin for EnvFunctions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more