Class: Rhod::Backoffs::Logarithmic

Inherits:
Backoff
  • Object
show all
Defined in:
lib/rhod/backoffs/logarithmic.rb

Instance Attribute Summary

Attributes inherited from Backoff

#state

Instance Method Summary collapse

Methods inherited from Backoff

#initialize, #next

Constructor Details

This class inherits a constructor from Rhod::Backoffs::Backoff

Instance Method Details

#iterate(state) ⇒ Object



2
3
4
# File 'lib/rhod/backoffs/logarithmic.rb', line 2

def iterate(state)
  [state + 1, Math.log2((state)**2)]
end