Skip to main content

DepthFirstScheduler

Struct DepthFirstScheduler 

Source
pub struct DepthFirstScheduler { /* private fields */ }
Expand description

An implementation of ExerciseScheduler based on depth-first search.

Implementations§

Source§

impl DepthFirstScheduler

Source

pub fn new(data: SchedulerData) -> Self

Creates a new scheduler.

Source

pub fn get_course_valid_starting_lessons( &self, course_id: Ustr, metadata_filter: Option<&KeyValueFilter>, ) -> Result<Vec<Ustr>>

Returns the lessons in the course that have no dependencies with other lessons in the course and whose dependencies are satisfied.

Trait Implementations§

Source§

impl ExerciseScheduler for DepthFirstScheduler

Source§

fn get_exercise_batch( &self, filter: Option<ExerciseFilter>, ) -> Result<Vec<ExerciseManifest>, ExerciseSchedulerError>

Gets a new batch of exercises scheduled for a new trial. Contains an optimal filter to restrict the units visited during the search with the purpose of allowing students to choose which material to practice. If the filter is not provided, the scheduler will search the entire graph.
Source§

fn score_exercise( &self, exercise_id: Ustr, score: MasteryScore, timestamp: i64, ) -> Result<(), ExerciseSchedulerError>

Records the score of the given exercise’s trial. The scores are used by the scheduler to decide when to stop traversing a path and how to sort and filter all the found candidates into a final batch.
Source§

fn get_unit_score( &self, unit_id: Ustr, ) -> Result<Option<f32>, ExerciseSchedulerError>

Gets the score for the given unit. The unit can be a course, lesson, or exercise.
Source§

fn invalidate_cached_score(&self, unit_id: Ustr)

Removes any cached scores for the given unit. The score will be recomputed the next time the score is needed. Read more
Source§

fn invalidate_cached_scores_with_prefix(&self, prefix: &str)

Removes any cached scores from units with the given prefix. The same considerations as invalidate_cached_score apply.
Source§

fn get_scheduler_options(&self) -> SchedulerOptions

Returns the options used to control the behavior of the scheduler.
Source§

fn set_scheduler_options(&mut self, options: SchedulerOptions)

Sets the options used to control the behavior of the scheduler.
Source§

fn reset_scheduler_options(&mut self)

Resets the options used to control the behavior of the scheduler to their default values.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V