Class: Engine::SuperMemoStrategy
- Inherits:
-
BaseStrategy
- Object
- Struct
- BaseStrategy
- Engine::SuperMemoStrategy
- Defined in:
- lib/engine/strategies.rb
Constant Summary collapse
- INITIAL_INTERVALS =
[1, 6]
Instance Attribute Summary
Attributes inherited from BaseStrategy
Instance Method Summary collapse
Instance Method Details
#next_factor ⇒ Object
15 16 17 |
# File 'lib/engine/strategies.rb', line 15 def next_factor [factor + (0.1 - * (0.28 + * 0.02)), 1.3].max end |
#next_interval ⇒ Object
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_streak ⇒ Object
11 12 13 |
# File 'lib/engine/strategies.rb', line 11 def next_streak fail? ? 0 : streak + 1 end |