|
Dynamical system model
|
The Street class represents a street in the network. More...
#include <Street.hpp>
Public Member Functions | |
| Street (Id id, std::pair< Id, Id > nodePair, double length=Road::meanVehicleLength(), double maxSpeed=13.8888888889, int nLanes=1, std::string name=std::string(), geometry::PolyLine geometry={}, std::optional< int > capacity=std::nullopt, double transportCapacity=1.) | |
| Construct a new Street object. | |
| Street (Street &&)=default | |
| Street (Street const &)=delete | |
| bool | operator== (Street const &other) const |
| void | setLaneMapping (std::vector< Direction > const &laneMapping) |
| Set the street's lane mapping. | |
| void | setQueue (dsf::queue< std::unique_ptr< Agent > > queue, size_t index) |
| Set the street's queue. | |
| void | setStationaryWeight (double const weight) |
| Set the street's stationary weight. | |
| void | enableCounter (std::string name=std::string()) |
| Enable a coil (dsf::Counter sensor) on the street. | |
| void | resetCounter () |
| Reset the counter of the street. | |
| const dsf::queue< std::unique_ptr< Agent > > & | queue (size_t const &index) const |
| Get the street's queue. | |
| std::vector< dsf::queue< std::unique_ptr< Agent > > > const & | exitQueues () const |
| Get the street's queues. | |
| int | nAgents () const final |
| Get the number of agents on the street. | |
| double | density (bool normalized=false) const final |
| Get the street's density in \(m^{-1}\) or in \(a.u.\), if normalized. | |
| bool | isFull () const final |
| Check if the street is full. | |
| auto | stationaryWeight () const noexcept |
| Get the street's stationary weight. | |
| auto | counterName () const |
| Get the name of the counter. | |
| auto | counts () const |
| Get the counts of the counter. | |
| dsf::priority_queue< std::unique_ptr< Agent >, std::vector< std::unique_ptr< Agent > >, AgentComparator > & | movingAgents () |
| Get the street's moving agents priority queue. | |
| int | nMovingAgents () const override |
| Get the number of of moving agents, i.e. agents not yet enqueued. | |
| double | nExitingAgents (Direction direction=Direction::ANY, bool normalizeOnNLanes=false) const final |
| Get the number of agents on all queues for a given direction. | |
| std::vector< Direction > const & | laneMapping () const |
| Get the street's lane mapping. | |
| virtual void | addAgent (std::unique_ptr< Agent > pAgent) |
| Add an agent to the street. | |
| void | enqueue (size_t const &queueId) |
| Add an agent to the street's queue. | |
| virtual std::unique_ptr< Agent > | dequeue (size_t index) |
| Remove an agent from the street's queue. | |
| constexpr bool | hasCoil () const |
| Check if the street has a coil (dsf::Counter sensor) on it. | |
| virtual constexpr bool | isStochastic () const noexcept |
| Check if the street is stochastic. | |
Public Member Functions inherited from dsf::mobility::Road | |
| Road (Id id, std::pair< Id, Id > nodePair, double length=m_meanVehicleLength, double maxSpeed=13.8888888889, int nLanes=1, std::string name=std::string(), geometry::PolyLine geometry={}, std::optional< int > capacity=std::nullopt, double transportCapacity=1.) | |
| Construct a new Road object. | |
| void | setMaxSpeed (double speed) |
| Set the maximum speed, in meters per second (default is 50 km/h) | |
| void | setCapacity (int capacity) |
| Set the capacity, in number of agents. | |
| void | setTransportCapacity (double transportCapacity) |
| Set the transport capacity, in number of agents. | |
| void | setPriority (int priority) |
| Set the road's priority. | |
| void | addForbiddenTurn (Id roadId) |
| Add a road id to the forbidden turns. | |
| void | setForbiddenTurns (std::set< Id > const &forbiddenTurns) |
| Replace the road's forbidden turns with the given set. | |
| auto | length () const noexcept |
| Get the length, in meters. | |
| auto | maxSpeed () const noexcept |
| Get the maximum speed, in meters per second. | |
| auto | nLanes () const noexcept |
| Get the number of lanes. | |
| auto | capacity () const noexcept |
| Get the road's capacity, in number of agents. | |
| auto | transportCapacity () const noexcept |
| Get the road's transport capacity, in number of agents. | |
| auto const & | name () const noexcept |
| Get the name. | |
| auto | priority () const noexcept |
| Get the priority. | |
| auto const & | forbiddenTurns () const noexcept |
| Get the road's forbidden turns. | |
| Direction | turnDirection (double const &previousStreetAngle) const |
| Get the road's turn direction given the previous road angle. | |
Public Member Functions inherited from dsf::Edge | |
| Edge (Id id, std::pair< Id, Id > nodePair, geometry::PolyLine geometry={}) | |
| Construct a new Edge object. | |
| Edge (Edge &&)=default | |
| Edge (const Edge &)=delete | |
| void | setGeometry (geometry::PolyLine geometry) |
| Set the edge's geometry. | |
| void | setWeight (double const weight) |
| Set the edge's weight. | |
| auto | id () const |
| Get the edge's id. | |
| auto | source () const |
| Get the edge's source node id. | |
| auto | target () const |
| Get the edge's target node id. | |
| auto const & | nodePair () const |
| Get the edge's node pair. | |
| auto const & | geometry () const |
| Get the edge's geometry. | |
| auto | angle () const |
| Get the edge's angle, in radians, between the source and target nodes. | |
| double | weight () const |
| Get the edge's weight. | |
| double | deltaAngle (double const previousEdgeAngle) const |
Static Public Member Functions | |
| static void | setMeanVehicleLength (double meanVehicleLength) |
| Set the mean vehicle length. | |
Static Public Member Functions inherited from dsf::mobility::Road | |
| static void | setMeanVehicleLength (double meanVehicleLength) |
| Set the mean vehicle length, in meters (default is 5) | |
| static double | meanVehicleLength () |
| Get the mean vehicle length. | |
Additional Inherited Members | |
Protected Member Functions inherited from dsf::Edge | |
| void | m_setAngle (geometry::Point srcNodeCoordinates, geometry::Point dstNodeCoordinates) |
Protected Attributes inherited from dsf::mobility::Road | |
| double | m_length |
| double | m_maxSpeed |
| int | m_nLanes |
| int | m_capacity |
| double | m_transportCapacity |
| std::string | m_name |
| int | m_priority |
| std::set< Id > | m_forbiddenTurns |
Protected Attributes inherited from dsf::Edge | |
| geometry::PolyLine | m_geometry |
| Id | m_id |
| std::pair< Id, Id > | m_nodePair |
| std::optional< double > | m_weight |
| double | m_angle |
Static Protected Attributes inherited from dsf::mobility::Road | |
| static double | m_meanVehicleLength = 5. |
The Street class represents a street in the network.
| dsf::mobility::Street::Street | ( | Id | id, |
| std::pair< Id, Id > | nodePair, | ||
| double | length = Road::meanVehicleLength(), | ||
| double | maxSpeed = 13.8888888889, | ||
| int | nLanes = 1, | ||
| std::string | name = std::string(), | ||
| geometry::PolyLine | geometry = {}, | ||
| std::optional< int > | capacity = std::nullopt, | ||
| double | transportCapacity = 1. ) |
Construct a new Street object.
| id | The street's id |
| nodePair | The street's node pair |
| length | The street's length, in meters (default is the mean vehicle length) |
| nLanes | The street's number of lanes (default is 1) |
| maxSpeed | The street's speed limit, in m/s (default is 50 km/h) |
| name | The street's name (default is an empty string) |
| capacity | The street's capacity (default is the maximum number of vehicles that can fit in the street) |
| transportCapacity | The street's transport capacity (default is 1) |
|
virtual |
Add an agent to the street.
| pAgent | The agent to add to the street |
|
inline |
Get the name of the counter.
|
inline |
Get the counts of the counter.
|
finalvirtual |
Get the street's density in \(m^{-1}\) or in \(a.u.\), if normalized.
| normalized | If true, the street's density is normalized by the street's capacity |
Implements dsf::mobility::Road.
|
virtual |
Remove an agent from the street's queue.
| void dsf::mobility::Street::enableCounter | ( | std::string | name = std::string() | ) |
Enable a coil (dsf::Counter sensor) on the street.
| name | The name of the counter (default is "Coil_<street_id>") |
| void dsf::mobility::Street::enqueue | ( | size_t const & | queueId | ) |
Add an agent to the street's queue.
| agentId | The id of the agent to add to the street's queue |
| std::runtime_error | If the street's queue is full |
|
inline |
Get the street's queues.
|
inlineconstexpr |
Check if the street has a coil (dsf::Counter sensor) on it.
|
inlinefinalvirtual |
Check if the street is full.
Implements dsf::Edge.
|
inlineconstexprvirtualnoexcept |
Check if the street is stochastic.
Reimplemented in dsf::mobility::StochasticStreet.
|
inline |
Get the street's lane mapping.
|
inline |
Get the street's moving agents priority queue.
|
finalvirtual |
Get the number of agents on the street.
Implements dsf::mobility::Road.
|
finalvirtual |
Get the number of agents on all queues for a given direction.
| direction | The direction of the agents (default is ANY) |
| normalizeOnNLanes | If true, the number of agents is normalized by the number of lanes |
Implements dsf::mobility::Road.
|
overridevirtual |
Get the number of of moving agents, i.e. agents not yet enqueued.
Implements dsf::mobility::Road.
|
inline |
Get the street's queue.
| void dsf::mobility::Street::resetCounter | ( | ) |
Reset the counter of the street.
| std::runtime_error | If the street does not have a coil |
| void dsf::mobility::Street::setLaneMapping | ( | std::vector< Direction > const & | laneMapping | ) |
Set the street's lane mapping.
| laneMapping | The street's lane mapping |
|
static |
Set the mean vehicle length.
| meanVehicleLength | The mean vehicle length |
| std::invalid_argument | If the mean vehicle length is negative |
| void dsf::mobility::Street::setQueue | ( | dsf::queue< std::unique_ptr< Agent > > | queue, |
| size_t | index ) |
Set the street's queue.
| queue | The street's queue |
|
inline |
Set the street's stationary weight.
| weight | The street's stationary weight |
|
inlinenoexcept |
Get the street's stationary weight.