use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use super::super::{
ActionIndexMapper, Budget, CFRState, InFlightLimiter, TraversalSet, TraversalState,
action_generator::ActionGenerator,
};
use super::hand_log::HandLog;
use crate::arena::HandDistributionEstimator;
pub(super) struct ComputeRewardContext<T: ActionGenerator> {
pub(super) traversal_set: TraversalSet,
pub(super) traversal_state: TraversalState,
pub(super) cfr_state: CFRState,
pub(super) action_gen_config: Arc<T::Config>,
pub(super) action_index_mapper: ActionIndexMapper,
pub(super) limiter: InFlightLimiter,
pub(super) budget: Arc<dyn Budget>,
pub(super) stop: Arc<AtomicBool>,
pub(super) depth: usize,
pub(super) fast_forward: bool,
pub(super) allow_node_mutation: bool,
pub(super) estimator: Arc<dyn HandDistributionEstimator>,
pub(super) hand_log: Option<HandLog>,
}
impl<T: ActionGenerator> Clone for ComputeRewardContext<T> {
fn clone(&self) -> Self {
Self {
traversal_set: self.traversal_set.clone(),
traversal_state: self.traversal_state.clone(),
cfr_state: self.cfr_state.clone(),
action_gen_config: self.action_gen_config.clone(),
action_index_mapper: self.action_index_mapper.clone(),
limiter: self.limiter.clone(),
budget: self.budget.clone(),
stop: self.stop.clone(),
depth: self.depth,
fast_forward: self.fast_forward,
allow_node_mutation: self.allow_node_mutation,
estimator: self.estimator.clone(),
hand_log: self.hand_log.clone(),
}
}
}