A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::HexagonalWraparoundModel Class Reference

Hexagonal wraparound model wraps nodes around in space based on an hexagonal deployment. More...

#include "hexagonal-wraparound-model.h"

+ Inheritance diagram for ns3::HexagonalWraparoundModel:
+ Collaboration diagram for ns3::HexagonalWraparoundModel:

Public Member Functions

 HexagonalWraparoundModel ()
 Default constructor.
 
 HexagonalWraparoundModel (double isd, size_t numSites)
 Constructor.
 
void AddSitePosition (const Vector3D &pos)
 Add a site position.
 
double CalculateDistance (const Vector3D &a, const Vector3D &b) const
 Calculate distance after wraparound between two points.
 
Vector3D GetSitePosition (const Vector3D &pos) const
 Calculate the site position.
 
Vector3D GetVirtualPosition (const Vector3D txPos, const Vector3D rxPos) const override
 Get virtual position of txPos with respect to rxPos.
 
void SetNumSites (uint8_t numSites)
 Set number of sites.
 
void SetSiteDistance (double isd)
 Set site distance.
 
void SetSitePositions (const std::vector< Vector3D > &positions)
 Set site positions.
 
- Public Member Functions inherited from ns3::WraparoundModel
 WraparoundModel ()=default
 Default constructor.
 
Ptr< MobilityModelGetVirtualMobilityModel (Ptr< const MobilityModel > tx, Ptr< const MobilityModel > rx) const
 Creates a disposable virtual mobility model for tx based on rx distance and a wraparound model.
 
- Public Member Functions inherited from ns3::Object
 Object ()
 Constructor.
 
 ~Object () override
 Destructor.
 
void AggregateObject (Ptr< Object > other)
 Aggregate two Objects together.
 
void Dispose ()
 Dispose of this Object.
 
AggregateIterator GetAggregateIterator () const
 Get an iterator to the Objects aggregated to this one.
 
TypeId GetInstanceTypeId () const final
 Get the most derived TypeId for this Object.
 
template<typename T>
Ptr< T > GetObject () const
 Get a pointer to the requested aggregated Object.
 
template<>
Ptr< ObjectGetObject () const
 Specialization of () for objects of type ns3::Object.
 
template<typename T>
Ptr< T > GetObject (TypeId tid) const
 Get a pointer to the requested aggregated Object by TypeId.
 
template<>
Ptr< ObjectGetObject (TypeId tid) const
 Specialization of (TypeId tid) for objects of type ns3::Object.
 
void Initialize ()
 Invoke DoInitialize on all Objects aggregated to this one.
 
bool IsInitialized () const
 Check if the object has been initialized.
 
void UnidirectionalAggregateObject (Ptr< Object > other)
 Aggregate an Object to another Object.
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor.
 
void GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const
 Get the value of an attribute, raising fatal errors if unsuccessful.
 
bool GetAttributeFailSafe (std::string name, AttributeValue &value) const
 Get the value of an attribute without raising errors.
 
void SetAttribute (std::string name, const AttributeValue &value)
 Set a single attribute, raising fatal errors if unsuccessful.
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 Set a single attribute without raising errors.
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 Connect a TraceSource to a Callback with a context.
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 Connect a TraceSource to a Callback without a context.
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected with a context.
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 Disconnect from a TraceSource a Callback previously connected without a context.
 

Static Public Member Functions

static TypeId GetTypeId ()
 Register this type with the TypeId system.
 
- Static Public Member Functions inherited from ns3::WraparoundModel
static TypeId GetTypeId ()
 Register this type with the TypeId system.
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId ()
 Register this type.
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId ()
 Get the type ID.
 

Private Attributes

double m_isd
 distance between sites
 
uint8_t m_numSites
 number of sites
 
double m_radius
 site radius
 
std::vector< Vector3Dm_sitePositions
 site positions
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 Copy an Object.
 
virtual void DoDispose ()
 Destructor implementation.
 
virtual void DoInitialize ()
 Initialize() implementation.
 
virtual void NotifyNewAggregate ()
 Notify all Objects aggregated to this one of a new Object being aggregated.
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 Complete construction of ObjectBase; invoked by derived classes.
 
virtual void NotifyConstructionCompleted ()
 Notifier called once the ObjectBase is fully constructed.
 

Detailed Description

Hexagonal wraparound model wraps nodes around in space based on an hexagonal deployment.

Introspection did not find any typical Config paths
No Attributes are defined for this type
No TraceSources are defined for this type
Group: Spectrum
Size of this type is 104 bytes (on a 64-bit architecture).

It is used to determine a virtual position after wraparound and calculate the distance between a point of reference and the virtual position.

This model is used for the hexagonal deployments typical of mobile networks. It supports rings 0 (1 site), 1 (7 sites) and 3 rings (19 sites). To use it, set the inter-site distance (isd) and the number of sites. Then, add the position coordinates of the sites. All space coordinates in this class and its subclasses are understood to be meters or meters/s. i.e., they are all metric international units.

When GetRelativeVirtualPosition (absPos1, absPos2) is called, the relative position of the absPos2 is calculated respective to the reference coordinate absPos1, applying the wrapping based on the model described in:

R. S. Panwar and K. M. Sivalingam, "Implementation of wrap around mechanism for system level simulation of LTE cellular networks in NS3," 2017 IEEE 18th International Symposium on A World of Wireless, Mobile and Multimedia Networks (WoWMoM), Macau, 2017, pp. 1-9, doi: 10.1109/WoWMoM.2017.7974289.


Definition at line 45 of file hexagonal-wraparound-model.h.

Constructor & Destructor Documentation

◆ HexagonalWraparoundModel() [1/2]

ns3::HexagonalWraparoundModel::HexagonalWraparoundModel ( )

Default constructor.

Definition at line 44 of file hexagonal-wraparound-model.cc.

References m_numSites.

Referenced by GetTypeId().

+ Here is the caller graph for this function:

◆ HexagonalWraparoundModel() [2/2]

ns3::HexagonalWraparoundModel::HexagonalWraparoundModel ( double isd,
size_t numSites )

Constructor.

Parameters
isdinter-site distance
numSitesnumber of sites

Definition at line 49 of file hexagonal-wraparound-model.cc.

References m_numSites, and SetSiteDistance().

+ Here is the call graph for this function:

Member Function Documentation

◆ AddSitePosition()

void ns3::HexagonalWraparoundModel::AddSitePosition ( const Vector3D & pos)

Add a site position.

Parameters
posposition of a site

Definition at line 70 of file hexagonal-wraparound-model.cc.

References m_numSites, m_sitePositions, NS_ASSERT, and NS_LOG_FUNCTION.

◆ CalculateDistance()

double ns3::HexagonalWraparoundModel::CalculateDistance ( const Vector3D & a,
const Vector3D & b ) const

Calculate distance after wraparound between two points.

Parameters
aposition of point a
bposition of point b
Returns
wraparound distance between a and b

Definition at line 85 of file hexagonal-wraparound-model.cc.

References GetVirtualPosition().

+ Here is the call graph for this function:

◆ GetSitePosition()

Vector3D ns3::HexagonalWraparoundModel::GetSitePosition ( const Vector3D & pos) const

Calculate the site position.

Parameters
posoriginal position
Returns
closest cell center based on wraparound distance

Definition at line 97 of file hexagonal-wraparound-model.cc.

References m_numSites, m_sitePositions, and NS_ASSERT.

◆ GetTypeId()

TypeId ns3::HexagonalWraparoundModel::GetTypeId ( )
static

Register this type with the TypeId system.

Returns
the object TypeId

Definition at line 35 of file hexagonal-wraparound-model.cc.

References HexagonalWraparoundModel(), ns3::WraparoundModel::WraparoundModel(), and ns3::TypeId::SetParent().

+ Here is the call graph for this function:

◆ GetVirtualPosition()

Vector3D ns3::HexagonalWraparoundModel::GetVirtualPosition ( const Vector3D txPos,
const Vector3D rxPos ) const
overridevirtual

Get virtual position of txPos with respect to rxPos.

Parameters
txPos
rxPos
Returns
virtual position of txPos

Reimplemented from ns3::WraparoundModel.

Definition at line 114 of file hexagonal-wraparound-model.cc.

References m_isd, m_numSites, m_radius, NS_ASSERT_MSG, ns3::WRAPPING_COEFF_CLUSTER19, and ns3::WRAPPING_COEFF_CLUSTER7.

Referenced by CalculateDistance().

+ Here is the caller graph for this function:

◆ SetNumSites()

void ns3::HexagonalWraparoundModel::SetNumSites ( uint8_t numSites)

Set number of sites.

Parameters
numSitesnumber of sites

Definition at line 63 of file hexagonal-wraparound-model.cc.

References m_numSites, and NS_ASSERT.

◆ SetSiteDistance()

void ns3::HexagonalWraparoundModel::SetSiteDistance ( double isd)

Set site distance.

Parameters
isdsite distance

Definition at line 56 of file hexagonal-wraparound-model.cc.

References m_isd, m_radius, and M_SQRT3.

Referenced by HexagonalWraparoundModel().

+ Here is the caller graph for this function:

◆ SetSitePositions()

void ns3::HexagonalWraparoundModel::SetSitePositions ( const std::vector< Vector3D > & positions)

Set site positions.

Parameters
positionspositions of all sites

Definition at line 78 of file hexagonal-wraparound-model.cc.

References m_numSites, m_sitePositions, and NS_ASSERT.

Member Data Documentation

◆ m_isd

double ns3::HexagonalWraparoundModel::m_isd
private

distance between sites

Definition at line 113 of file hexagonal-wraparound-model.h.

Referenced by GetVirtualPosition(), and SetSiteDistance().

◆ m_numSites

uint8_t ns3::HexagonalWraparoundModel::m_numSites
private

◆ m_radius

double ns3::HexagonalWraparoundModel::m_radius
private

site radius

Definition at line 114 of file hexagonal-wraparound-model.h.

Referenced by GetVirtualPosition(), and SetSiteDistance().

◆ m_sitePositions

std::vector<Vector3D> ns3::HexagonalWraparoundModel::m_sitePositions
private

site positions

Definition at line 116 of file hexagonal-wraparound-model.h.

Referenced by AddSitePosition(), GetSitePosition(), and SetSitePositions().


The documentation for this class was generated from the following files: