The Node class represents the concept of a node in the network.
More...
#include <Node.hpp>
|
| 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 |
|
|
Id | m_id |
|
std::optional< std::pair< double, double > > | m_coords |
|
Size | m_capacity |
|
Size | m_transportCapacity |
|
The Node class represents the concept of a node in the network.
- Template Parameters
-
Id | The type of the node's id |
Size | The type of the node's capacity |
◆ Node() [1/2]
Construct a new Node object with capacity 1.
- Parameters
-
◆ Node() [2/2]
dsm::Node::Node |
( |
Id | id, |
|
|
std::pair< double, double > | coords ) |
|
inline |
Construct a new Node object with capacity 1.
- Parameters
-
id | The node's id |
coords | A std::pair containing the node's coordinates (lat, lon) |
◆ 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 |
◆ 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 |
◆ isRoundabout()
virtual bool dsm::Node::isRoundabout |
( |
| ) |
const |
|
inlinevirtualnoexcept |
◆ setCapacity()
virtual void dsm::Node::setCapacity |
( |
Size | capacity | ) |
|
|
inlinevirtual |
Set the node's capacity.
- Parameters
-
capacity | The node's capacity |
Reimplemented in dsm::Intersection.
◆ setCoords()
void dsm::Node::setCoords |
( |
std::pair< double, double > | coords | ) |
|
|
inline |
Set the node's coordinates.
- Parameters
-
coords | A std::pair containing the node's coordinates (lat, lon) |
◆ setId()
void dsm::Node::setId |
( |
Id | id | ) |
|
|
inline |
Set the node's id.
- Parameters
-
◆ setTransportCapacity()
virtual void dsm::Node::setTransportCapacity |
( |
Size | capacity | ) |
|
|
inlinevirtual |
Set the node's transport capacity.
- Parameters
-
capacity | The 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: