Vanetza
 
Loading...
Searching...
No Matches
cbr_aggregator.hpp
1#ifndef CBR_AGGREGATOR_HPP_VUGJW6BW
2#define CBR_AGGREGATOR_HPP_VUGJW6BW
3
4#include <vanetza/dcc/channel_load.hpp>
5#include <vanetza/geonet/timestamp.hpp>
6#include <array>
7
8namespace vanetza
9{
10namespace geonet
11{
12
13class LocationTable;
14
15
16/**
17 * CbrAggregator realises the CBR aggregration as specified by TS 102 636-4-2 V1.1.1, section 5.2.2
18 *
19 * Since this algorithm relies mainly on location table entries it is placed in the geonet module.
20 */
22{
23public:
25
27
28 /**
29 * Get local channel busy ratio, i.e. CBR_L_0_Hop
30 * \return CBR
31 */
32 ChannelLoad get_local_cbr() const { return m_local_cbr[0]; }
33
34 /**
35 * Get one-hop channel busy ratio, i.e. CBR_L_1_Hop
36 * \return CBR
37 */
38 ChannelLoad get_one_hop_cbr() const { return m_one_hop_cbr; }
39
40 /**
41 * Get two-hop channel busy ratio, i.e. CBR_L_2_Hop
42 * \return CBR
43 */
44 ChannelLoad get_two_hop_cbr() const { return m_two_hop_cbr; }
45
46 /**
47 * Get global channel busy ratio
48 * \return CBR
49 */
50 ChannelLoad get_global_cbr() const { return m_global_cbr; }
51
52 /**
53 * Aggregate {1,2}-hop CBRs from received CBR values stored in location table
54 * \parame local most recent local CBR measurement CBR_L_0_Hop
55 * \param lt location table containing LocTEX_G5 entries
56 * \param cbr_lifetime reject entries older than T_cbr
57 * \param cbr_target reference value
58 */
59 void aggregate(ChannelLoad cbr_local, const LocationTable& lt, Timestamp cbr_lifetime, ChannelLoad cbr_target);
60
61private:
62 std::array<ChannelLoad, 2> m_local_cbr;
63 ChannelLoad m_one_hop_cbr;
64 ChannelLoad m_two_hop_cbr;
65 ChannelLoad m_global_cbr;
66};
67
68} // namespace geonet
69} // namespace vanetza
70
71#endif /* CBR_AGGREGATOR_HPP_VUGJW6BW */
72
ChannelLoad get_two_hop_cbr() const
ChannelLoad get_global_cbr() const
ChannelLoad get_local_cbr() const
void aggregate(ChannelLoad cbr_local, const LocationTable &lt, Timestamp cbr_lifetime, ChannelLoad cbr_target)
ChannelLoad get_one_hop_cbr() const