|
Dynamical system model
|
Public Member Functions | |
| 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. | |
| double | length () const |
| Get the length, in meters. | |
| double | maxSpeed () const |
| Get the maximum speed, in meters per second. | |
| int | nLanes () const |
| Get the number of lanes. | |
| int | capacity () const |
| Get the road's capacity, in number of agents. | |
| double | transportCapacity () const |
| Get the road's transport capacity, in number of agents. | |
| std::string | name () const |
| Get the name. | |
| int | priority () const |
| Get the priority. | |
| std::set< Id > const & | forbiddenTurns () const |
| Get the road's forbidden turns. | |
| Direction | turnDirection (double const &previousStreetAngle) const |
| Get the road's turn direction given the previous road angle. | |
| virtual int | nAgents () const =0 |
| virtual int | nMovingAgents () const =0 |
| virtual double | nExitingAgents (Direction direction, bool normalizeOnNLanes) const =0 |
| virtual double | density (bool normalized=false) const =0 |
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 | resetId (Id newId) |
| void | setGeometry (geometry::PolyLine geometry) |
| void | setWeight (double const weight) |
| Id | id () const |
| Get the edge's id. | |
| Id | source () const |
| Get the edge's source node id. | |
| Id | target () const |
| Get the edge's target node id. | |
| std::pair< Id, Id > const & | nodePair () const |
| Get the edge's node pair. | |
| geometry::PolyLine const & | geometry () const |
| Get the edge's geometry. | |
| double | angle () const |
| Get the edge's angle, in radians, between the source and target nodes. | |
| double | weight () const |
| Get the edge's weight. | |
| virtual bool | isFull () const =0 |
| double | deltaAngle (double const previousEdgeAngle) const |
Static Public Member Functions | |
| static void | setMeanVehicleLength (double meanVehicleLength) |
| Set the mean vehicle length, in meters (default is 5) | |
| static double | meanVehicleLength () |
| Get the mean vehicle length. | |
Protected Attributes | |
| 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 | |
| static double | m_meanVehicleLength = 5. |
Additional Inherited Members | |
Protected Member Functions inherited from dsf::Edge | |
| void | m_setAngle (geometry::Point srcNodeCoordinates, geometry::Point dstNodeCoordinates) |
| 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.
| id | The road's id |
| nodePair | The road's node pair |
| length | The road's length, in meters (default is the mean vehicle length) |
| nLanes | The road's number of lanes (default is 1) |
| maxSpeed | The road's speed limit, in m/s (default is 50 km/h) |
| name | The road's name (default is an empty string) |
| capacity | The road's capacity (default is the maximum number of vehicles that can fit in the road) |
| transportCapacity | The road's transport capacity (default is 1) |
| void dsf::mobility::Road::addForbiddenTurn | ( | Id | roadId | ) |
Add a road id to the forbidden turns.
| roadId | The road id to add |
| int dsf::mobility::Road::capacity | ( | ) | const |
Get the road's capacity, in number of agents.
|
pure virtual |
Implemented in dsf::mobility::Street.
| std::set< Id > const & dsf::mobility::Road::forbiddenTurns | ( | ) | const |
Get the road's forbidden turns.
The forbidden turns are the road ids that are not allowed to be used by the agents when they are on the road.
| double dsf::mobility::Road::length | ( | ) | const |
Get the length, in meters.
| double dsf::mobility::Road::maxSpeed | ( | ) | const |
Get the maximum speed, in meters per second.
|
static |
Get the mean vehicle length.
|
pure virtual |
Implemented in dsf::mobility::Street.
| std::string dsf::mobility::Road::name | ( | ) | const |
Get the name.
|
pure virtual |
Implemented in dsf::mobility::Street.
| int dsf::mobility::Road::nLanes | ( | ) | const |
Get the number of lanes.
|
pure virtual |
Implemented in dsf::mobility::Street.
| int dsf::mobility::Road::priority | ( | ) | const |
Get the priority.
| void dsf::mobility::Road::setCapacity | ( | int | capacity | ) |
Set the capacity, in number of agents.
| capacity | The capacity |
| std::invalid_argument | If the capacity is less or equal to 0 |
| void dsf::mobility::Road::setForbiddenTurns | ( | std::set< Id > const & | forbiddenTurns | ) |
Replace the road's forbidden turns with the given set.
| forbiddenTurns | The set of forbidden turns |
| void dsf::mobility::Road::setMaxSpeed | ( | double | speed | ) |
Set the maximum speed, in meters per second (default is 50 km/h)
| speed | The maximum speed |
| std::invalid_argument | If the speed is less or equal to 0 |
|
static |
Set the mean vehicle length, in meters (default is 5)
| meanVehicleLength | The mean vehicle length |
| std::invalid_argument | If the mean vehicle length is less or equal to 0 |
| void dsf::mobility::Road::setPriority | ( | int | priority | ) |
Set the road's priority.
| priority | The road's priority |
| void dsf::mobility::Road::setTransportCapacity | ( | double | transportCapacity | ) |
Set the transport capacity, in number of agents.
| transportCapacity | The transport capacity |
| std::invalid_argument | If the transport capacity is less or equal to 0 |
| double dsf::mobility::Road::transportCapacity | ( | ) | const |
Get the road's transport capacity, in number of agents.
| Direction dsf::mobility::Road::turnDirection | ( | double const & | previousStreetAngle | ) | const |
Get the road's turn direction given the previous road angle.
| previousStreetAngle | The angle of the previous road |
The turn direction is the direction that the agent must take when it is on the road. The possible values are: