Realm

oa::ml::environment::TradingEnvironment

Device-resident trading dynamics over one Engine and the canonical lifecycle. Observations append signed exposure, equity/capital, peak/capital, drawdown, remaining horizon, unrealized PnL/capital, position age/horizon and peak unrealized position PnL/capital.

StRust public API

Declaration

pub struct TradingEnvironment<'engine> { /* private fields */ }
Public Rust declaration.

Public Methods

pub fn snapshot(&self) -> Result<TradingState>
pub fn restore(&mut self, state: &TradingState) -> Result<()>
pub fn set_taker_fee(&mut self, taker_fee: f32) -> Result<()>
pub fn replace_series(&mut self, series: &[TradingSeries]) -> Result<()>
pub fn step_terminal( &mut self, action: &Matrix, ) -> Result<EnvironmentTransition>
pub const fn ledger(&self) -> &Matrix
pub const fn metadata(&self) -> &Matrix
pub fn check_status(&self) -> Result<()>
fn engine(&self) -> &Engine
fn spec(&self) -> &EnvironmentSpec
fn environments(&self) -> u32
fn observation(&self) -> &Matrix
fn execution(&self) -> &EnvironmentExecution
fn execution_mut(&mut self) -> &mut EnvironmentExecution
fn record_reset(&mut self, seed: u64) -> Result<()>
fn record_reset_completed(&mut self) -> Result<()>
fn commit_recorded_state(&mut self)
fn rollback_recorded_state(&mut self)
fn record_step(&mut self, action: &Matrix) -> Result<EnvironmentTransition>
fn begin(&mut self) -> Result<()>
fn reset(&mut self, seed: u64) -> Result<()>
fn step(&mut self, action: &Matrix) -> Result<EnvironmentTransition>
fn reset_completed(&mut self) -> Result<()>
fn submit(&mut self) -> Result<Event>
fn submit_timed(&mut self) -> Result<Event>
fn wait(&mut self, event: &Event) -> Result<()>
fn cancel(&mut self) -> Result<()>
fn close(&mut self) -> Result<()>

Associated Functions

pub fn new( engine: &'engine Engine, config: TradingConfig, series: &[TradingSeries], ) -> Result<Self>
pub fn new_with_row_capacity( engine: &'engine Engine, config: TradingConfig, series: &[TradingSeries], capacity: usize, ) -> Result<Self>

Public Method Documentation

pub fn snapshot( &self ) -> Result<TradingState>
No public source comment is attached to this declaration.
pub fn restore(&mut self, state: &TradingState) -> Result<()>
No public source comment is attached to this declaration.
pub fn set_taker_fee(&mut self, taker_fee: f32) -> Result<()>
No public source comment is attached to this declaration.
pub fn replace_series(&mut self, series: &[TradingSeries]) -> Result<()>
No public source comment is attached to this declaration.
pub fn step_terminal( &mut self, action: &Matrix ) -> Result<EnvironmentTransition>
No public source comment is attached to this declaration.
pub const fn ledger( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub const fn metadata( &self ) -> &Matrix
No public source comment is attached to this declaration.
pub fn check_status(&self) -> Result<()>
No public source comment is attached to this declaration.
fn engine( &self ) -> &Engine
No public source comment is attached to this declaration.
fn spec( &self ) -> &EnvironmentSpec
No public source comment is attached to this declaration.
fn environments( &self ) -> u32
No public source comment is attached to this declaration.
fn observation( &self ) -> &Matrix
No public source comment is attached to this declaration.
fn execution( &self ) -> &EnvironmentExecution
No public source comment is attached to this declaration.
fn execution_mut( &mut self ) -> &mut EnvironmentExecution
No public source comment is attached to this declaration.
fn record_reset(&mut self, seed: u64) -> Result<()>
No public source comment is attached to this declaration.
fn record_reset_completed(&mut self) -> Result<()>
No public source comment is attached to this declaration.
fn commit_recorded_state( &mut self )
No public source comment is attached to this declaration.
fn rollback_recorded_state( &mut self )
No public source comment is attached to this declaration.
fn record_step( &mut self, action: &Matrix ) -> Result<EnvironmentTransition>
No public source comment is attached to this declaration.
fn begin(&mut self) -> Result<()>
No public source comment is attached to this declaration.
fn reset(&mut self, seed: u64) -> Result<()>
No public source comment is attached to this declaration.
fn step( &mut self, action: &Matrix ) -> Result<EnvironmentTransition>
No public source comment is attached to this declaration.
fn reset_completed(&mut self) -> Result<()>
No public source comment is attached to this declaration.
fn submit( &mut self ) -> Result<Event>
No public source comment is attached to this declaration.
fn submit_timed( &mut self ) -> Result<Event>
No public source comment is attached to this declaration.
fn wait(&mut self, event: &Event) -> Result<()>
No public source comment is attached to this declaration.
fn cancel(&mut self) -> Result<()>
No public source comment is attached to this declaration.
fn close(&mut self) -> Result<()>
No public source comment is attached to this declaration.
pub fn new( engine: &'engine Engine, config: TradingConfig, series: &[TradingSeries] ) -> Result<Self>
No public source comment is attached to this declaration.
pub fn new_with_row_capacity( engine: &'engine Engine, config: TradingConfig, series: &[TradingSeries], capacity: usize ) -> Result<Self>
No public source comment is attached to this declaration.