MTCT
Design Automation and Optimization for ETCS Railway Networks
Loading...
Searching...
No Matches
cda_rail::ScheduledStop Class Reference

Scheduling information for a stop within a timetable. More...

#include <Timetable.hpp>

Public Member Functions

 ScheduledStop (double const serviceTime, double const serviceDuration, std::shared_ptr< Station > station)
 Constructs a scheduled stop for a concrete station.
double get_service_time () const
 Retrieves the earliest service start time.
double get_earliest_departure () const
 Computes the earliest departure time from this stop.
double get_service_duration () const
 Accesses the minimum service duration.
Station const & get_station () const
 Accesses the station associated with this stop.
void set_service_time (double new_service_time)
 Sets the earliest service start time.
void set_service_duration (double new_service_duration)
 Sets the minimum service duration.
void set_station (std::shared_ptr< Station > new_station)
 Sets the station for this scheduled stop.

Friends

class Timetable

Detailed Description

Scheduling information for a stop within a timetable.

Stores the earliest service start time, the minimum service duration, and the associated station.

Invariant
m_service_time >= 0 (non-negative).
m_service_duration >= 0 (non-negative).
m_station is always non-null after construction.

Constructor & Destructor Documentation

◆ ScheduledStop()

cda_rail::ScheduledStop::ScheduledStop ( double const serviceTime,
double const serviceDuration,
std::shared_ptr< Station > station )
inline

Constructs a scheduled stop for a concrete station.

Precondition
serviceTime >= 0 (non-negative).
serviceDuration >= 0 (non-negative).
station must not be null.
Parameters
serviceTimeEarliest service start time.
serviceDurationMinimum required service duration.
stationStation at which the stop is scheduled.
Exceptions
cda_rail::exceptions::InvalidInputExceptionIf preconditions are violated.

Member Function Documentation

◆ get_earliest_departure()

double cda_rail::ScheduledStop::get_earliest_departure ( ) const
inlinenodiscard

Computes the earliest departure time from this stop.

Returns
The earliest departure time.

◆ get_service_duration()

double cda_rail::ScheduledStop::get_service_duration ( ) const
inlinenodiscard

Accesses the minimum service duration.

Returns
Minimum service duration (guaranteed >= 0).

◆ get_service_time()

double cda_rail::ScheduledStop::get_service_time ( ) const
inlinenodiscard

Retrieves the earliest service start time.

Returns
The service start time, guaranteed to be non-negative.

◆ get_station()

Station const & cda_rail::ScheduledStop::get_station ( ) const
inlinenodiscard

Accesses the station associated with this stop.

Returns
Constant reference to the associated station (guaranteed non-null).

◆ set_service_duration()

void cda_rail::ScheduledStop::set_service_duration ( double new_service_duration)
inline

Sets the minimum service duration.

Parameters
new_service_durationNew minimum service duration.
Exceptions
cda_rail::exceptions::InvalidInputExceptionIf the duration is negative.

◆ set_service_time()

void cda_rail::ScheduledStop::set_service_time ( double new_service_time)
inline

Sets the earliest service start time.

Precondition
new_service_time >= 0 (non-negative).
Parameters
new_service_timeNew earliest service start time.
Exceptions
cda_rail::exceptions::InvalidInputExceptionIf new_service_time is negative.

◆ set_station()

void cda_rail::ScheduledStop::set_station ( std::shared_ptr< Station > new_station)
inline

Sets the station for this scheduled stop.

Precondition
new_station must not be null.
Parameters
new_stationNew station pointer.
Exceptions
cda_rail::exceptions::InvalidInputExceptionIf new_station is null.

◆ Timetable

friend class Timetable
friend

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