use crate::StateId;
use std::rc::Rc;
#[derive(Debug, Clone)]
pub struct RandState {
pub state_id: StateId,
pub nsamples: usize,
pub length: usize,
pub select: usize,
pub parent: Option<Rc<RandState>>,
}
impl RandState {
pub fn new(state_id: StateId) -> Self {
Self {
state_id,
nsamples: 0,
length: 0,
select: 0,
parent: None,
}
}
pub fn with_nsamples(self, nsamples: usize) -> Self {
Self { nsamples, ..self }
}
pub fn with_length(self, length: usize) -> Self {
Self { length, ..self }
}
pub fn with_select(self, select: usize) -> Self {
Self { select, ..self }
}
pub fn with_parent(self, parent: Option<Rc<Self>>) -> Self {
Self { parent, ..self }
}
}