VICUS Library
Documentation of Vicus library
Loading...
Searching...
No Matches
VICUS::NetworkNode Class Reference

#include <VICUS_NetworkNode.h>

Inheritance diagram for VICUS::NetworkNode:
[legend]

Public Types

enum  NodeType { NT_SubStation , NT_Mixer , NT_Source , NUM_NT }
 

Public Member Functions

const char * typeinfo () const override
 
 NetworkNode ()=default
 
 NetworkNode (const unsigned id, const NodeType type, const IBKMK::Vector3D &v, const double heatDemand=0)
 
void collectConnectedEdges (std::set< const NetworkNode * > &connectedNodes, std::set< const NetworkEdge * > &connectedEdge) const
 
void setInletOutletNode (std::set< const NetworkNode * > &visitedNodes, std::vector< const NetworkEdge * > &orderedEdges) const
 
void updateIsDeadEnd ()
 
bool isRedundant () const
 
NetworkEdgeneighborEdge (const NetworkEdge *e) const
 
void findRedundantNodes (std::set< unsigned > &redundantNodes, std::set< const NetworkEdge * > &visitedEdges) const
 
const NetworkNodefindNextNonRedundantNode (std::set< unsigned > &redundantNodes, double &distance, const NetworkEdge *edgeToVisit) const
 
bool findPathToSource (std::set< NetworkEdge * > &path, std::set< NetworkEdge * > &visitedEdges, std::set< unsigned > &visitedNodes)
 
void updateNeighbourDistances () const
 
void pathToNull (std::vector< NetworkEdge * > &path) const
 
double adjacentHeatingDemand (std::set< NetworkEdge * > visitedEdges)
 
- Public Member Functions inherited from VICUS::Object
 Object ()=default
 
 Object (Object const &)=default
 
virtual ~Object ()
 
ObjectfindChild (unsigned int ID)
 
const ObjectfindChild (unsigned int ID) const
 
void collectChildIDs (std::set< unsigned int > &nodeContainer) const
 
QString info () const
 

Public Attributes

IBKMK::Vector3D m_position = IBKMK::Vector3D(-9.99,-9.99,-9.99)
 
NodeType m_type = NUM_NT
 
IBK::Parameter m_maxHeatingDemand
 
unsigned int m_idSubNetwork = INVALID_ID
 
NANDRAD::HydraulicNetworkHeatExchange m_heatExchange
 
std::vector< NetworkEdge * > m_edges
 
double m_visualizationRadius
 
QColor m_color
 
double m_distanceToStart = (std::numeric_limits<double>::max)()
 
const NetworkNodem_predecessor = nullptr
 
bool m_isDeadEnd = false
 
- Public Attributes inherited from VICUS::Object
Objectm_parent = nullptr
 
unsigned int m_id = INVALID_ID
 
bool m_selected = false
 
bool m_visible = true
 
QString m_displayName
 
std::string m_ifcGUID
 

Additional Inherited Members

- Protected Attributes inherited from VICUS::Object
std::vector< Object * > m_children
 

Member Enumeration Documentation

◆ NodeType

Enumerator
NT_SubStation 
NT_Mixer 
NT_Source 
NUM_NT 

Constructor & Destructor Documentation

◆ NetworkNode() [1/2]

VICUS::NetworkNode::NetworkNode ( )
default

◆ NetworkNode() [2/2]

VICUS::NetworkNode::NetworkNode ( const unsigned  id,
const NodeType  type,
const IBKMK::Vector3D &  v,
const double  heatDemand = 0 
)
inline

Member Function Documentation

◆ adjacentHeatingDemand()

double VICUS::NetworkNode::adjacentHeatingDemand ( std::set< NetworkEdge * >  visitedEdges)

looks at all adjacent nodes to find a node which has a heating demand >0 and returns it.

◆ collectConnectedEdges()

void VICUS::NetworkNode::collectConnectedEdges ( std::set< const NetworkNode * > &  connectedNodes,
std::set< const NetworkEdge * > &  connectedEdge 
) const

check connectivity of graph trhough recursive search

◆ findNextNonRedundantNode()

const NetworkNode * VICUS::NetworkNode::findNextNonRedundantNode ( std::set< unsigned > &  redundantNodes,
double &  distance,
const NetworkEdge edgeToVisit 
) const

looking from this node in the direction of the given edgeToVisit: return the next node that is not redundant and the distance to this node

◆ findPathToSource()

bool VICUS::NetworkNode::findPathToSource ( std::set< NetworkEdge * > &  path,
std::set< NetworkEdge * > &  visitedEdges,
std::set< unsigned > &  visitedNodes 
)

simple algorithm to find the path from this node to the node of type NT_SOURCE. The path is stored as a set of edges

◆ findRedundantNodes()

void VICUS::NetworkNode::findRedundantNodes ( std::set< unsigned > &  redundantNodes,
std::set< const NetworkEdge * > &  visitedEdges 
) const

get a set of all redundant nodes in the graph

◆ isRedundant()

bool VICUS::NetworkNode::isRedundant ( ) const
inline

Caution: for some applications this definition may needs to be more precise e.g. compare types of connected edges

◆ neighborEdge()

NetworkEdge * VICUS::NetworkNode::neighborEdge ( const NetworkEdge e) const

Only callable if node has exactly two edges: return the edge which is not the given edge

◆ pathToNull()

void VICUS::NetworkNode::pathToNull ( std::vector< NetworkEdge * > &  path) const

used for dijkstra algorithm. appends the edge which leads to the predecessor node to path and calls itself for the predecessor node until a node without predecessor is reached. this way the path from a building to the source can be created, if the predecessors have been set

◆ setInletOutletNode()

void VICUS::NetworkNode::setInletOutletNode ( std::set< const NetworkNode * > &  visitedNodes,
std::vector< const NetworkEdge * > &  orderedEdges 
) const

◆ typeinfo()

const char * VICUS::NetworkNode::typeinfo ( ) const
inlineoverridevirtual

Type-info string.

Implements VICUS::Object.

◆ updateIsDeadEnd()

void VICUS::NetworkNode::updateIsDeadEnd ( )

updates m_isDeadEnd. If node has less than two neighbours which are not a deadEnd and node is not a building nor a source: m_isDeadEdnd = true

◆ updateNeighbourDistances()

void VICUS::NetworkNode::updateNeighbourDistances ( ) const

used for dijkstra algorithm. Look at all neighbour nodes: if the m_distanceToStart of this node + the distance to the neighbour is shorter than the current m_distanceToStart of the neighbour, update it. This makes sure the neighbour nodes have assigned the currently smallest distance from start

Member Data Documentation

◆ m_color

QColor VICUS::NetworkNode::m_color
mutable

Color to be used for displaying (visible) nodes.

◆ m_distanceToStart

double VICUS::NetworkNode::m_distanceToStart = (std::numeric_limits<double>::max)()
mutable

Used in dijkstra algorithm.

◆ m_edges

std::vector<NetworkEdge*> VICUS::NetworkNode::m_edges

Pointers to adjacent edges

◆ m_heatExchange

NANDRAD::HydraulicNetworkHeatExchange VICUS::NetworkNode::m_heatExchange

◆ m_idSubNetwork

unsigned int VICUS::NetworkNode::m_idSubNetwork = INVALID_ID

Reference id to a VICUS::SubNetwork

◆ m_isDeadEnd

bool VICUS::NetworkNode::m_isDeadEnd = false
mutable

Defines wether this node is a dead end.

◆ m_maxHeatingDemand

IBK::Parameter VICUS::NetworkNode::m_maxHeatingDemand

Heating demand.

◆ m_position

IBKMK::Vector3D VICUS::NetworkNode::m_position = IBKMK::Vector3D(-9.99,-9.99,-9.99)

◆ m_predecessor

const NetworkNode* VICUS::NetworkNode::m_predecessor = nullptr
mutable

◆ m_type

NodeType VICUS::NetworkNode::m_type = NUM_NT

◆ m_visualizationRadius

double VICUS::NetworkNode::m_visualizationRadius
mutable

The radius used for the visualization of this node in the 3D scene [m]. Updated whenever the scale factor Network::m_scaleNodes changes.


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