Dynamical system model
Loading...
Searching...
No Matches
dsm::Station Class Reference
Inheritance diagram for dsm::Station:
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 (Node 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 final
 Get the train density of the station.
 
bool isFull () const final
 Check if the station is full.
 
bool isStation () const noexcept final
 Check if the node is a station.
 
- 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.
 
virtual void setCapacity (Size capacity)
 Set the node's capacity.
 
virtual void setTransportCapacity (int capacity)
 Set the node's transport capacity.
 
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.
 
Size capacity () const
 Get the node's capacity.
 
int transportCapacity () const
 Get the node's transport capacity.
 
virtual bool isIntersection () const noexcept
 
virtual bool isTrafficLight () const noexcept
 
virtual bool isRoundabout () const noexcept
 

Additional Inherited Members

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

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 ( Node 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
finalvirtual

Get the train density of the station.

Returns
The train density of the station

Implements dsm::Node.

◆ 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
finalvirtual

Check if the station is full.

Returns
True if the station is full, false otherwise

Implements dsm::Node.

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