|
Dynamical system model
|
The Intersection class represents a node in the network. More...
#include <Intersection.hpp>
Public Member Functions | |
| Intersection (Id id) | |
| Construct a new Intersection object. | |
| Intersection (Id id, geometry::Point coords) | |
| Construct a new Intersection object. | |
| Intersection (RoadJunction const &node) | |
| Intersection (Intersection const &)=delete | |
| void | setCapacity (Size capacity) override |
| Set the node's capacity. | |
| void | addAgent (double angle, std::unique_ptr< Agent > pAgent) |
| Put an agent in the node. | |
| void | addAgent (std::unique_ptr< Agent > pAgent) |
| Put an agent in the node. | |
| void | setStreetPriorities (std::set< Id > streetPriorities) |
| Set the node streets with priority. | |
| void | addStreetPriority (Id streetId) |
| Add a street to the node street priorities. | |
| double | density () const override |
| Returns the node's density. | |
| bool | isFull () const override |
| Returns true if the node is full. | |
| virtual const std::set< Id > & | streetPriorities () const |
| Get the node's street priorities. | |
| std::multimap< int16_t, std::unique_ptr< Agent > > & | agents () |
| Get the node's agent ids. | |
| Size | nAgents () const |
| Returns the number of agents currently in the node. | |
| constexpr bool | isIntersection () const noexcept final |
Public Member Functions inherited from dsf::mobility::RoadJunction | |
| RoadJunction (Id id) | |
| RoadJunction (Id id, geometry::Point coords) | |
| RoadJunction (RoadJunction const &other) | |
| RoadJunction & | operator= (RoadJunction const &other) |
| void | setTransportCapacity (double capacity) |
| Set the junction's transport capacity. | |
| Size | capacity () const |
| Get the junction's capacity. | |
| double | transportCapacity () const |
| Get the junction's transport capacity. | |
| virtual constexpr bool | isTrafficLight () const noexcept |
| virtual constexpr bool | isRoundabout () const noexcept |
Public Member Functions inherited from dsf::Node | |
| 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) | |
| Node & | operator= (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 | |
| std::multimap< int16_t, std::unique_ptr< Agent > > | m_agents |
| std::set< Id > | m_streetPriorities |
Protected Attributes inherited from dsf::Node | |
| Id | m_id |
| std::optional< geometry::Point > | m_geometry |
| std::string | m_name |
| std::vector< Id > | m_ingoingEdges |
| std::vector< Id > | m_outgoingEdges |
The Intersection class represents a node in the network.
| Id | The type of the node's id. It must be an unsigned integral type. |
|
inlineexplicit |
Construct a new Intersection object.
| id | The node's id |
|
inline |
Construct a new Intersection object.
| id | The node's id |
| coords | A dsf::geometry::Point containing the node's coordinates |
| void dsf::mobility::Intersection::addAgent | ( | double | angle, |
| std::unique_ptr< Agent > | pAgent ) |
Put an agent in the node.
| agent | A std::pair containing the agent's angle difference and id |
The agent's angle difference is used to order the agents in the node. The agent with the smallest angle difference is the first one to be removed from the node.
| std::runtime_error | if the node is full |
| void dsf::mobility::Intersection::addAgent | ( | std::unique_ptr< Agent > | pAgent | ) |
Put an agent in the node.
| agentId | The agent's id |
The agent's angle difference is used to order the agents in the node. The agent with the smallest angle difference is the first one to be removed from the node.
| std::runtime_error | if the node is full |
|
inline |
Add a street to the node street priorities.
| streetId | The street's id |
|
inline |
Get the node's agent ids.
|
inlineoverridevirtual |
Returns the node's density.
Reimplemented from dsf::mobility::RoadJunction.
|
inlineoverridevirtual |
Returns true if the node is full.
Reimplemented from dsf::mobility::RoadJunction.
|
inlineconstexprfinalvirtualnoexcept |
Reimplemented from dsf::mobility::RoadJunction.
|
inline |
Returns the number of agents currently in the node.
|
overridevirtual |
Set the node's capacity.
| capacity | The node's capacity |
| std::runtime_error | if the capacity is smaller than the current queue size |
Reimplemented from dsf::mobility::RoadJunction.
|
inline |
Set the node streets with priority.
| streetPriorities | A std::set containing the node's street priorities |
|
inlinevirtual |
Get the node's street priorities.
This function returns a std::set containing the node's street priorities. If a street has priority, it means that the agents that are on that street have priority over the agents that are on the other streets.