Vanetza
Loading...
Searching...
No Matches
channel_load.cpp
1
#
include
"channel_load.hpp"
2
3
namespace
vanetza
4
{
5
namespace
dcc
6
{
7
8
ChannelLoad
::ChannelLoad(
const
UnitInterval
& interval) :
9
UnitInterval
(interval)
10
{
11
}
12
13
ChannelLoad
::
ChannelLoad
(
unsigned
probes_busy,
unsigned
probes_total) :
14
UnitInterval
(
create_from_probes
(
probes_busy
,
probes_total
)
)
15
{
16
}
17
18
UnitInterval
ChannelLoad
::
create_from_probes
(
unsigned
probes_busy,
unsigned
probes_total)
19
{
20
double
fraction = 0.0;
21
if
(probes_total != 0) {
22
fraction = probes_busy;
23
fraction /= probes_total;
24
}
25
26
return
UnitInterval
(fraction);
27
}
28
29
}
// namespace dcc
30
}
// namespace vanetza
vanetza::UnitInterval
Definition
unit_interval.hpp:24
vanetza::dcc::ChannelLoad
Definition
channel_load.hpp:12
vanetza::dcc::ChannelLoad::ChannelLoad
ChannelLoad(unsigned probes_busy, unsigned probes_total)
Definition
channel_load.cpp:13
vanetza::dcc::ChannelLoad::create_from_probes
static UnitInterval create_from_probes(unsigned probes_busy, unsigned probes_total)
Definition
channel_load.cpp:18
vanetza
dcc
channel_load.cpp
Generated on
for Vanetza by
1.16.1