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

Public Member Functions

 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.
 
virtual bool isFull () const =0
 
double deltaAngle (double const previousEdgeAngle) const
 

Protected Member Functions

void m_setAngle (geometry::Point srcNodeCoordinates, geometry::Point dstNodeCoordinates)
 

Protected Attributes

geometry::PolyLine m_geometry
 
Id m_id
 
std::pair< Id, Id > m_nodePair
 
std::optional< double > m_weight
 
double m_angle
 

Constructor & Destructor Documentation

◆ Edge()

dsf::Edge::Edge ( Id id,
std::pair< Id, Id > nodePair,
geometry::PolyLine geometry = {} )

Construct a new Edge object.

Parameters
idThe edge's id
nodePairThe edge's node pair (u, v) with the edge u -> v
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()

auto dsf::Edge::angle ( ) const
inline

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

Returns
double The edge's angle, in radians

◆ geometry()

auto const & dsf::Edge::geometry ( ) const
inline

Get the edge's geometry.

Returns
dsf::geometry::PolyLine The edge's geometry, a vector of pairs of doubles representing the coordinates of the edge's geometry

◆ id()

auto dsf::Edge::id ( ) const
inline

Get the edge's id.

Returns
Id The edge's id

◆ isFull()

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

Implemented in dsf::mobility::Street.

◆ nodePair()

auto const & dsf::Edge::nodePair ( ) const
inline

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.

◆ setGeometry()

void dsf::Edge::setGeometry ( geometry::PolyLine geometry)

Set the edge's geometry.

Parameters
geometrydsf::geometry::PolyLine The edge's geometry, a vector of pairs of doubles representing the coordinates of the edge's geometry

◆ setWeight()

void dsf::Edge::setWeight ( double const weight)

Set the edge's weight.

Parameters
weightThe edge's weight
Exceptions
std::invalid_argumentif the weight is less or equal to 0

◆ source()

auto dsf::Edge::source ( ) const
inline

Get the edge's source node id.

Returns
Id The edge's source node id

◆ target()

auto dsf::Edge::target ( ) const
inline

Get the edge's target node id.

Returns
Id The edge's target node id

◆ 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 files: