Class: Okmain::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/okmain/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(chroma_weight: 0.7, mask_weighted_counts_weight: 0.3) ⇒ Config

Returns a new instance of Config.

Raises:

  • (ArgumentError)


7
8
9
10
11
12
13
# File 'lib/okmain/config.rb', line 7

def initialize(chroma_weight: 0.7, mask_weighted_counts_weight: 0.3)
  raise ArgumentError, "chroma_weight must be between 0 and 1" unless (0.0..1.0).cover?(chroma_weight)
  raise ArgumentError, "mask_weighted_counts_weight must be between 0 and 1" unless (0.0..1.0).cover?(mask_weighted_counts_weight)

  @chroma_weight = chroma_weight.to_f
  @mask_weighted_counts_weight = mask_weighted_counts_weight.to_f
end

Instance Attribute Details

#chroma_weightObject (readonly)

Returns the value of attribute chroma_weight.



5
6
7
# File 'lib/okmain/config.rb', line 5

def chroma_weight
  @chroma_weight
end

#mask_weighted_counts_weightObject (readonly)

Returns the value of attribute mask_weighted_counts_weight.



5
6
7
# File 'lib/okmain/config.rb', line 5

def mask_weighted_counts_weight
  @mask_weighted_counts_weight
end