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.
§Examples
use std::sync::Arc;
use weiss_core::{
BatchOutMinimalBuffers, CardDb, CurriculumConfig, DebugConfig, EnvConfig, EnvPool,
};
let mut pool = EnvPool::new_rl_train(
8,
Arc::new(db),
config,
CurriculumConfig::default(),
0,
None,
DebugConfig::default(),
)?;
let mut buffers = BatchOutMinimalBuffers::new(pool.envs.len());
let mut out = buffers.view_mut();
pool.reset_into(&mut out)?;
let actions = vec![weiss_core::encode::PASS_ACTION_ID as u32; pool.envs.len()];
pool.step_into(&actions, &mut out)?;Fields§
§envs: Vec<GameEnv>Backing environments (one per slot).
action_space: usizeFixed action space size used by all envs.
error_policy: ErrorPolicyError policy applied during stepping.
Implementations§
Source§impl EnvPool
impl EnvPool
Sourcepub 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_train( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
Create a pool configured for RL training (public visibility + lenient errors).
Sourcepub 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_rl_eval( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
Create a pool configured for RL evaluation (public visibility).
Sourcepub 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 new_debug( num_envs: usize, db: Arc<CardDb>, config: EnvConfig, curriculum: CurriculumConfig, seed: u64, num_threads: Option<usize>, debug: DebugConfig, ) -> Result<Self>
Create a pool with explicit config and curriculum.
Sourcepub fn set_debug_config(&mut self, debug: DebugConfig)
pub fn set_debug_config(&mut self, debug: DebugConfig)
Update debug settings for all envs in the pool.
Sourcepub fn engine_error_reset_count(&self) -> u64
pub fn engine_error_reset_count(&self) -> u64
Count of auto-resets triggered by engine errors.
Sourcepub fn effective_num_threads(&self) -> usize
pub fn effective_num_threads(&self) -> usize
Effective thread count used by this pool (1 when running serially).
Sourcepub fn set_curriculum(&mut self, curriculum: CurriculumConfig)
pub fn set_curriculum(&mut self, curriculum: CurriculumConfig)
Replace curriculum settings for all envs in the pool.
Sourcepub fn set_error_policy(&mut self, error_policy: ErrorPolicy)
pub fn set_error_policy(&mut self, error_policy: ErrorPolicy)
Update error policy for all envs in the pool.
Sourcepub fn set_output_mask_enabled(&mut self, enabled: bool)
pub fn set_output_mask_enabled(&mut self, enabled: bool)
Enable or disable output action masks for all envs.
Sourcepub fn set_output_mask_bits_enabled(&mut self, enabled: bool)
pub fn set_output_mask_bits_enabled(&mut self, enabled: bool)
Enable or disable output action mask bits for all envs.
Sourcepub fn set_i16_clamp_enabled(&mut self, enabled: bool)
pub fn set_i16_clamp_enabled(&mut self, enabled: bool)
Enable or disable i16 clamping for i16 output buffers.
Sourcepub fn set_i16_overflow_counter_enabled(&self, enabled: bool)
pub fn set_i16_overflow_counter_enabled(&self, enabled: bool)
Enable or disable counting of i16 overflows.
Sourcepub fn i16_overflow_count(&self) -> u64
pub fn i16_overflow_count(&self) -> u64
Total count of i16 clamp overflows since last reset.
Sourcepub fn config_hash(&self) -> u64
pub fn config_hash(&self) -> u64
Stable hash of the pool’s config and curriculum.
Sourcepub fn max_card_id(&self) -> u32
pub fn max_card_id(&self) -> u32
Maximum card id available in the underlying database.
Sourcepub fn episode_seed_batch(&self) -> Vec<u64>
pub fn episode_seed_batch(&self) -> Vec<u64>
Episode seeds for each env in the pool.
Sourcepub fn episode_index_batch(&self) -> Vec<u32>
pub fn episode_index_batch(&self) -> Vec<u32>
Episode indices for each env in the pool.
Sourcepub fn env_index_batch(&self) -> Vec<u32>
pub fn env_index_batch(&self) -> Vec<u32>
Environment indices for each env in the pool.
Sourcepub fn starting_player_batch(&self) -> Vec<u8> ⓘ
pub fn starting_player_batch(&self) -> Vec<u8> ⓘ
Starting player for each env in the pool.
Sourcepub fn decision_count_batch(&self) -> Vec<u32>
pub fn decision_count_batch(&self) -> Vec<u32>
Decision counts for each env in the pool.
Sourcepub fn tick_count_batch(&self) -> Vec<u32>
pub fn tick_count_batch(&self) -> Vec<u32>
Tick counts for each env in the pool.
Sourcepub fn enable_replay_sampling(&mut self, config: ReplayConfig) -> Result<()>
pub fn enable_replay_sampling(&mut self, config: ReplayConfig) -> Result<()>
Enable replay sampling for all envs in the pool.
Source§impl EnvPool
impl EnvPool
Sourcepub fn state_fingerprint_batch(&self) -> Vec<u64>
pub fn state_fingerprint_batch(&self) -> Vec<u64>
Compute state fingerprints for each env.
Sourcepub fn events_fingerprint_batch(&self) -> Vec<u64>
pub fn events_fingerprint_batch(&self) -> Vec<u64>
Compute event-stream fingerprints for each env.
Sourcepub fn obs_fingerprint_batch(&self) -> Vec<u64>
pub fn obs_fingerprint_batch(&self) -> Vec<u64>
Compute observation fingerprints for each env.
Source§impl EnvPool
impl EnvPool
Sourcepub fn sample_legal_action_ids_uniform(&self, seeds: &[u64]) -> Result<Vec<u32>>
pub fn sample_legal_action_ids_uniform(&self, seeds: &[u64]) -> Result<Vec<u32>>
Sample a legal action id uniformly per env.
Sourcepub fn sample_legal_action_ids_uniform_into(
&self,
seeds: &[u64],
out: &mut [u32],
) -> Result<()>
pub fn sample_legal_action_ids_uniform_into( &self, seeds: &[u64], out: &mut [u32], ) -> Result<()>
Sample a legal action id uniformly per env into a buffer.
Sourcepub fn first_legal_action_ids_into(&self, out: &mut [u32]) -> Result<()>
pub fn first_legal_action_ids_into(&self, out: &mut [u32]) -> Result<()>
Write the first legal action id per env into a buffer.
Sourcepub fn legal_action_ids_and_sample_uniform_into(
&mut self,
ids: &mut [u16],
offsets: &mut [u32],
seeds: &[u64],
sampled: &mut [u32],
) -> Result<usize>
pub fn legal_action_ids_and_sample_uniform_into( &mut self, ids: &mut [u16], offsets: &mut [u32], seeds: &[u64], sampled: &mut [u32], ) -> Result<usize>
Fill legal-id buffers and sample one action per env.
Sourcepub fn legal_action_ids_batch_into(
&mut self,
ids: &mut [u16],
offsets: &mut [u32],
) -> Result<usize>
pub fn legal_action_ids_batch_into( &mut self, ids: &mut [u16], offsets: &mut [u32], ) -> Result<usize>
Fill legal-id buffers for all envs.
Sourcepub fn legal_actions_batch(&self) -> Vec<Vec<ActionDesc>>
pub fn legal_actions_batch(&self) -> Vec<Vec<ActionDesc>>
Compute legal action descriptors for all envs.
Sourcepub fn get_current_player_batch(&self) -> Vec<i8>
pub fn get_current_player_batch(&self) -> Vec<i8>
Current decision player per env (-1 if none).
Source§impl EnvPool
impl EnvPool
Sourcepub fn action_masks_batch(&self) -> Result<Vec<u8>>
pub fn action_masks_batch(&self) -> Result<Vec<u8>>
Fetch dense action masks for all envs.
Sourcepub fn action_masks_batch_into(&self, masks: &mut [u8]) -> Result<()>
pub fn action_masks_batch_into(&self, masks: &mut [u8]) -> Result<()>
Fill a provided buffer with dense action masks.
Sourcepub fn action_mask_bits_batch(&self) -> Vec<u64>
pub fn action_mask_bits_batch(&self) -> Vec<u64>
Fetch packed action mask bits for all envs.
Sourcepub fn action_mask_bits_batch_into(&self, bits: &mut [u64]) -> Result<()>
pub fn action_mask_bits_batch_into(&self, bits: &mut [u64]) -> Result<()>
Fill a provided buffer with packed action mask bits.
Source§impl EnvPool
impl EnvPool
Sourcepub fn debug_event_ring_capacity(&self) -> usize
pub fn debug_event_ring_capacity(&self) -> usize
Debug event ring capacity configured for the pool.
Sourcepub fn render_ansi(&self, env_index: usize, perspective: u8) -> String
pub fn render_ansi(&self, env_index: usize, perspective: u8) -> String
Render a single env to an ANSI string for debugging.
Source§impl EnvPool
impl EnvPool
Sourcepub fn select_actions_from_logits_into(
&self,
logits: &[f32],
out: &mut [u32],
) -> Result<()>
pub fn select_actions_from_logits_into( &self, logits: &[f32], out: &mut [u32], ) -> Result<()>
Select the best legal action per env from logits (argmax).
Sourcepub fn sample_actions_from_logits_into(
&self,
logits: &[f32],
seeds: &[u64],
out: &mut [u32],
) -> Result<()>
pub fn sample_actions_from_logits_into( &self, logits: &[f32], seeds: &[u64], out: &mut [u32], ) -> Result<()>
Sample a legal action per env from logits using softmax.
Sourcepub fn step_select_from_logits_into(
&mut self,
logits: &[f32],
actions: &mut [u32],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn step_select_from_logits_into( &mut self, logits: &[f32], actions: &mut [u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Select from logits and step, filling minimal outputs.
Sourcepub fn step_select_from_logits_into_i16(
&mut self,
logits: &[f32],
actions: &mut [u32],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn step_select_from_logits_into_i16( &mut self, logits: &[f32], actions: &mut [u32], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Select from logits and step, filling i16 outputs.
Sourcepub fn step_select_from_logits_into_nomask(
&mut self,
logits: &[f32],
actions: &mut [u32],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn step_select_from_logits_into_nomask( &mut self, logits: &[f32], actions: &mut [u32], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Select from logits and step, filling outputs without masks.
Sourcepub fn step_select_from_logits_into_i16_legal_ids(
&mut self,
logits: &[f32],
actions: &mut [u32],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn step_select_from_logits_into_i16_legal_ids( &mut self, logits: &[f32], actions: &mut [u32], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Select from logits and step, filling i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn step_sample_from_logits_into(
&mut self,
logits: &[f32],
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn step_sample_from_logits_into( &mut self, logits: &[f32], seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Sample from logits and step, filling minimal outputs.
Sourcepub fn step_sample_from_logits_into_i16(
&mut self,
logits: &[f32],
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn step_sample_from_logits_into_i16( &mut self, logits: &[f32], seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Sample from logits and step, filling i16 outputs.
Sourcepub fn step_sample_from_logits_into_nomask(
&mut self,
logits: &[f32],
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn step_sample_from_logits_into_nomask( &mut self, logits: &[f32], seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Sample from logits and step, filling outputs without masks.
Sourcepub fn step_sample_from_logits_into_i16_legal_ids(
&mut self,
logits: &[f32],
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn step_sample_from_logits_into_i16_legal_ids( &mut self, logits: &[f32], seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Sample from logits and step, filling i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Source§impl EnvPool
impl EnvPool
Sourcepub fn reset_into(&mut self, out: &mut BatchOutMinimal<'_>) -> Result<()>
pub fn reset_into(&mut self, out: &mut BatchOutMinimal<'_>) -> Result<()>
Reset all envs and fill a minimal output batch (i32 obs + masks).
Sourcepub fn reset_into_i16(&mut self, out: &mut BatchOutMinimalI16<'_>) -> Result<()>
pub fn reset_into_i16(&mut self, out: &mut BatchOutMinimalI16<'_>) -> Result<()>
Reset all envs and fill a minimal output batch (i16 obs + masks).
Sourcepub fn reset_into_i16_legal_ids(
&mut self,
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn reset_into_i16_legal_ids( &mut self, out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Reset all envs and fill i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn reset_into_nomask(
&mut self,
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn reset_into_nomask( &mut self, out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Reset all envs and fill a minimal output batch without masks.
Sourcepub fn reset_indices_into(
&mut self,
indices: &[usize],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn reset_indices_into( &mut self, indices: &[usize], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Reset a subset of envs by index and fill minimal outputs.
Returns Err if any index is out of bounds (>= num_envs).
Sourcepub fn reset_indices_into_i16(
&mut self,
indices: &[usize],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn reset_indices_into_i16( &mut self, indices: &[usize], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs by index and fill i16 outputs.
Sourcepub fn reset_indices_into_i16_legal_ids(
&mut self,
indices: &[usize],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn reset_indices_into_i16_legal_ids( &mut self, indices: &[usize], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs by index and fill i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn reset_indices_into_nomask(
&mut self,
indices: &[usize],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn reset_indices_into_nomask( &mut self, indices: &[usize], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs by index and fill outputs without masks.
Sourcepub fn reset_done_into(
&mut self,
done_mask: &[bool],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn reset_done_into( &mut self, done_mask: &[bool], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Reset envs where done_mask is true and fill minimal outputs.
Sourcepub fn reset_done_into_i16(
&mut self,
done_mask: &[bool],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn reset_done_into_i16( &mut self, done_mask: &[bool], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Reset envs where done_mask is true and fill i16 outputs.
Sourcepub fn reset_done_into_i16_legal_ids(
&mut self,
done_mask: &[bool],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn reset_done_into_i16_legal_ids( &mut self, done_mask: &[bool], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Reset envs where done_mask is true and fill i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn reset_done_into_nomask(
&mut self,
done_mask: &[bool],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn reset_done_into_nomask( &mut self, done_mask: &[bool], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Reset envs where done_mask is true and fill outputs without masks.
Sourcepub fn reset_debug_into(&mut self, out: &mut BatchOutDebug<'_>) -> Result<()>
pub fn reset_debug_into(&mut self, out: &mut BatchOutDebug<'_>) -> Result<()>
Reset all envs and fill debug outputs.
Sourcepub fn reset_indices_debug_into(
&mut self,
indices: &[usize],
out: &mut BatchOutDebug<'_>,
) -> Result<()>
pub fn reset_indices_debug_into( &mut self, indices: &[usize], out: &mut BatchOutDebug<'_>, ) -> Result<()>
Reset a subset of envs by index and fill debug outputs.
Sourcepub fn reset_done_debug_into(
&mut self,
done_mask: &[bool],
out: &mut BatchOutDebug<'_>,
) -> Result<()>
pub fn reset_done_debug_into( &mut self, done_mask: &[bool], out: &mut BatchOutDebug<'_>, ) -> Result<()>
Reset envs where done_mask is true and fill debug outputs.
Sourcepub fn reset_engine_error_reset_count(&mut self)
pub fn reset_engine_error_reset_count(&mut self)
Clear the engine error reset counter.
Sourcepub fn auto_reset_on_error_codes_into(
&mut self,
codes: &[u8],
out: &mut BatchOutMinimal<'_>,
) -> Result<usize>
pub fn auto_reset_on_error_codes_into( &mut self, codes: &[u8], out: &mut BatchOutMinimal<'_>, ) -> Result<usize>
Auto-reset envs with non-zero error codes and fill minimal outputs.
Sourcepub fn auto_reset_on_error_codes_into_nomask(
&mut self,
codes: &[u8],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<usize>
pub fn auto_reset_on_error_codes_into_nomask( &mut self, codes: &[u8], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<usize>
Auto-reset envs with non-zero error codes and fill outputs without masks.
Sourcepub fn reset_i16_overflow_count(&self)
pub fn reset_i16_overflow_count(&self)
Clear the i16 overflow counter.
Sourcepub fn reset_indices_with_episode_seeds_into(
&mut self,
indices: &[usize],
episode_seeds: &[u64],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn reset_indices_with_episode_seeds_into( &mut self, indices: &[usize], episode_seeds: &[u64], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs with explicit episode seeds and fill minimal outputs.
Sourcepub fn reset_indices_with_episode_seeds_into_i16(
&mut self,
indices: &[usize],
episode_seeds: &[u64],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn reset_indices_with_episode_seeds_into_i16( &mut self, indices: &[usize], episode_seeds: &[u64], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs with explicit episode seeds and fill i16 outputs.
Sourcepub fn reset_indices_with_episode_seeds_into_i16_legal_ids(
&mut self,
indices: &[usize],
episode_seeds: &[u64],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn reset_indices_with_episode_seeds_into_i16_legal_ids( &mut self, indices: &[usize], episode_seeds: &[u64], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs with explicit episode seeds and fill i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn reset_indices_with_episode_seeds_into_nomask(
&mut self,
indices: &[usize],
episode_seeds: &[u64],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn reset_indices_with_episode_seeds_into_nomask( &mut self, indices: &[usize], episode_seeds: &[u64], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Returns Err if any index is out of bounds (>= num_envs). Reset a subset of envs with explicit episode seeds and fill outputs without masks.
Source§impl EnvPool
impl EnvPool
Sourcepub fn step_into(
&mut self,
action_ids: &[u32],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn step_into( &mut self, action_ids: &[u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Step all envs with action ids and fill minimal outputs.
Sourcepub fn step_into_i16(
&mut self,
action_ids: &[u32],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn step_into_i16( &mut self, action_ids: &[u32], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Step all envs with action ids and fill i16 outputs.
Sourcepub fn step_into_i16_legal_ids(
&mut self,
action_ids: &[u32],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn step_into_i16_legal_ids( &mut self, action_ids: &[u32], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Step all envs and fill i16 outputs plus legal-id lists.
Requires output masks to be disabled.
Sourcepub fn step_into_nomask(
&mut self,
action_ids: &[u32],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn step_into_nomask( &mut self, action_ids: &[u32], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Step all envs and fill outputs without masks.
Sourcepub fn step_first_legal_into_i16_legal_ids(
&mut self,
actions: &mut [u32],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn step_first_legal_into_i16_legal_ids( &mut self, actions: &mut [u32], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Step using the first legal action per env (i16 + legal ids).
Sourcepub fn step_sample_legal_action_ids_uniform_into_i16_legal_ids(
&mut self,
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalI16LegalIds<'_>,
) -> Result<()>
pub fn step_sample_legal_action_ids_uniform_into_i16_legal_ids( &mut self, seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalI16LegalIds<'_>, ) -> Result<()>
Step using uniformly sampled legal actions (i16 + legal ids).
Sourcepub fn step_debug_into(
&mut self,
action_ids: &[u32],
out: &mut BatchOutDebug<'_>,
) -> Result<()>
pub fn step_debug_into( &mut self, action_ids: &[u32], out: &mut BatchOutDebug<'_>, ) -> Result<()>
Step all envs and fill debug outputs.
Sourcepub fn step_first_legal_into(
&mut self,
actions: &mut [u32],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn step_first_legal_into( &mut self, actions: &mut [u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Step using the first legal action per env.
Sourcepub fn step_first_legal_into_i16(
&mut self,
actions: &mut [u32],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn step_first_legal_into_i16( &mut self, actions: &mut [u32], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Step using the first legal action per env (i16 outputs).
Sourcepub fn step_first_legal_into_nomask(
&mut self,
actions: &mut [u32],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn step_first_legal_into_nomask( &mut self, actions: &mut [u32], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Step using the first legal action per env (no masks).
Sourcepub fn step_sample_legal_action_ids_uniform_into(
&mut self,
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimal<'_>,
) -> Result<()>
pub fn step_sample_legal_action_ids_uniform_into( &mut self, seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimal<'_>, ) -> Result<()>
Step using uniformly sampled legal actions.
Sourcepub fn step_sample_legal_action_ids_uniform_into_i16(
&mut self,
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalI16<'_>,
) -> Result<()>
pub fn step_sample_legal_action_ids_uniform_into_i16( &mut self, seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalI16<'_>, ) -> Result<()>
Step using uniformly sampled legal actions (i16 outputs).
Sourcepub fn step_sample_legal_action_ids_uniform_into_nomask(
&mut self,
seeds: &[u64],
actions: &mut [u32],
out: &mut BatchOutMinimalNoMask<'_>,
) -> Result<()>
pub fn step_sample_legal_action_ids_uniform_into_nomask( &mut self, seeds: &[u64], actions: &mut [u32], out: &mut BatchOutMinimalNoMask<'_>, ) -> Result<()>
Step using uniformly sampled legal actions (no masks).
Sourcepub fn rollout_first_legal_into(
&mut self,
steps: usize,
out: &mut BatchOutTrajectory<'_>,
) -> Result<()>
pub fn rollout_first_legal_into( &mut self, steps: usize, out: &mut BatchOutTrajectory<'_>, ) -> Result<()>
Roll out a trajectory using first legal actions.
Sourcepub fn rollout_first_legal_into_i16(
&mut self,
steps: usize,
out: &mut BatchOutTrajectoryI16<'_>,
) -> Result<()>
pub fn rollout_first_legal_into_i16( &mut self, steps: usize, out: &mut BatchOutTrajectoryI16<'_>, ) -> Result<()>
Roll out a trajectory using first legal actions (i16 outputs).
Sourcepub fn rollout_first_legal_into_i16_legal_ids(
&mut self,
steps: usize,
out: &mut BatchOutTrajectoryI16LegalIds<'_>,
) -> Result<()>
pub fn rollout_first_legal_into_i16_legal_ids( &mut self, steps: usize, out: &mut BatchOutTrajectoryI16LegalIds<'_>, ) -> Result<()>
Roll out a trajectory using first legal actions (i16 + legal ids).
Requires output masks to be disabled.
Sourcepub fn rollout_first_legal_into_nomask(
&mut self,
steps: usize,
out: &mut BatchOutTrajectoryNoMask<'_>,
) -> Result<()>
pub fn rollout_first_legal_into_nomask( &mut self, steps: usize, out: &mut BatchOutTrajectoryNoMask<'_>, ) -> Result<()>
Roll out a trajectory using first legal actions (no masks).
Sourcepub fn rollout_sample_legal_action_ids_uniform_into(
&mut self,
steps: usize,
seeds: &[u64],
out: &mut BatchOutTrajectory<'_>,
) -> Result<()>
pub fn rollout_sample_legal_action_ids_uniform_into( &mut self, steps: usize, seeds: &[u64], out: &mut BatchOutTrajectory<'_>, ) -> Result<()>
Roll out a trajectory using uniformly sampled legal actions.
Sourcepub fn rollout_sample_legal_action_ids_uniform_into_i16(
&mut self,
steps: usize,
seeds: &[u64],
out: &mut BatchOutTrajectoryI16<'_>,
) -> Result<()>
pub fn rollout_sample_legal_action_ids_uniform_into_i16( &mut self, steps: usize, seeds: &[u64], out: &mut BatchOutTrajectoryI16<'_>, ) -> Result<()>
Roll out a trajectory using uniformly sampled legal actions (i16 outputs).
Sourcepub fn rollout_sample_legal_action_ids_uniform_into_i16_legal_ids(
&mut self,
steps: usize,
seeds: &[u64],
out: &mut BatchOutTrajectoryI16LegalIds<'_>,
) -> Result<()>
pub fn rollout_sample_legal_action_ids_uniform_into_i16_legal_ids( &mut self, steps: usize, seeds: &[u64], out: &mut BatchOutTrajectoryI16LegalIds<'_>, ) -> Result<()>
Roll out a trajectory using uniformly sampled legal actions (i16 + legal ids).
Requires output masks to be disabled.
Sourcepub fn rollout_sample_legal_action_ids_uniform_into_nomask(
&mut self,
steps: usize,
seeds: &[u64],
out: &mut BatchOutTrajectoryNoMask<'_>,
) -> Result<()>
pub fn rollout_sample_legal_action_ids_uniform_into_nomask( &mut self, steps: usize, seeds: &[u64], out: &mut BatchOutTrajectoryNoMask<'_>, ) -> Result<()>
Roll out a trajectory using uniformly sampled legal actions (no masks).
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
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>
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>
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