pub struct SimulatorConfig {Show 17 fields
pub deck_size: usize,
pub learn_span: usize,
pub max_cost_perday: f32,
pub max_ivl: f32,
pub first_rating_prob: [f32; 4],
pub review_rating_prob: [f32; 3],
pub learn_limit: usize,
pub review_limit: usize,
pub new_cards_ignore_review_limit: bool,
pub suspend_after_lapses: Option<u32>,
pub post_scheduling_fn: Option<PostSchedulingFn>,
pub review_priority_fn: Option<ReviewPriorityFn>,
pub learning_step_transitions: [[f32; 4]; 3],
pub relearning_step_transitions: [[f32; 4]; 3],
pub state_rating_costs: [[f32; 4]; 3],
pub learning_step_count: usize,
pub relearning_step_count: usize,
}Fields§
§deck_size: usize§learn_span: usize§max_cost_perday: f32§max_ivl: f32§first_rating_prob: [f32; 4]§review_rating_prob: [f32; 3]§learn_limit: usize§review_limit: usize§new_cards_ignore_review_limit: bool§suspend_after_lapses: Option<u32>§post_scheduling_fn: Option<PostSchedulingFn>§review_priority_fn: Option<ReviewPriorityFn>§learning_step_transitions: [[f32; 4]; 3]§relearning_step_transitions: [[f32; 4]; 3]§state_rating_costs: [[f32; 4]; 3]§learning_step_count: usize§relearning_step_count: usizeImplementations§
Source§impl SimulatorConfig
impl SimulatorConfig
Sourcepub fn with_review_priority<F>(self, f: F) -> Self
pub fn with_review_priority<F>(self, f: F) -> Self
Set the review priority callback.
use fsrs::{Card, SimulatorConfig};
let config = SimulatorConfig::default()
.with_review_priority(|card: &Card| (card.difficulty * 100.0) as i32);Sourcepub fn with_post_scheduling<F>(self, f: F) -> Self
pub fn with_post_scheduling<F>(self, f: F) -> Self
Set the post scheduling callback.
use fsrs::{PostSchedulingContext, SimulatorConfig};
let config = SimulatorConfig::default()
.with_post_scheduling(|mut ctx: PostSchedulingContext<'_>| {
let fuzz = ctx.random_f32();
if fuzz >= 0.0 { ctx.card.interval } else { 1.0 }
});Trait Implementations§
Source§impl Debug for SimulatorConfig
impl Debug for SimulatorConfig
Source§impl Default for SimulatorConfig
impl Default for SimulatorConfig
Source§impl PartialEq for SimulatorConfig
impl PartialEq for SimulatorConfig
impl StructuralPartialEq for SimulatorConfig
Auto Trait Implementations§
impl !RefUnwindSafe for SimulatorConfig
impl !UnwindSafe for SimulatorConfig
impl Freeze for SimulatorConfig
impl Send for SimulatorConfig
impl Sync for SimulatorConfig
impl Unpin for SimulatorConfig
impl UnsafeUnpin for SimulatorConfig
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