Dynamical system model
Loading...
Searching...
No Matches
dsm::NodeConcept< Id, Size > Class Template Referenceabstract

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

#include <Node.hpp>

Inheritance diagram for dsm::NodeConcept< Id, Size >:
dsm::Node< Id, Size > dsm::Roundabout< Id, Size > dsm::TrafficLight< Id, Size, Delay >

Public Member Functions

 NodeConcept (Id id)
 Construct a new Node object with capacity 1.
 
 NodeConcept (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.
 
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.
 
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
 

Detailed Description

template<typename Id, typename Size>
requires (std::unsigned_integral<Id> && std::unsigned_integral<Size>)
class dsm::NodeConcept< Id, Size >

The NodeConcept 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

◆ NodeConcept() [1/2]

template<typename Id , typename Size >
dsm::NodeConcept< Id, Size >::NodeConcept ( Id id)
inlineexplicit

Construct a new Node object with capacity 1.

Parameters
idThe node's id

◆ NodeConcept() [2/2]

template<typename Id , typename Size >
dsm::NodeConcept< Id, Size >::NodeConcept ( 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()

template<typename Id , typename Size >
Size dsm::NodeConcept< Id, Size >::capacity ( ) const
inline

Get the node's capacity.

Returns
Size The node's capacity

◆ coords()

template<typename Id , typename Size >
const std::optional< std::pair< double, double > > & dsm::NodeConcept< Id, Size >::coords ( ) const
inline

Get the node's coordinates.

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

◆ id()

template<typename Id , typename Size >
Id dsm::NodeConcept< Id, Size >::id ( ) const
inline

Get the node's id.

Returns
Id The node's id

◆ isFull()

template<typename Id , typename Size >
virtual bool dsm::NodeConcept< Id, Size >::isFull ( ) const
pure virtual

◆ isRoundabout()

template<typename Id , typename Size >
virtual bool dsm::NodeConcept< Id, Size >::isRoundabout ( ) const
inlinevirtualnoexcept

Reimplemented in dsm::Roundabout< Id, Size >.

◆ setCapacity()

template<typename Id , typename Size >
virtual void dsm::NodeConcept< Id, Size >::setCapacity ( Size capacity)
inlinevirtual

Set the node's capacity.

Parameters
capacityThe node's capacity

Reimplemented in dsm::Node< Id, Size >.

◆ setCoords()

template<typename Id , typename Size >
void dsm::NodeConcept< Id, Size >::setCoords ( std::pair< double, double > coords)
inline

Set the node's coordinates.

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

◆ setId()

template<typename Id , typename Size >
void dsm::NodeConcept< Id, Size >::setId ( Id id)
inline

Set the node's id.

Parameters
idThe node's id

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