Dynamical system model
Loading...
Searching...
No Matches
dsm::Node Class Referenceabstract

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

#include <Node.hpp>

Inheritance diagram for dsm::Node:
dsm::Intersection dsm::Roundabout dsm::TrafficLight< Delay >

Public Member Functions

 Node (Id id)
 Construct a new Node object with capacity 1.
 
 Node (Id id, std::pair< double, double > coords)
 Construct a new Node object with capacity 1.
 
void setId (Id id)
 Set the node's id.
 
void setCoords (std::pair< double, double > coords)
 Set the node's coordinates.
 
virtual void setCapacity (Size capacity)
 Set the node's capacity.
 
virtual void setTransportCapacity (Size capacity)
 Set the node's transport capacity.
 
Id id () const
 Get the node's id.
 
const std::optional< std::pair< double, double > > & coords () const
 Get the node's coordinates.
 
Size capacity () const
 Get the node's capacity.
 
Size transportCapacity () const
 Get the node's transport capacity.
 
virtual double density () const =0
 
virtual bool isFull () const =0
 
virtual bool isIntersection () const noexcept
 
virtual bool isTrafficLight () const noexcept
 
virtual bool isRoundabout () const noexcept
 

Protected Attributes

Id m_id
 
std::optional< std::pair< double, double > > m_coords
 
Size m_capacity
 
Size m_transportCapacity
 

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]

dsm::Node::Node ( Id id)
inlineexplicit

Construct a new Node object with capacity 1.

Parameters
idThe node's id

◆ Node() [2/2]

dsm::Node::Node ( Id id,
std::pair< double, double > coords )
inline

Construct a new Node object with capacity 1.

Parameters
idThe node's id
coordsA std::pair containing the node's coordinates (lat, lon)

Member Function Documentation

◆ capacity()

Size dsm::Node::capacity ( ) const
inline

Get the node's capacity.

Returns
Size The node's capacity

◆ coords()

const std::optional< std::pair< double, double > > & dsm::Node::coords ( ) const
inline

Get the node's coordinates.

Returns
std::optional<std::pair<double, double>> A std::pair containing the node's coordinates

◆ density()

virtual double dsm::Node::density ( ) const
pure virtual

Implemented in dsm::Intersection, and dsm::Roundabout.

◆ id()

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

Get the node's id.

Returns
Id The node's id

◆ isFull()

virtual bool dsm::Node::isFull ( ) const
pure virtual

Implemented in dsm::Intersection, and dsm::Roundabout.

◆ isRoundabout()

virtual bool dsm::Node::isRoundabout ( ) const
inlinevirtualnoexcept

Reimplemented in dsm::Roundabout.

◆ setCapacity()

virtual void dsm::Node::setCapacity ( Size capacity)
inlinevirtual

Set the node's capacity.

Parameters
capacityThe node's capacity

Reimplemented in dsm::Intersection.

◆ setCoords()

void dsm::Node::setCoords ( std::pair< double, double > coords)
inline

Set the node's coordinates.

Parameters
coordsA std::pair containing the node's coordinates (lat, lon)

◆ setId()

void dsm::Node::setId ( Id id)
inline

Set the node's id.

Parameters
idThe node's id

◆ setTransportCapacity()

virtual void dsm::Node::setTransportCapacity ( Size capacity)
inlinevirtual

Set the node's transport capacity.

Parameters
capacityThe node's transport capacity

◆ transportCapacity()

Size dsm::Node::transportCapacity ( ) const
inline

Get the node's transport capacity.

Returns
Size The node's transport capacity

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