Scheduler

class mnemosyne.libmnemosyne.scheduler.Scheduler(component_manager)
active_count()
card_count_scheduled_n_days_from_now(n)

Yesterday: n=-1, today: n=0, tomorrow: n=1, ... .

Is not implemented in the database, because this could need internal scheduler information.

grade_answer(card, new_grade, dry_run=False)
heartbeat()

For code that needs to run periodically.

is_in_queue(card)

To check whether the queue needs to be rebuilt, e.g. if it contains a card that was deleted in the GUI.

is_prefetch_allowed()

Can we display a new card before having processed the grading of the previous one?

last_rep_to_interval_string(last_rep, now=None)

Converts last_rep to a string like ‘yesterday’, ‘2 weeks ago’, ...

next_card(learn_ahead=False)
next_rep_to_interval_string(next_rep, now=None)

Converts next_rep to a string like ‘tomorrow’, ‘in 2 weeks’, ...

non_memorised_count()
rebuild_queue(learn_ahead=False)

Called by the rest of the library when an existing queue risks becoming invalid, e.g. when cards have been deleted in the GUI. ‘next_card’ also makes use of this in certain implementations.

remove_from_queue_if_present(card)
reset()

Called when starting the scheduler for the first time.

scheduled_count()
set_initial_grade(card, grade)

Called when cards are given their initial grade outside of the review process, e.g. when the user gives an initial grade when adding a new card in the GUI. Therefore, ‘unseen’ is still left to True, as this card has not yet been seen in the interactive review process.

Cards which don’t have initial grade information available (e.g. for cards created during import or conversion from different card type), get their initial grade when they are encountered in the interactive review process for the first time.

In both cases, this initial grading is seen as the first repetition.

In this way, both types of cards are treated in the same way. (There is an ineffectual asymmetry left in the log messages they generate, but all the relevant information can still be parsed from them.)

Previous topic

Plugin

Next topic

Stopwatch

This Page