24 #include <ns3/abort.h>
108 int16_t valFp = (int16_t)(val * 8);
116 double valD = ((int16_t)val) / 8.0;
131 0, 10, 12, 14, 17, 19, 22, 26, 31, 36, 42, 49, 57, 67, 78, 91,
132 107, 125, 146, 171, 200, 234, 274, 321, 376, 440, 515, 603,
133 706, 826, 967, 1132, 1326, 1552, 1817, 2127, 2490, 2915, 3413,
134 3995, 4677, 5476, 6411, 7505, 8787, 10287, 12043, 14099, 16507,
135 19325, 22624, 26487, 31009, 36304, 42502, 49759, 58255,
136 68201, 79846, 93749, 109439, 128125, 150000, 150000
144 return BufferSizeLevelBsrTable[val];
151 if (BufferSizeLevelBsrTable[63] < val)
157 while (BufferSizeLevelBsrTable[index] < val)
204 NS_ASSERT_MSG (range <= 97,
"value " << range <<
" is out of range");
205 return (
double) range - 141.0;
212 double range = std::min (std::max (std::floor (dbm + 141), 0.0), 97.0);
213 return (uint8_t) range;
220 NS_ASSERT_MSG (range <= 34,
"value " << (uint16_t) range <<
" is out of range");
221 return ((
double) range - 40.0)*0.5;
228 double range = std::min (std::max (std::floor (db*2 + 40), 0.0), 34.0);
229 return (uint8_t) range;
247 if (hysteresisIeValue > 30)
250 <<
" is out of the allowed range (0..30)"
251 <<
" for Hysteresis IE value");
254 double actual =
static_cast<double> (hysteresisIeValue) * 0.5;
263 if ((hysteresisDb < 0.0) || (hysteresisDb > 15.0))
266 <<
" is out of the allowed range (0..15) dB"
267 <<
" for hysteresis");
270 uint8_t ieValue = lround (hysteresisDb * 2.0);
278 if ((a3OffsetIeValue < -30) || (a3OffsetIeValue > 30))
281 <<
" is out of the allowed range (-30..30)"
282 <<
" for a3-Offset IE value");
285 double actual =
static_cast<double> (a3OffsetIeValue) * 0.5;
294 if ((a3OffsetDb < -15.0) || (a3OffsetDb > 15.0))
297 <<
" is out of the allowed range (-15..15) dB"
298 <<
" for A3 Offset");
301 int8_t ieValue = lround (a3OffsetDb * 2.0);
310 if ((qRxLevMinIeValue < -70) || (qRxLevMinIeValue > -22))
313 <<
" is out of the allowed range (-70..-22)"
314 <<
" for Q-RxLevMin IE value");
317 double actual =
static_cast<double> (qRxLevMinIeValue) * 2;
326 if ((qQualMinIeValue < -34) || (qQualMinIeValue > -3))
329 <<
" is out of the allowed range (-34..-3)"
330 <<
" for Q-QualMin IE value");
333 double actual =
static_cast<double> (qQualMinIeValue);
static uint16_t double2fpS11dot3(double val)
static double IeValue2ActualHysteresis(uint8_t hysteresisIeValue)
Returns the actual value of a hysteresis parameter.
static double QuantizeRsrp(double v)
Quantize an RSRP value according to the measurement mapping of TS 36.133.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
static int8_t ActualA3Offset2IeValue(double a3OffsetDb)
Returns the IE value of a3-Offset.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
static double RsrqRange2Db(uint8_t range)
converts an RSRQ range to dB as per 3GPP TS 36.133 section 9.1.7 RSRQ Measurement Report Mapping ...
static uint8_t BufferSize2BsrId(uint32_t val)
static double getMinFpS11dot3Value()
static double IeValue2ActualA3Offset(int8_t a3OffsetIeValue)
Returns the actual value of an a3-Offset parameter.
static uint8_t TxMode2LayerNum(uint8_t txMode)
static double QuantizeRsrq(double v)
Quantize an RSRQ value according to the measurement mapping of TS 36.133.
static const uint32_t BufferSizeLevelBsrTable[64]
bool operator<(const int64x64_t &lhs, const int64x64_t &rhs)
Less than operator.
static double IeValue2ActualQRxLevMin(int8_t qRxLevMinIeValue)
Returns the actual value of an Q-RxLevMin parameter.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
static uint8_t ActualHysteresis2IeValue(double hysteresisDb)
Returns the IE value of hysteresis.
static double fpS11dot3toDouble(uint16_t val)
Parameters for configuring the UE.
static uint8_t Dbm2RsrpRange(double dbm)
convert an RSRP value in dBm to the corresponding range as per 3GPP TS 36.133 section 9...
static double IeValue2ActualQQualMin(int8_t qQualMinIeValue)
Returns the actual value of an Q-QualMin parameter.
#define NS_ABORT_MSG_UNLESS(cond, msg)
Abnormal program termination if a condition is false, with a message.
static uint32_t BsrId2BufferSize(uint8_t val)
bool operator==(const EventId &a, const EventId &b)
static uint8_t Db2RsrqRange(double db)
convert an RSRQ value in dB to the corresponding range as per 3GPP TS 36.133 section 9...
static double RsrpRange2Dbm(uint8_t range)
converts an RSRP range to dBm as per 3GPP TS 36.133 section 9.1.4 RSRP Measurement Report Mapping ...