Vanetza
Loading...
Searching...
No Matches
dcc_information_sharing.hpp
1
#ifndef DCC_INFORMATION_SHARING_HPP_GZCSHZLD
2
#define DCC_INFORMATION_SHARING_HPP_GZCSHZLD
3
4
#include <vanetza/common/clock.hpp>
5
#include <vanetza/common/hook.hpp>
6
#include <vanetza/common/unit_interval.hpp>
7
#include <vanetza/geonet/cbr_aggregator.hpp>
8
#include <vanetza/geonet/dcc_field_generator.hpp>
9
10
namespace
vanetza
11
{
12
13
class
Runtime;
14
15
namespace
geonet
16
{
17
18
class
LocationTable;
19
20
/**
21
* DccInformationSharing realises the DCC_net behaviour for ITS-G5
22
* \see TS 102 636-4-2 V1.1.1
23
*
24
* CBR_target mentioned in TS 102 636-4-2 V1.1.1 is probably the same constant as
25
* NDL_maxChannelUse mentioned in TS 102 687 V1.1.1. However, no value is given:
26
* Table A.3 in TS 102 687 declares them (implicitly through NDL_tmPacketArrivalrate) "n.a.".
27
* Thus, we simply assume CBR_target = NDL_maxChannelUse = NDL_maxChannelLoad.
28
*/
29
class
DccInformationSharing
:
public
DccFieldGenerator
30
{
31
public
:
32
/**
33
* Create DCC_net instance
34
*
35
* \param rt Runtime for scheduling periodic update cycles
36
* \param lt Location Table with LocTEX_G5 entries
37
* \param target CBR_target value (usually NDL_maxChannelLoad)
38
* \param delay Delaying first update cycle randomly
39
*
40
* \note Set random delay interval when multiple stations are created at the same time!
41
* Values shall be distributed uniformly across full integer range.
42
*/
43
DccInformationSharing
(
Runtime
& rt,
const
LocationTable
& lt,
dcc::ChannelLoad
target,
UnitInterval
delay);
44
DccInformationSharing
(
Runtime
& rt,
const
LocationTable
& lt,
dcc::ChannelLoad
target);
45
46
DccField generate_dcc_field()
override
;
47
48
/**
49
* Update local CBR measurement
50
*
51
* Local measurement rate is decoupled from processing in DCC_net,
52
* i.e. DccInformationSharing buffers the given value and the latest
53
* measurement value when its internal update cycle runs.
54
*
55
* \param cbr local CBR measurement
56
*/
57
void
update_local_cbr
(
dcc::ChannelLoad
cbr);
58
59
private
:
60
void
trigger();
61
62
Runtime
& m_runtime;
63
const
LocationTable
& m_location_table;
64
const
dcc::ChannelLoad
m_cbr_target;
65
dcc::ChannelLoad
m_cbr_local;
66
CbrAggregator
m_aggregator;
67
Clock::duration m_trigger_interval;
68
Timestamp
m_last_aggregation;
69
Hook<const CbrAggregator&>
m_update_hook;
70
71
public
:
72
/**
73
* on_global_cbr_update is called at each update cycle,
74
* i.e. when a new global CBR has been calculated
75
*/
76
HookRegistry<const CbrAggregator&>
on_global_cbr_update
;
77
};
78
79
}
// namespace geonet
80
}
// namespace vanetza
81
82
#endif
/* DCC_INFORMATION_SHARING_HPP_GZCSHZLD */
83
vanetza::HookRegistry
Definition:
hook.hpp:71
vanetza::Hook
Definition:
hook.hpp:15
vanetza::Runtime
Definition:
runtime.hpp:16
vanetza::UnitInterval
Definition:
unit_interval.hpp:24
vanetza::dcc::ChannelLoad
Definition:
channel_load.hpp:12
vanetza::geonet::CbrAggregator
Definition:
cbr_aggregator.hpp:22
vanetza::geonet::DccFieldGenerator
Definition:
dcc_field_generator.hpp:12
vanetza::geonet::DccInformationSharing
Definition:
dcc_information_sharing.hpp:30
vanetza::geonet::DccInformationSharing::on_global_cbr_update
HookRegistry< const CbrAggregator & > on_global_cbr_update
Definition:
dcc_information_sharing.hpp:76
vanetza::geonet::DccInformationSharing::update_local_cbr
void update_local_cbr(dcc::ChannelLoad cbr)
Definition:
dcc_information_sharing.cpp:35
vanetza::geonet::LocationTable
Definition:
location_table.hpp:112
vanetza::geonet::Timestamp
Definition:
timestamp.hpp:20
vanetza
geonet
dcc_information_sharing.hpp
Generated on Thu Nov 30 2023 12:03:35 for Vanetza by
1.9.6