Vanetza
 
Loading...
Searching...
No Matches
channel_load.hpp
1#ifndef CHANNEL_LOAD_HPP_D1JOCNLP
2#define CHANNEL_LOAD_HPP_D1JOCNLP
3
4#include <vanetza/common/unit_interval.hpp>
5
6namespace vanetza
7{
8namespace dcc
9{
10
12{
13public:
14 using UnitInterval::UnitInterval;
15 ChannelLoad() = default;
17
18 /**
19 * Create ChannelLoad from rational probes
20 * \see ChannelLoad::create_from_probes
21 *
22 * \param probes_busy number of probes above busy threshold
23 * \param probes_total total number of probes
24 */
25 ChannelLoad(unsigned probes_busy, unsigned probes_total);
26
27 /**
28 * Calculate UnitInterval representing ChannelLoad from rational probes
29 * \param probes_busy number of probes above busy threshold
30 * \param probes_total total number of probes
31 * \return interval representing channel load (capped if probes_total < probes_busy)
32 */
33 static UnitInterval create_from_probes(unsigned probes_busy, unsigned probes_total);
34};
35
36} // namespace dcc
37} // namespace vanetza
38
39#endif /* CHANNEL_LOAD_HPP_D1JOCNLP */
40
static UnitInterval create_from_probes(unsigned probes_busy, unsigned probes_total)