ns-3 PLC model
 All Classes Functions Variables Enumerations
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
ns3::PLC_Graph Class Reference

Graph of the PLC network. More...

#include <plc-graph.h>

List of all members.

Public Member Functions

void AddNode (Ptr< PLC_Node > node)
void SetChannel (Ptr< PLC_Channel > channel)
Ptr< PLC_ChannelGetChannel (void)
Ptr< PLC_ChannelGetChannel (void) const
std::vector< Ptr
< PLC_RxInterface > > 
GetConnectedRxInterfaces ()
std::vector< PLC_RxInterface * > GetConnectedRxInterfacePeekPtrs (void)
void CreatePLCGraph (void)
Ptr< PLC_NodeGetNodePtr (unsigned int id)
PLC_NodeGetNodePeekPtr (unsigned int id)
std::vector< Ptr< PLC_Node > > GetNodes (void)
boost::UGraph * GetGraphPtr (void)
std::list< Ptr< PLC_Node > > GetShortestPath (Ptr< PLC_Node > from, Ptr< PLC_Node > to)
double GetDistance (Ptr< PLC_Node > from, Ptr< PLC_Node > to)
bool BackboneBranchExists (PLC_BackboneBranchKey key)
void RegisterBackboneBranch (PLC_BackboneBranchKey bb_key, Ptr< PLC_BackboneBranch > bb_branch)
Ptr< PLC_BackboneBranchGetBackboneBranch (PLC_BackboneBranchKey bb_key)
bool PathExists (Ptr< PLC_Node > from, Ptr< PLC_Node > to)
void Lock ()
void Unlock ()

Static Public Member Functions

static TypeId GetTypeId (void)

Protected Member Functions

virtual void DoStart (void)
virtual void DoDispose (void)
void CalculateShortestPaths (void)

Protected Attributes

boost::UGraph m_graph
PLC_Mutex m_graph_mutex
Ptr< PLC_Channelm_channel
std::vector< Ptr< PLC_Node > > m_nodes
std::map< std::pair< unsigned
int, unsigned int >, std::pair
< double, std::list< Ptr
< PLC_Node > > > > 
m_shortest_paths
std::map
< PLC_BackboneBranchKey, Ptr
< PLC_BackboneBranch > > 
m_backbone_branches

Friends

class PLC_TxInterface

Detailed Description

Graph of the PLC network.

This class describes the PLC network topology as an undirected graph. Annotation: As the simulation has only graph and one channel instance the correspondent classes could be combined, but to have a logical seperation they are realized in different classes. It is currently not allowed to have cycles in the topology as the Dijkstra Algorithm for the shortest path calculation will fail! Although there should be no cycles in a real world power line network for the power transmission frequency, it is possible to (galvanically) recouple an HF signal over a redundant path to the network. TODO: segment graph to support cycles


Member Function Documentation

void ns3::PLC_Graph::AddNode ( Ptr< PLC_Node node)

Add a Node to the graph. All network nodes have to be added before calling CreateGraph

Parameters:
nodeNode to be added
bool ns3::PLC_Graph::BackboneBranchExists ( PLC_BackboneBranchKey  key)

Proof if a backbone branch already exists (see plc-backbone.h for further information)

Parameters:
key
Returns:
True if there is already a backbone branch with registered, false otherwise

Creates the PLC graph, i.e. the method performs a Dijkstra search to calculate the shortest paths between all network nodes (needed for the "line of sight" path of signal transmission over the PLC fading channel). It uses the boost graph library

Ptr< PLC_BackboneBranch > ns3::PLC_Graph::GetBackboneBranch ( PLC_BackboneBranchKey  bb_key)

Get the backbone branch associated with or NULL if it does not exist

Parameters:
bb_keyKey
Returns:
Backbone branch
Ptr<PLC_Channel> ns3::PLC_Graph::GetChannel ( void  ) [inline]
Returns:
Used channel instance
Returns:
All connected RX interfaces of the used channel instance
double ns3::PLC_Graph::GetDistance ( Ptr< PLC_Node from,
Ptr< PLC_Node to 
)

Returns the distance between and calculated by the Dijkstra algorithm with the sum of directed distances of the paths nodes as the cost function

Parameters:
fromFirst node
toSecond node
Returns:
Distance
boost::UGraph* ns3::PLC_Graph::GetGraphPtr ( void  ) [inline]

Get the underlying boost graph. Used by the parallelized dijkstra and depth first search algorithms

Returns:
Boost graph pointer
Ptr< PLC_Node > ns3::PLC_Graph::GetNodePtr ( unsigned int  id)

Get the node pointer associated with id

Parameters:
id
Returns:
std::list< Ptr< PLC_Node > > ns3::PLC_Graph::GetShortestPath ( Ptr< PLC_Node from,
Ptr< PLC_Node to 
)

Returns the shortest path between two nodes in form of a list of intermediate nodes An empty list indicates a direct connection between from and to. Note that an existing path between the nodes is mandatory!

Parameters:
fromFirst node
toSecond node
Returns:
void ns3::PLC_Graph::Lock ( void  ) [inline]

Lock graph mutex for mutual exclusion

bool ns3::PLC_Graph::PathExists ( Ptr< PLC_Node from,
Ptr< PLC_Node to 
)

Proof if there is an existing path between and

Parameters:
fromFirst node
toSecond nod
Returns:
True if path exists, false otherwise
void ns3::PLC_Graph::RegisterBackboneBranch ( PLC_BackboneBranchKey  bb_key,
Ptr< PLC_BackboneBranch bb_branch 
)

Register a backbone branch instance with

Parameters:
bb_keyKey
bb_branchBackbone branch
void ns3::PLC_Graph::SetChannel ( Ptr< PLC_Channel channel) [inline]

Sets the channel instance to be used.

Parameters:
channel
void ns3::PLC_Graph::Unlock ( void  ) [inline]

Unlock graph mutex


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations