Class: LoadBalancedRestClient::Algorithms::ExponentialDowntime
- Inherits:
-
Object
- Object
- LoadBalancedRestClient::Algorithms::ExponentialDowntime
- Defined in:
- lib/algorithms/exponential_downtime.rb
Instance Method Summary collapse
- #call(x) ⇒ Object
-
#initialize(exp = 2, factor = 60) ⇒ ExponentialDowntime
constructor
A new instance of ExponentialDowntime.
Constructor Details
#initialize(exp = 2, factor = 60) ⇒ ExponentialDowntime
Returns a new instance of ExponentialDowntime.
4 5 6 7 |
# File 'lib/algorithms/exponential_downtime.rb', line 4 def initialize(exp = 2, factor = 60) @e = exp @f = factor end |
Instance Method Details
#call(x) ⇒ Object
9 10 11 |
# File 'lib/algorithms/exponential_downtime.rb', line 9 def call(x) (x ** @e) * @f end |