A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-algorithm.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
7 *
8 */
9
10#include "lte-ffr-algorithm.h"
11
12#include "lte-common.h"
13
14#include "ns3/boolean.h"
15#include "ns3/log.h"
16#include "ns3/uinteger.h"
17
18namespace ns3
19{
20
21NS_LOG_COMPONENT_DEFINE("LteFfrAlgorithm");
22
24
29
33
36{
37 static TypeId tid =
38 TypeId("ns3::LteFfrAlgorithm")
40 .SetGroupName("Lte")
41 .AddAttribute("FrCellTypeId",
42 "Downlink FR cell type ID for automatic configuration,"
43 "default value is 0 and it means that user needs to configure FR "
44 "algorithm manually,"
45 "if it is set to 1,2 or 3 FR algorithm will be configured automatically",
50 .AddAttribute("EnabledInUplink",
51 "If FR algorithm will also work in Uplink, default value true",
52 BooleanValue(true),
55 return tid;
56}
57
58void
63
64uint16_t
70
71void
73{
74 NS_LOG_FUNCTION(this << bw);
75 switch (bw)
76 {
77 case 6:
78 case 15:
79 case 25:
80 case 50:
81 case 75:
82 case 100:
83 m_ulBandwidth = bw;
84 break;
85
86 default:
87 NS_FATAL_ERROR("invalid bandwidth value " << bw);
88 break;
89 }
90}
91
92uint16_t
98
99void
101{
102 NS_LOG_FUNCTION(this << bw);
103 switch (bw)
104 {
105 case 6:
106 case 15:
107 case 25:
108 case 50:
109 case 75:
110 case 100:
111 m_dlBandwidth = bw;
112 break;
113
114 default:
115 NS_FATAL_ERROR("invalid bandwidth value " << bw);
116 break;
117 }
118}
119
120void
122{
123 NS_LOG_FUNCTION(this << uint16_t(cellTypeId));
124 m_frCellTypeId = cellTypeId;
126}
127
128uint8_t
130{
131 NS_LOG_FUNCTION(this);
132 return m_frCellTypeId;
133}
134
135int
137{
138 return GetLteRbgSize(dlbandwidth);
139}
140
141void
143{
144 NS_LOG_FUNCTION(this);
145 m_cellId = cellId;
146}
147
148void
149LteFfrAlgorithm::DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
150{
151 NS_LOG_FUNCTION(this);
152 SetDlBandwidth(dlBandwidth);
153 SetUlBandwidth(ulBandwidth);
154}
155
156} // namespace ns3
The abstract base class of a Frequency Reuse algorithm.
static TypeId GetTypeId()
Get the type ID.
bool m_needReconfiguration
If true FR algorithm will be reconfigured.
void SetFrCellTypeId(uint8_t cellTypeId)
uint8_t GetFrCellTypeId() const
uint8_t m_frCellTypeId
FFR cell type ID for automatic configuration.
void DoDispose() override
Destructor implementation.
int GetRbgSize(int dlbandwidth)
Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213.
bool m_enabledInUplink
If true FR algorithm will also work in Uplink.
virtual void DoSetCellId(uint16_t cellId)
SetCellId.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
uint16_t GetUlBandwidth() const
void SetDlBandwidth(uint16_t bw)
uint8_t m_ulBandwidth
uplink bandwidth in RBs
virtual void DoSetBandwidth(uint16_t ulBandwidth, uint16_t dlBandwidth)
Implementation of LteFfrRrcSapProvider::SetBandwidth.
void SetUlBandwidth(uint16_t bw)
uint16_t GetDlBandwidth() const
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
a unique identifier for an interface.
Definition type-id.h:50
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition type-id.cc:1003
Hold an unsigned integer type.
Definition uinteger.h:34
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:201
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition object-base.h:35
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:113
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Definition uinteger.h:35
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Definition boolean.h:70
std::size_t GetLteRbgSize(uint16_t dlBandwidth)
Get the Type 0 resource block group (RBG) size for a downlink bandwidth, according to 3GPP TS 36....
Definition lte-common.cc:36