Class: Variation::SigmoidChange

Inherits:
Change
  • Object
show all
Defined in:
lib/variation/changes/sigmoid_change.rb

Instance Attribute Summary

Attributes inherited from Change

#end_value, #length

Instance Method Summary collapse

Methods inherited from Change

#==

Constructor Details

#initialize(hashed_args) ⇒ SigmoidChange

Pass :length and :end_value by hash. Length must be > 0.



4
5
6
7
# File 'lib/variation/changes/sigmoid_change.rb', line 4

def initialize hashed_args
  super(hashed_args)
  @abruptness = hashed_args[:abruptness] || 0.5
end

Instance Method Details

#transition_function(start_point) ⇒ Object



9
10
11
12
# File 'lib/variation/changes/sigmoid_change.rb', line 9

def transition_function start_point
  end_point = [start_point[0] + length, end_value]
  SigmoidFunction.from_points start_point, end_point, @abruptness
end