Dynamical system model
Loading...
Searching...
No Matches
dsf::Node Class Reference

The Node class represents the concept of a node in the network. More...

#include <Node.hpp>

Inheritance diagram for dsf::Node:
dsf::mobility::RoadJunction dsf::mobility::Intersection dsf::mobility::Roundabout dsf::mobility::Station dsf::mobility::TrafficLight

Public Member Functions

 Node (Id id)
 Construct a new Node object with capacity 1.
 Node (Id id, geometry::Point point)
 Construct a new Node object with capacity 1.
 Node (Node const &other)
Nodeoperator= (Node const &other)
void setId (Id id) noexcept
 Set the node's id.
void setGeometry (geometry::Point point) noexcept
 Set the node's geometry.
void setName (const std::string &name) noexcept
 Set the node's name.
void addIngoingEdge (Id edgeId)
 Add an ingoing edge to the node.
void addOutgoingEdge (Id edgeId)
 Add an outgoing edge to the node.
void setBetweennessCentrality (double const betweennessCentrality) noexcept
 Set the node's betweenness centrality.
auto id () const
 Get the node's id.
auto const & geometry () const noexcept
 Get the node's geometry.
auto const & name () const noexcept
 Get the node's name.
auto const & ingoingEdges () const noexcept
 Get the node's ingoing edges.
auto const & outgoingEdges () const noexcept
 Get the node's outgoing edges.
auto const & betweennessCentrality () const noexcept
 Get the node's betweenness centrality.

Protected Attributes

Id m_id
std::optional< geometry::Pointm_geometry
std::string m_name
std::vector< Id > m_ingoingEdges
std::vector< Id > m_outgoingEdges
std::optional< double > m_betweennessCentrality {std::nullopt}

Detailed Description

The Node class represents the concept of a node in the network.

Template Parameters
IdThe type of the node's id
SizeThe type of the node's capacity

Constructor & Destructor Documentation

◆ Node() [1/2]

dsf::Node::Node ( Id id)
inlineexplicit

Construct a new Node object with capacity 1.

Parameters
idThe node's id

◆ Node() [2/2]

dsf::Node::Node ( Id id,
geometry::Point point )
inline

Construct a new Node object with capacity 1.

Parameters
idThe node's id
pointA geometry::Point containing the node's coordinates

Member Function Documentation

◆ addIngoingEdge()

void dsf::Node::addIngoingEdge ( Id edgeId)
inline

Add an ingoing edge to the node.

Parameters
edgeIdThe edge's id
Exceptions
std::invalid_argumentif the edge already exists in the ingoing edges

◆ addOutgoingEdge()

void dsf::Node::addOutgoingEdge ( Id edgeId)
inline

Add an outgoing edge to the node.

Parameters
edgeIdThe edge's id
Exceptions
std::invalid_argumentif the edge already exists in the outgoing edges

◆ betweennessCentrality()

auto const & dsf::Node::betweennessCentrality ( ) const
inlinenoexcept

Get the node's betweenness centrality.

Returns
std::optional<double> The node's betweenness centrality, or std::nullopt if not set

◆ geometry()

auto const & dsf::Node::geometry ( ) const
inlinenoexcept

Get the node's geometry.

Returns
std::optional<geometry::Point> A geometry::Point

◆ id()

auto dsf::Node::id ( ) const
inline

Get the node's id.

Returns
Id The node's id

◆ ingoingEdges()

auto const & dsf::Node::ingoingEdges ( ) const
inlinenoexcept

Get the node's ingoing edges.

Returns
std::vector<Id> A vector of the node's ingoing edge ids

◆ name()

auto const & dsf::Node::name ( ) const
inlinenoexcept

Get the node's name.

Returns
std::string The node's name

◆ outgoingEdges()

auto const & dsf::Node::outgoingEdges ( ) const
inlinenoexcept

Get the node's outgoing edges.

Returns
std::vector<Id> A vector of the node's outgoing edge ids

◆ setBetweennessCentrality()

void dsf::Node::setBetweennessCentrality ( double const betweennessCentrality)
inlinenoexcept

Set the node's betweenness centrality.

Parameters
betweennessCentralityThe node's betweenness centrality

◆ setGeometry()

void dsf::Node::setGeometry ( geometry::Point point)
inlinenoexcept

Set the node's geometry.

Parameters
pointA geometry::Point containing the node's geometry

◆ setId()

void dsf::Node::setId ( Id id)
inlinenoexcept

Set the node's id.

Parameters
idThe node's id

◆ setName()

void dsf::Node::setName ( const std::string & name)
inlinenoexcept

Set the node's name.

Parameters
nameThe node's name

The documentation for this class was generated from the following file:
  • src/dsf/base/Node.hpp