oa::ml::environment::EnvironmentSpace

Checked shape, dtype, and range contract for one environment field. shape excludes the leading environment-batch dimension. An empty shape therefore represents one scalar per environment.

StRust public API

Declaration

pub struct EnvironmentSpace { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn name(&self) -> &str
pub const fn kind(&self) -> EnvironmentSpaceKind
pub fn shape(&self) -> &[usize]
pub const fn dtype(&self) -> DType
pub const fn minimum(&self) -> f64
pub const fn maximum(&self) -> f64
pub const fn cardinality(&self) -> usize
pub fn elements_per_environment(&self) -> usize
pub fn batched_shape(&self, environments: u32) -> Result<Vec<usize>>
pub fn validate_matrix(&self, matrix: &Matrix, environments: u32) -> Result<()>
fn clone(&self) -> EnvironmentSpace
fn fmt(&self, f: &mut Formatter<'_>) -> Result

Associated Functions

pub fn continuous( name: impl Into<String>, shape: impl Into<Vec<usize>>, dtype: DType, minimum: f64, maximum: f64, ) -> Result<Self>
pub fn discrete( name: impl Into<String>, cardinality: usize, dtype: DType, ) -> Result<Self>
pub fn binary( name: impl Into<String>, shape: impl Into<Vec<usize>>, ) -> Result<Self>

Public Method Documentation

pub fn name( &self ) -> &str
No public source comment is attached to this declaration.
pub const fn kind( &self ) -> EnvironmentSpaceKind
No public source comment is attached to this declaration.
pub fn shape( &self ) -> &[usize]
No public source comment is attached to this declaration.
pub const fn dtype( &self ) -> DType
No public source comment is attached to this declaration.
pub const fn minimum( &self ) -> f64
No public source comment is attached to this declaration.
pub const fn maximum( &self ) -> f64
No public source comment is attached to this declaration.
pub const fn cardinality( &self ) -> usize
No public source comment is attached to this declaration.
pub fn elements_per_environment( &self ) -> usize
No public source comment is attached to this declaration.
pub fn batched_shape( &self, environments: u32 ) -> Result<Vec<usize>>
No public source comment is attached to this declaration.
pub fn validate_matrix(&self, matrix: &Matrix, environments: u32) -> Result<()>
No public source comment is attached to this declaration.
fn clone( &self ) -> EnvironmentSpace
No public source comment is attached to this declaration.
fn fmt( &self, f: &mut Formatter<'_> ) -> Result
No public source comment is attached to this declaration.
pub fn continuous( name: impl Into<String>, shape: impl Into<Vec<usize>>, dtype: DType, minimum: f64, maximum: f64 ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn discrete( name: impl Into<String>, cardinality: usize, dtype: DType ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn binary( name: impl Into<String>, shape: impl Into<Vec<usize>> ) -> Result<Self>
No public source comment is attached to this declaration.