Class: Evoc::InterestingnessMeasure

Inherits:
Object
  • Object
show all
Includes:
Comparable, Logging
Defined in:
lib/evoc/interestingness_measure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

configure_logger_for, #logger, logger_for, set_level

Constructor Details

#initialize(type:, min:, mid:, max:, value: nil, hyper_measure: false) ⇒ InterestingnessMeasure

Returns a new instance of InterestingnessMeasure.



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/evoc/interestingness_measure.rb', line 6

def initialize(type:,min:,mid:,max:,value: nil,hyper_measure: false)
  @type = type
  self.min  = min
  self.max  = max
  self.mid  = mid
  self.hyper_measure = hyper_measure
  if block_given?
    self.value = yield
  else
    self.value = value
  end
end

Instance Attribute Details

#hyper_measureObject

Returns the value of attribute hyper_measure.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def hyper_measure
  @hyper_measure
end

#maxObject

Returns the value of attribute max.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def max
  @max
end

#midObject

Returns the value of attribute mid.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def mid
  @mid
end

#minObject

Returns the value of attribute min.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def min
  @min
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def type
  @type
end

#valueObject

Returns the value of attribute value.



4
5
6
# File 'lib/evoc/interestingness_measure.rb', line 4

def value
  @value
end

Instance Method Details

#-@Object



56
57
58
# File 'lib/evoc/interestingness_measure.rb', line 56

def -@
  -self.value
end

#<=>(other) ⇒ Object



51
52
53
54
# File 'lib/evoc/interestingness_measure.rb', line 51

def <=> other
  return nil unless constr_equal_type other
  self.value <=> other.value
end

#finite?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/evoc/interestingness_measure.rb', line 60

def finite?
  self.value.finite?
end

#to_sObject



64
65
66
# File 'lib/evoc/interestingness_measure.rb', line 64

def to_s
  self.value.to_s
end