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

How a VSS generation solver models the VSS borders. More...

#include <VSSModel.hpp>

Public Member Functions

 Model ()=default
 The continuous model without separation functions.
 Model (ModelType model_type_input)
 A model type used without separation functions.
 Model (ModelType model_type_input, std::vector< SeparationFunction > separation_functions_input)
 A model type together with the separation functions it uses.
 Model (ModelType model_type_input, std::vector< SeparationFunction > separation_functions_input, bool only_stop_at_vss_input)
 The same, restricting where trains are allowed to stop.
const ModelType & get_model_type () const
 Retrieves the model type.
bool get_only_stop_at_vss () const
 Whether trains may only stop at VSS borders.
const std::vector< SeparationFunction > & get_separation_functions () const
 Retrieves the separation functions.
std::string get_separation_function_names () const
 Retrieves the names of the separation functions, comma separated.
bool check_consistency () const
 Validates that the model type and separation functions are consistently configured.

Detailed Description

How a VSS generation solver models the VSS borders.

Which separation functions are needed depends on the model type, see ModelType and check_consistency. They are ignored by the continuous model, which is why they are optional.

Constructor & Destructor Documentation

◆ Model() [1/4]

cda_rail::vss::Model::Model ( )
explicitdefault

The continuous model without separation functions.

◆ Model() [2/4]

cda_rail::vss::Model::Model ( ModelType model_type_input)
inlineexplicit

A model type used without separation functions.

◆ Model() [3/4]

cda_rail::vss::Model::Model ( ModelType model_type_input,
std::vector< SeparationFunction > separation_functions_input )
inlineexplicit

A model type together with the separation functions it uses.

◆ Model() [4/4]

cda_rail::vss::Model::Model ( ModelType model_type_input,
std::vector< SeparationFunction > separation_functions_input,
bool only_stop_at_vss_input )
inlineexplicit

The same, restricting where trains are allowed to stop.

Parameters
only_stop_at_vss_inputIf set, trains may only stop at VSS borders, not anywhere on an edge.

Member Function Documentation

◆ check_consistency()

bool cda_rail::vss::Model::check_consistency ( ) const
inlinenodiscard

Validates that the model type and separation functions are consistently configured.

Checks that the model_type and separation_functions match one of these valid configurations:

  • Discrete with exactly 1 separation function
  • Continuous with 0 separation functions
  • Inferred with at least 1 separation function
  • InferredAlt with at least 1 separation function
Returns
true if the configuration is valid, false otherwise.

◆ get_model_type()

const ModelType & cda_rail::vss::Model::get_model_type ( ) const
inlinenodiscard

Retrieves the model type.

Returns
const ModelType& A constant reference to the model type.

◆ get_only_stop_at_vss()

bool cda_rail::vss::Model::get_only_stop_at_vss ( ) const
inlinenodiscard

Whether trains may only stop at VSS borders.

◆ get_separation_function_names()

std::string cda_rail::vss::Model::get_separation_function_names ( ) const
inlinenodiscard

Retrieves the names of the separation functions, comma separated.

In contrast to get_separation_functions this does not throw if the model has no separation functions, because a model without them, namely a continuous one, is perfectly valid.

Returns
std::string The names in order, empty if there are none.

◆ get_separation_functions()

const std::vector< SeparationFunction > & cda_rail::vss::Model::get_separation_functions ( ) const
inlinenodiscard

Retrieves the separation functions.

Returns
const std::vector<SeparationFunction>& The functions in order.
Exceptions
std::logic_errorIf the model has none.

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