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.
 
Id id () const
 Get the node's id.
 
std::optional< geometry::Point > const & geometry () const noexcept
 Get the node's geometry.
 
std::string const & name () const noexcept
 Get the node's name.
 
std::vector< Id > const & ingoingEdges () const noexcept
 
std::vector< Id > const & outgoingEdges () const noexcept
 
virtual bool isStation () const noexcept
 

Protected Attributes

Id m_id
 
std::optional< geometry::Pointm_geometry
 
std::string m_name
 
std::vector< Id > m_ingoingEdges
 
std::vector< Id > m_outgoingEdges
 

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

◆ geometry()

std::optional< geometry::Point > const & dsf::Node::geometry ( ) const
inlinenoexcept

Get the node's geometry.

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

◆ id()

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

Get the node's id.

Returns
Id The node's id

◆ isStation()

virtual bool dsf::Node::isStation ( ) const
inlinevirtualnoexcept

Reimplemented in dsf::mobility::Station.

◆ name()

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

Get the node's name.

Returns
std::string The node's name

◆ 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: