Dynamical system model
Loading...
Searching...
No Matches
dsf::Edge Class Referenceabstract
Inheritance diagram for dsf::Edge:
dsf::Road dsf::Street dsf::SpireStreet dsf::StochasticStreet dsf::StochasticSpireStreet

Public Member Functions

 Edge (Id id, std::pair< Id, Id > nodePair, int capacity=1, double transportCapacity=1., std::vector< std::pair< double, double > > geometry={})
 Construct a new Edge object.
 
 Edge (Edge &&)=default
 
 Edge (const Edge &)=delete
 
void resetId (Id newId)
 
void setCapacity (int capacity)
 
void setTransportCapacity (double capacity)
 
void setGeometry (std::vector< std::pair< double, double > > geometry)
 
void setWeight (double const weight)
 
void setStrId (std::string const &strId)
 
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.
 
std::vector< std::pair< double, double > > const & geometry () const
 
int capacity () const
 Get the edge's capacity, in number of agents.
 
double 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 target nodes.
 
double weight () const
 Get the edge's weight.
 
std::optional< std::string > const & strId () const noexcept
 
virtual bool isFull () const =0
 
double deltaAngle (double const previousEdgeAngle) const
 

Protected Member Functions

void m_setAngle (std::pair< double, double > srcNodeCoordinates, std::pair< double, double > dstNodeCoordinates)
 

Protected Attributes

std::vector< std::pair< double, double > > m_geometry
 
Id m_id
 
std::pair< Id, Id > m_nodePair
 
int m_capacity
 
double m_transportCapacity
 
std::optional< double > m_weight
 
double m_angle
 
std::optional< std::string > m_strId
 

Constructor & Destructor Documentation

◆ Edge()

dsf::Edge::Edge ( Id id,
std::pair< Id, Id > nodePair,
int capacity = 1,
double transportCapacity = 1.,
std::vector< std::pair< double, double > > geometry = {} )

Construct a new Edge object.

Parameters
idThe edge's id
nodePairThe edge's node pair (u, v) with the edge u -> v
capacityThe edge's capacity, in number of agents, i.e. the maximum number of agents that can be on the edge at the same time. Default is 1.
transportCapacityThe edge's transport capacity, in number of agents, i.e. the maximum number of agents that can be emitted by the same time. Default is 1.
geometryThe edge's geometry, a vector of pairs of doubles representing the coordinates of the edge's geometry. Default is an empty vector.

Member Function Documentation

◆ angle()

double dsf::Edge::angle ( ) const

Get the edge's angle, in radians, between the source and target nodes.

Returns
double The edge's angle, in radians

◆ capacity()

int dsf::Edge::capacity ( ) const

Get the edge's capacity, in number of agents.

Returns
int The edge's capacity, in number of agents

◆ id()

Id dsf::Edge::id ( ) const

Get the edge's id.

Returns
Id The edge's id

◆ isFull()

virtual bool dsf::Edge::isFull ( ) const
pure virtual

Implemented in dsf::Street.

◆ nodePair()

std::pair< Id, Id > const & dsf::Edge::nodePair ( ) const

Get the edge's node pair.

Returns
std::pair<Id, Id> The edge's node pair, where the first element is the source node id and the second element is the target node id. The pair is (u, v) with the edge u -> v.

◆ source()

Id dsf::Edge::source ( ) const

Get the edge's source node id.

Returns
Id The edge's source node id

◆ target()

Id dsf::Edge::target ( ) const

Get the edge's target node id.

Returns
Id The edge's target node id

◆ transportCapacity()

double dsf::Edge::transportCapacity ( ) const

Get the edge's transport capacity, in number of agents.

Returns
int The edge's transport capacity, in number of agents

◆ weight()

double dsf::Edge::weight ( ) const

Get the edge's weight.

Returns
double The edge's weight

The documentation for this class was generated from the following file: