Class: Engine::SuperMemoStrategy

Inherits:
BaseStrategy show all
Defined in:
lib/engine/strategies.rb

Constant Summary collapse

INITIAL_INTERVALS =
[1, 6]

Instance Attribute Summary

Attributes inherited from BaseStrategy

#card_state, #data_point

Instance Method Summary collapse

Instance Method Details

#next_factorObject



15
16
17
# File 'lib/engine/strategies.rb', line 15

def next_factor
  [factor + (0.1 - neg_rating * (0.28 + neg_rating * 0.02)), 1.3].max
end

#next_intervalObject



19
20
21
22
23
# File 'lib/engine/strategies.rb', line 19

def next_interval
  INITIAL_INTERVALS.fetch(next_streak) do
    interval * next_factor
  end
end

#next_streakObject



11
12
13
# File 'lib/engine/strategies.rb', line 11

def next_streak
  fail? ? 0 : streak + 1
end