The Roundabout class represents a roundabout node in the network.
More...
#include <Node.hpp>
|
| Roundabout (Id id) |
| Construct a new Roundabout object.
|
|
| Roundabout (Id id, std::pair< double, double > coords) |
| Construct a new Roundabout object.
|
|
| Roundabout (const Node &node) |
| Construct a new Roundabout object.
|
|
void | enqueue (Id agentId) |
| Put an agent in the node.
|
|
Id | dequeue () |
| Removes the first agent from the node.
|
|
const dsm::queue< Id > & | agents () const |
| Get the node's queue.
|
|
double | density () const override |
| Returns the node's density.
|
|
bool | isFull () const override |
| Returns true if the node is full.
|
|
bool | isRoundabout () const noexcept override |
| Returns true if the node is a roundabout.
|
|
| 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 bool | isIntersection () const noexcept |
|
virtual bool | isTrafficLight () const noexcept |
|
|
dsm::queue< Id > | m_agents |
|
Id | m_id |
|
std::optional< std::pair< double, double > > | m_coords |
|
Size | m_capacity |
|
Size | m_transportCapacity |
|
The Roundabout class represents a roundabout node in the network.
- Template Parameters
-
Id | The type of the node's id |
Size | The type of the node's capacity |
◆ Roundabout() [1/3]
dsm::Roundabout::Roundabout |
( |
Id | id | ) |
|
|
inlineexplicit |
◆ Roundabout() [2/3]
dsm::Roundabout::Roundabout |
( |
Id | id, |
|
|
std::pair< double, double > | coords ) |
|
inline |
Construct a new Roundabout object.
- Parameters
-
id | The node's id |
coords | A std::pair containing the node's coordinates |
◆ Roundabout() [3/3]
dsm::Roundabout::Roundabout |
( |
const Node & | node | ) |
|
◆ agents()
const dsm::queue< Id > & dsm::Roundabout::agents |
( |
| ) |
const |
|
inline |
Get the node's queue.
- Returns
- dsm::queue<Id> The node's queue
◆ density()
double dsm::Roundabout::density |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns the node's density.
- Returns
- double The node's density
Implements dsm::Node.
◆ dequeue()
Id dsm::Roundabout::dequeue |
( |
| ) |
|
Removes the first agent from the node.
- Returns
- Id The agent's id
◆ enqueue()
void dsm::Roundabout::enqueue |
( |
Id | agentId | ) |
|
Put an agent in the node.
- Parameters
-
- Exceptions
-
std::runtime_error | if the node is full |
◆ isFull()
bool dsm::Roundabout::isFull |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns true if the node is full.
- Returns
- bool True if the node is full
Implements dsm::Node.
◆ isRoundabout()
bool dsm::Roundabout::isRoundabout |
( |
| ) |
const |
|
inlineoverridevirtualnoexcept |
Returns true if the node is a roundabout.
- Returns
- bool True if the node is a roundabout
Reimplemented from dsm::Node.
The documentation for this class was generated from the following files:
- src/dsm/headers/Node.hpp
- src/dsm/headers/Node.cpp