blob: 6c68ed57ce5edf09b4850eb76382e03c9bf8468f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// -*- C++ -*-
//
// $Id$
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_INLINE CORBA::Float
TAO_LB_LeastLoaded::effective_load (CORBA::Float previous_load,
CORBA::Float new_load)
{
// Apply per-balance load. (Recompute raw load)
previous_load += this->per_balance_load_;
// Apply dampening. (Recompute new raw load)
CORBA::Float result =
this->dampening_ * previous_load + (1 - this->dampening_) * new_load;
ACE_ASSERT (!ACE::is_equal (this->tolerance_, 0.0f));
// Compute the effective load.
result /= this->tolerance_;
return result;
}
TAO_END_VERSIONED_NAMESPACE_DECL
|