Class: TypeBalancer::Strategies::SlidingWindowStrategy::WindowSlotCalculator

Inherits:
Object
  • Object
show all
Defined in:
lib/type_balancer/strategies/sliding_window_strategy.rb

Instance Method Summary collapse

Constructor Details

#initialize(type_ratios, type_order) ⇒ WindowSlotCalculator

Returns a new instance of WindowSlotCalculator.



142
143
144
145
# File 'lib/type_balancer/strategies/sliding_window_strategy.rb', line 142

def initialize(type_ratios, type_order)
  @type_ratios = type_ratios
  @type_order  = type_order
end

Instance Method Details

#calculate(window_size) ⇒ Object



147
148
149
150
151
# File 'lib/type_balancer/strategies/sliding_window_strategy.rb', line 147

def calculate(window_size)
  slots = build_initial_slots(window_size)
  distribute_remaining_slots(slots)
  slots
end