Dynamical system model
|
Public Member Functions | |
Road (Id id, const Road &) | |
Construct a new Road object starting from an existing 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(), std::optional< int > capacity=std::nullopt, int transportCapacity=1) | |
Construct a new Road object. | |
void | setMaxSpeed (double speed) |
Set the maximum speed, in meters per second (default is 50 km/h) | |
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. | |
std::string | name () const |
Get the name. | |
virtual void | addAgent (Id agentId)=0 |
virtual int | nAgents () const =0 |
virtual int | nMovingAgents () const =0 |
virtual int | nExitingAgents () const =0 |
virtual double | density (bool normalized=false) const =0 |
Public Member Functions inherited from dsm::Edge | |
Edge (Id id, std::pair< Id, Id > nodePair, int capacity=1, int transportCapacity=1, double angle=0.0) | |
Construct a new Edge object. | |
void | setCapacity (int capacity) |
void | setTransportCapacity (int capacity) |
void | setAngle (std::pair< double, double > srcNodeCoordinates, std::pair< double, double > dstNodeCoordinates) |
Id | id () const |
Get the edge's id. | |
Id | u () const |
Get the edge's source node id. | |
Id | v () const |
Get the edge's destination node id. | |
std::pair< Id, Id > const & | nodePair () const |
Get the edge's node pair. | |
int | capacity () const |
Get the edge's capacity, in number of agents. | |
int | transportCapacity () const |
Get the edge's transport capacity, in number of agents. | |
double | angle () const |
Get the edge's angle, in radians, between the source and destination nodes. | |
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 |
std::string | m_name |
Protected Attributes inherited from dsm::Edge | |
Id | m_id |
std::pair< Id, Id > | m_nodePair |
int | m_capacity |
int | m_transportCapacity |
double | m_angle |
Static Protected Attributes | |
static double | m_meanVehicleLength |
dsm::Road::Road | ( | Id | id, |
const Road & | ) |
dsm::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(), | ||
std::optional< int > | capacity = std::nullopt, | ||
int | 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) |
|
pure virtual |
Implemented in dsm::SpireStreet, and dsm::StochasticSpireStreet.
|
pure virtual |
Implemented in dsm::Street.
double dsm::Road::length | ( | ) | const |
Get the length, in meters.
double dsm::Road::maxSpeed | ( | ) | const |
Get the maximum speed, in meters per second.
|
static |
Get the mean vehicle length.
|
pure virtual |
Implemented in dsm::Street.
std::string dsm::Road::name | ( | ) | const |
Get the name.
|
pure virtual |
Implemented in dsm::Street.
int dsm::Road::nLanes | ( | ) | const |
Get the number of lanes.
void dsm::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 |