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

A separation function together with the name it is known by. More...

#include <VSSModel.hpp>

Public Member Functions

constexpr SeparationFunction (std::string_view name, SeparationFunctionCallable function)
 Names a separation function.
constexpr std::string_view get_name () const
 Retrieves the name of the separation function.
double operator() (size_t i, size_t n) const
 Computes the normalized position of a node.

Detailed Description

A separation function together with the name it is known by.

Two solver runs that only differ in their separation functions are otherwise indistinguishable, because a callable cannot be written out. Hence every separation function carries a name, which is what identifies it wherever the settings of a run are reported, e.g. in the exported solver data.

Constructor & Destructor Documentation

◆ SeparationFunction()

cda_rail::vss::SeparationFunction::SeparationFunction ( std::string_view name,
SeparationFunctionCallable function )
inlineconstexpr

Names a separation function.

Parameters
nameName identifying the function, must not be empty and must outlive the object, e.g., a string literal.
functionThe separation function itself, must not be empty.
Exceptions
std::invalid_argumentif the name or the function is empty.

Member Function Documentation

◆ get_name()

std::string_view cda_rail::vss::SeparationFunction::get_name ( ) const
inlinenodiscardconstexpr

Retrieves the name of the separation function.

Returns
The name.

◆ operator()()

double cda_rail::vss::SeparationFunction::operator() ( size_t i,
size_t n ) const
inlinenodiscard

Computes the normalized position of a node.

Parameters
iZero-based node index.
nTotal number of nodes.
Returns
Normalized position in [0, 1].

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