pub struct EnvPool {
pub envs: Vec<GameEnv>,
pub action_space: usize,
pub error_policy: ErrorPolicy,
/* private fields */
}Expand description
Pool of independent environments stepped in parallel.
Fields§
§envs: Vec<GameEnv>§action_space: usize§error_policy: ErrorPolicyImplementations§
Source§impl EnvPool
impl EnvPool
pub fn new_rl_train( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
pub fn new_rl_eval( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
pub fn new_debug( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
pub fn reset_into(&mut self, out: &mut BatchOutMinimal<'_>) -> Result<()>
pub fn reset_indices_into( &mut self, indices: &[usize], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
pub fn reset_done_into( &mut self, done_mask: &[bool], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
pub fn step_into( &mut self, action_ids: &[u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
pub fn step_debug_into( &mut self, action_ids: &[u32], out: &mut BatchOutDebug<'_>, ) -> Result<()>
pub fn reset_debug_into(&mut self, out: &mut BatchOutDebug<'_>) -> Result<()>
pub fn reset_indices_debug_into( &mut self, indices: &[usize], out: &mut BatchOutDebug<'_>, ) -> Result<()>
pub fn reset_done_debug_into( &mut self, done_mask: &[bool], out: &mut BatchOutDebug<'_>, ) -> Result<()>
pub fn set_debug_config(&mut self, debug: DebugConfig)
pub fn state_fingerprint_batch(&self) -> Vec<u64>
pub fn engine_error_reset_count(&self) -> u64
pub fn reset_engine_error_reset_count(&mut self)
pub fn auto_reset_on_error_codes_into( &mut self, codes: &[u8], out: &mut BatchOutMinimal<'_>, ) -> Result<usize>
pub fn events_fingerprint_batch(&self) -> Vec<u64>
pub fn action_masks_batch(&self) -> Vec<u8> ⓘ
pub fn action_masks_batch_into(&self, masks: &mut [u8]) -> Result<()>
pub fn legal_action_ids_batch_into( &self, ids: &mut [u16], offsets: &mut [u32], ) -> Result<usize>
pub fn legal_actions_batch(&self) -> Vec<Vec<ActionDesc>>
pub fn get_current_player_batch(&self) -> Vec<i8>
pub fn render_ansi(&self, env_index: usize, perspective: u8) -> String
pub fn set_curriculum(&mut self, curriculum: CurriculumConfig)
pub fn enable_replay_sampling(&mut self, config: ReplayConfig) -> Result<()>
Auto Trait Implementations§
impl Freeze for EnvPool
impl !RefUnwindSafe for EnvPool
impl Send for EnvPool
impl Sync for EnvPool
impl Unpin for EnvPool
impl !UnwindSafe for EnvPool
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more