Class: FsrsRuby::Parameters

Inherits:
Object
  • Object
show all
Defined in:
lib/fsrs_ruby/models.rb

Overview

Parameters class for FSRS parameters

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_retention: Constants::DEFAULT_REQUEST_RETENTION, maximum_interval: Constants::DEFAULT_MAXIMUM_INTERVAL, w: Constants::DEFAULT_WEIGHTS.dup, enable_fuzz: Constants::DEFAULT_ENABLE_FUZZ, enable_short_term: Constants::DEFAULT_ENABLE_SHORT_TERM, learning_steps: Constants::DEFAULT_LEARNING_STEPS.dup, relearning_steps: Constants::DEFAULT_RELEARNING_STEPS.dup) ⇒ Parameters

Returns a new instance of Parameters.



176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/fsrs_ruby/models.rb', line 176

def initialize(
  request_retention: Constants::DEFAULT_REQUEST_RETENTION,
  maximum_interval: Constants::DEFAULT_MAXIMUM_INTERVAL,
  w: Constants::DEFAULT_WEIGHTS.dup,
  enable_fuzz: Constants::DEFAULT_ENABLE_FUZZ,
  enable_short_term: Constants::DEFAULT_ENABLE_SHORT_TERM,
  learning_steps: Constants::DEFAULT_LEARNING_STEPS.dup,
  relearning_steps: Constants::DEFAULT_RELEARNING_STEPS.dup
)
  @request_retention = request_retention
  @maximum_interval = maximum_interval
  @w = w
  @enable_fuzz = enable_fuzz
  @enable_short_term = enable_short_term
  @learning_steps = learning_steps
  @relearning_steps = relearning_steps
end

Instance Attribute Details

#enable_fuzzObject

Returns the value of attribute enable_fuzz.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def enable_fuzz
  @enable_fuzz
end

#enable_short_termObject

Returns the value of attribute enable_short_term.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def enable_short_term
  @enable_short_term
end

#learning_stepsObject

Returns the value of attribute learning_steps.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def learning_steps
  @learning_steps
end

#maximum_intervalObject

Returns the value of attribute maximum_interval.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def maximum_interval
  @maximum_interval
end

#relearning_stepsObject

Returns the value of attribute relearning_steps.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def relearning_steps
  @relearning_steps
end

#request_retentionObject

Returns the value of attribute request_retention.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def request_retention
  @request_retention
end

#wObject

Returns the value of attribute w.



173
174
175
# File 'lib/fsrs_ruby/models.rb', line 173

def w
  @w
end

Instance Method Details

#to_hObject



194
195
196
197
198
199
200
201
202
203
204
# File 'lib/fsrs_ruby/models.rb', line 194

def to_h
  {
    request_retention: @request_retention,
    maximum_interval: @maximum_interval,
    w: @w,
    enable_fuzz: @enable_fuzz,
    enable_short_term: @enable_short_term,
    learning_steps: @learning_steps,
    relearning_steps: @relearning_steps
  }
end