-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCongestion.h
44 lines (34 loc) · 1005 Bytes
/
Congestion.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef BaseLib_Policy_Congestion_h_IsIncluded
#define BaseLib_Policy_Congestion_h_IsIncluded
#include"BaseLib/Policy/MaxLimit.h"
#include"BaseLib/Export.h"
namespace BaseLib { namespace Policy
{
// ----------------------------------------------
// Policy for congestion control
// ----------------------------------------------
class DLL_STATE Congestion
{
public:
Congestion(MaxLimit<float> increase, MaxLimit<float> decrease)
: increase_(increase)
, decrease_(decrease)
{}
const Policy::MaxLimit<float>& IncreaseRate() const
{
return increase_;
}
const Policy::MaxLimit<float>& DecreaseRate() const
{
return decrease_;
}
static Congestion Create(MaxLimit<float> increase, MaxLimit<float> decrease)
{
return Congestion(increase, decrease);
}
private:
Policy::MaxLimit<float> increase_; // increase rate
Policy::MaxLimit<float> decrease_; // when congestion hits then decrease by rate
};
}}
#endif