10#include "ns3/mobility-model.h"
25 TypeId(
"ns3::CorrelatedShadowingPropagationLossModel")
30 "CorrelationDistance",
31 "The distance at which the computed shadowing becomes"
54 Vector position = a->GetPosition();
56 double x = position.x;
57 double y = position.y;
67 std::pair<int, int> coordinates(xcoord, ycoord);
70 NS_LOG_DEBUG(
"xcoord " << xcoord <<
", ycoord " << ycoord);
80 NS_LOG_DEBUG(
"Creating a new shadowing map to be used at coordinates "
81 << coordinates.first <<
" " << coordinates.second);
90 NS_LOG_DEBUG(
"This square already has its shadowingMap!");
102 double loss = it->second->GetLoss(bPosition);
106 return txPowerDbm - loss;
121 {1.27968707244633, -0.366414485833771, -0.0415206295795327, -0.366414485833771},
122 {-0.366414485833771, 1.27968707244633, -0.366414485833771, -0.0415206295795327},
123 {-0.0415206295795327, -0.366414485833771, 1.27968707244633, -0.366414485833771},
124 {-0.366414485833771, -0.0415206295795327, -0.366414485833771, 1.27968707244633}};
152 std::map<CorrelatedShadowingPropagationLossModel::Position, double>::const_iterator it;
160 double x = position.
x;
161 double y = position.
y;
162 int xcoord = ((
x > 0) - (
x < 0)) *
164 int ycoord = ((y > 0) - (y < 0)) *
179 NS_LOG_DEBUG(
"Generating a new shadowing value in the following quadrant:");
180 NS_LOG_DEBUG(
"xmin " << xmin <<
", xmax " << xmax <<
", ymin " << ymin <<
", ymax "
202 NS_LOG_DEBUG(q11 <<
" " << q12 <<
" " << q21 <<
" " << q22 <<
" ");
205 double c[2][4] = {{xmin, xmax, xmax, xmin}, {ymin, ymin, ymax, ymax}};
218 for (
int j = 0; j < 4; j++)
220 double distance = sqrt((c[0][j] -
x) * (c[0][j] -
x) + (c[1][j] - y) * (c[1][j] - y));
225 phi1 = phi1 +
m_kInv[0][j] * k;
226 phi2 = phi2 +
m_kInv[1][j] * k;
227 phi3 = phi3 +
m_kInv[2][j] * k;
228 phi4 = phi4 +
m_kInv[3][j] * k;
231 NS_LOG_DEBUG(
"Phi: " << phi1 <<
" " << phi2 <<
" " << phi3 <<
" " << phi4 <<
" ");
233 double shadowing = q11 * phi1 + q21 * phi2 + q22 * phi3 + q12 * phi4;
237 NS_LOG_DEBUG(
"Created new shadowing map: " << shadowing);
241 NS_LOG_DEBUG(
"Shadowing map for this location already exists");
269 double EPSILON = 0.1;
270 return ((fabs(this->
x - other.
x) < EPSILON) && (fabs(this->
y - other.
y) < EPSILON));
281 if (this->
x != other.
x)
283 return this->
x < other.
x;
285 return this->
y < other.
y;
cairo_uint64_t x
_cairo_uint_96by64_32x64_divrem:
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeDoubleChecker()
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)