Loading [MathJax]/extensions/tex2jax.js
Dynamical system model
All Classes Namespaces Files Functions Pages
dsm::Station Class Reference
Inheritance diagram for dsm::Station:
dsm::RoadJunction dsm::Node

Public Member Functions

 Station (Id id, Delay managementTime)
 Construct a new Station object.
 
 Station (Id id, std::pair< double, double > coords, Delay managementTime)
 Construct a new Station object.
 
 Station (RoadJunction const &node, Delay managementTime)
 Construct a new Station object.
 
 Station (Station const &other)
 Construct a new Station object by copying another Station object.
 
void enqueue (Id trainId, train_t trainType)
 Enqueue a train in the station.
 
Id dequeue ()
 Dequeue a train from the station.
 
Delay managementTime () const
 Get the time it takes between two train departures/arrivals.
 
double density () const
 Get the train density of the station.
 
bool isFull () const
 Check if the station is full.
 
bool isStation () const noexcept final
 Check if the node is a station.
 
- Public Member Functions inherited from dsm::RoadJunction
 RoadJunction (Id id)
 
 RoadJunction (Id id, std::pair< double, double > coords)
 
 RoadJunction (RoadJunction const &other)
 
RoadJunctionoperator= (RoadJunction const &other)
 
virtual void setCapacity (Size capacity)
 Set the junction's capacity.
 
void setTransportCapacity (double capacity)
 Set the junction's transport capacity.
 
Size capacity () const
 Get the junction's capacity.
 
double transportCapacity () const
 Get the junction's transport capacity.
 
virtual bool isIntersection () const noexcept
 
virtual bool isTrafficLight () const noexcept
 
virtual bool isRoundabout () const noexcept
 
- Public Member Functions inherited from dsm::Node
 Node (Id id)
 Construct a new Node object with capacity 1.
 
 Node (Id id, std::pair< double, double > coords)
 Construct a new Node object with capacity 1.
 
 Node (Node const &other)
 
Nodeoperator= (Node const &other)
 
void setId (Id id)
 Set the node's id.
 
void setCoords (std::pair< double, double > coords)
 Set the node's coordinates.
 
void setName (const std::string &name)
 Set the node's name.
 
Id id () const
 Get the node's id.
 
const std::optional< std::pair< double, double > > & coords () const
 Get the node's coordinates.
 
const std::string & name () const
 Get the node's name.
 

Additional Inherited Members

- Protected Attributes inherited from dsm::Node
Id m_id
 
std::optional< std::pair< double, double > > m_coords
 
std::string m_name
 

Constructor & Destructor Documentation

◆ Station() [1/4]

dsm::Station::Station ( Id id,
Delay managementTime )

Construct a new Station object.

Parameters
idThe station's id
managementTimeThe time it takes between two train departures/arrivals

◆ Station() [2/4]

dsm::Station::Station ( Id id,
std::pair< double, double > coords,
Delay managementTime )

Construct a new Station object.

Parameters
idThe station's id
coordsA std::pair containing the station's coordinates (lat, lon)
managementTimeThe time it takes between two train departures/arrivals

◆ Station() [3/4]

dsm::Station::Station ( RoadJunction const & node,
Delay managementTime )

Construct a new Station object.

Parameters
nodeA Node object representing the station
managementTimeThe time it takes between two train departures/arrivals

◆ Station() [4/4]

dsm::Station::Station ( Station const & other)

Construct a new Station object by copying another Station object.

Parameters
otherThe Station object to copy

Member Function Documentation

◆ density()

double dsm::Station::density ( ) const
virtual

Get the train density of the station.

Returns
The train density of the station

Reimplemented from dsm::RoadJunction.

◆ dequeue()

Id dsm::Station::dequeue ( )

Dequeue a train from the station.

Returns
The id of the dequeued train

◆ enqueue()

void dsm::Station::enqueue ( Id trainId,
train_t trainType )

Enqueue a train in the station.

Parameters
trainIdThe id of the train to enqueue
trainTypeThe type of the train to enqueue

◆ isFull()

bool dsm::Station::isFull ( ) const
virtual

Check if the station is full.

Returns
True if the station is full, false otherwise

Reimplemented from dsm::RoadJunction.

◆ isStation()

bool dsm::Station::isStation ( ) const
finalvirtualnoexcept

Check if the node is a station.

Returns
True

Reimplemented from dsm::Node.

◆ managementTime()

Delay dsm::Station::managementTime ( ) const

Get the time it takes between two train departures/arrivals.

Returns
The management time

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