Method: NudgeType::FloatType.random_value

Defined in:
lib/interpreter/types/pushTypes.rb

.random_value(params = {}) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/interpreter/types/pushTypes.rb', line 108

def self.random_value(params = {})
  bottom = params[:randomFloatLowerBound] || @defaultLowest
  top = params[:randomFloatUpperBound] || @defaultHighest
  bottom, top = [bottom,top].min, [bottom,top].max
  range = top - bottom
  (rand*range) + bottom
end