LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
line::qn::matching Namespace Reference

Classes

struct  Tput
 Per-class rates at a Matching station: matched, accepted and reneging. More...

Functions

template<class T>
bool is_matching (const NetworkStruct< T > &sn, std::size_t ist)
 True when station ist (1-based) is a Matching (FCFM) station.
template<class T>
bool is_matching_node (const NetworkStruct< T > &sn, std::size_t ind)
 True when node ind (1-based) is a Matching (FCFM) station.
template<class T>
std::vector< std::vector< bool > > compatibility (const NetworkStruct< T > &sn, std::size_t ist)
 Compatibility graph of Matching station ist (1-based), R x R.
template<class T>
long capacity (const NetworkStruct< T > &sn, std::size_t ist)
 Capacity of station ist (1-based), or -1 when the station is uncapped.
template<class T>
bool has_patience (const NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
 Whether class r (0-based) reneges at station ist (1-based).
template<class T>
mam::Map< T > patience_map (const NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
 The (D0, D1) representation of the class-r patience at station ist.
template<class T>
std::vector< std::size_t > phases (const NetworkStruct< T > &sn, std::size_t ist, std::size_t r, bool initial_only)
 Patience phases (1-based) a waiting class-r job can be in: {1} without patience, otherwise 1..K, or only the phases with positive initial probability when initial_only is true.
template<class T>
std::pair< std::vector< std::size_t >, std::vector< T > > entry (const NetworkStruct< T > &sn, std::size_t ist, std::size_t r)
 Initial patience phases (1-based) of a new class-r job and their probabilities.
template<class T>
std::vector< std::vector< T > > space (const NetworkStruct< T > &sn, std::size_t ist, const std::vector< std::size_t > &n, bool initial_only)
 Local states of Matching station ist (1-based) with per-class waiting counts n, WITHOUT the trailing routing variables.
template<class T>
std::vector< T > count_waiting (const NetworkStruct< T > &sn, std::size_t ind, const std::vector< T > &row)
 Per-class waiting counts of a Matching station's local state row (node ind, 1-based).
template<class T>
std::vector< std::pair< std::size_t, std::size_t > > word_of (const std::vector< T > &row, std::size_t w2)
 The (class, phase) pairs of a word, both 1-based, oldest first.
template<class T>
std::vector< T > pack (const std::vector< std::pair< std::size_t, std::size_t > > &w, const std::vector< T > &row, std::size_t w2)
 Pack a word back into a row of the width of row, keeping its trailing variables.
template<class T>
void after_event (const NetworkStruct< T > &sn, std::size_t ind, const std::vector< T > &inspace, lang::EventType event, std::size_t cls, std::vector< std::vector< T > > &rows, std::vector< T > &rates, std::vector< T > &probs)
 Successors of a Matching station (node ind, 1-based) after event on class cls (1-based): the rows, their rates (-1 on the passive ARV) and their probabilities.
template<class T>
std::vector< double > source_rates (const NetworkStruct< T > &sn)
 Arrival rate of each class at the Source (0 when the class has none).
template<class T>
Tput matching_tput (const NetworkStruct< T > &sn, std::size_t ist, const std::vector< const std::vector< T > * > &rows, const std::vector< double > &prob)
 Per-class rates at Matching station ist (1-based) from the probabilities prob of its local states rows (each [c_1 k_1 ... c_W k_W | vars]).

Function Documentation

◆ after_event()

template<class T>
void line::qn::matching::after_event ( const NetworkStruct< T > & sn,
std::size_t ind,
const std::vector< T > & inspace,
lang::EventType event,
std::size_t cls,
std::vector< std::vector< T > > & rows,
std::vector< T > & rates,
std::vector< T > & probs )

Successors of a Matching station (node ind, 1-based) after event on class cls (1-based): the rows, their rates (-1 on the passive ARV) and their probabilities.

Definition at line 259 of file matching_station.h.

References after_event(), line::lang::ARV, capacity(), compatibility(), line::mam::Map< T >::D0, line::mam::Map< T >::D1, entry(), has_patience(), line::InputError::InputError(), pack(), patience_map(), line::lang::PHASE, line::lang::RENEGE, and word_of().

Referenced by after_event(), and line::qn::after_event_station_base().

◆ capacity()

template<class T>
long line::qn::matching::capacity ( const NetworkStruct< T > & sn,
std::size_t ist )

Capacity of station ist (1-based), or -1 when the station is uncapped.

Definition at line 81 of file matching_station.h.

References capacity().

Referenced by after_event(), capacity(), matching_tput(), space(), and line::qn::state_impatience_unsupported().

◆ compatibility()

template<class T>
std::vector< std::vector< bool > > line::qn::matching::compatibility ( const NetworkStruct< T > & sn,
std::size_t ist )

Compatibility graph of Matching station ist (1-based), R x R.

Definition at line 70 of file matching_station.h.

References compatibility().

Referenced by after_event(), compatibility(), matching_tput(), line::nc::sn_matching_refusal(), line::nc::solver_nc_matching_analyzer(), and space().

◆ count_waiting()

template<class T>
std::vector< T > line::qn::matching::count_waiting ( const NetworkStruct< T > & sn,
std::size_t ind,
const std::vector< T > & row )

Per-class waiting counts of a Matching station's local state row (node ind, 1-based).

Definition at line 215 of file matching_station.h.

References count_waiting().

Referenced by count_waiting(), and line::qn::to_marginal_aggr().

◆ entry()

template<class T>
std::pair< std::vector< std::size_t >, std::vector< T > > line::qn::matching::entry ( const NetworkStruct< T > & sn,
std::size_t ist,
std::size_t r )

Initial patience phases (1-based) of a new class-r job and their probabilities.

Definition at line 131 of file matching_station.h.

References entry(), has_patience(), line::mam::map_pie(), and patience_map().

Referenced by after_event(), and entry().

◆ has_patience()

template<class T>
bool line::qn::matching::has_patience ( const NetworkStruct< T > & sn,
std::size_t ist,
std::size_t r )

◆ is_matching()

template<class T>
bool line::qn::matching::is_matching ( const NetworkStruct< T > & sn,
std::size_t ist )

◆ is_matching_node()

template<class T>
bool line::qn::matching::is_matching_node ( const NetworkStruct< T > & sn,
std::size_t ind )

True when node ind (1-based) is a Matching (FCFM) station.

Definition at line 63 of file matching_station.h.

References is_matching(), and is_matching_node().

Referenced by line::qn::after_event_station_base(), and is_matching_node().

◆ matching_tput()

template<class T>
Tput line::qn::matching::matching_tput ( const NetworkStruct< T > & sn,
std::size_t ist,
const std::vector< const std::vector< T > * > & rows,
const std::vector< double > & prob )

Per-class rates at Matching station ist (1-based) from the probabilities prob of its local states rows (each [c_1 k_1 ... c_W k_W | vars]).

A class-r arrival finding a compatible job waiting adds its rate to the matched throughput of both classes.

Definition at line 361 of file matching_station.h.

References line::qn::matching::Tput::acc, capacity(), compatibility(), line::mam::Map< T >::D1, has_patience(), matching_tput(), patience_map(), line::qn::matching::Tput::reneg, source_rates(), word_of(), and line::qn::matching::Tput::X.

Referenced by matching_tput(), line::ssa::serial_point(), and line::ctmc::solver_ctmc_avg_from_pi().

◆ pack()

template<class T>
std::vector< T > line::qn::matching::pack ( const std::vector< std::pair< std::size_t, std::size_t > > & w,
const std::vector< T > & row,
std::size_t w2 )

Pack a word back into a row of the width of row, keeping its trailing variables.

Definition at line 242 of file matching_station.h.

References pack().

Referenced by after_event(), and pack().

◆ patience_map()

template<class T>
mam::Map< T > line::qn::matching::patience_map ( const NetworkStruct< T > & sn,
std::size_t ist,
std::size_t r )

The (D0, D1) representation of the class-r patience at station ist.

Definition at line 98 of file matching_station.h.

References line::lang::dist_to_map(), patience_map(), and line::UnsupportedError::UnsupportedError().

Referenced by after_event(), entry(), matching_tput(), patience_map(), phases(), and line::qn::refresh_sync().

◆ phases()

template<class T>
std::vector< std::size_t > line::qn::matching::phases ( const NetworkStruct< T > & sn,
std::size_t ist,
std::size_t r,
bool initial_only )

Patience phases (1-based) a waiting class-r job can be in: {1} without patience, otherwise 1..K, or only the phases with positive initial probability when initial_only is true.

Definition at line 113 of file matching_station.h.

References line::mam::Map< T >::D0, has_patience(), line::mam::map_pie(), patience_map(), and phases().

Referenced by phases(), and space().

◆ source_rates()

template<class T>
std::vector< double > line::qn::matching::source_rates ( const NetworkStruct< T > & sn)

Arrival rate of each class at the Source (0 when the class has none).

Definition at line 332 of file matching_station.h.

References source_rates().

Referenced by matching_tput(), line::nc::sn_matching_refusal(), line::nc::solver_nc_matching_analyzer(), and source_rates().

◆ space()

template<class T>
std::vector< std::vector< T > > line::qn::matching::space ( const NetworkStruct< T > & sn,
std::size_t ist,
const std::vector< std::size_t > & n,
bool initial_only )

Local states of Matching station ist (1-based) with per-class waiting counts n, WITHOUT the trailing routing variables.

A count vector whose support is not an independent set of G, or that exceeds the capacity, has no state. With initial_only only the patience phases a new job can start in are listed. An uncapped node has only the empty state (one zero pair), which is all SolverNC needs; any non-empty marginal there is refused.

Definition at line 161 of file matching_station.h.

References capacity(), compatibility(), line::InputError::InputError(), phases(), and space().

Referenced by line::qn::from_marginal_and_started_core(), line::qn::from_marginal_core(), and space().

◆ word_of()

template<class T>
std::vector< std::pair< std::size_t, std::size_t > > line::qn::matching::word_of ( const std::vector< T > & row,
std::size_t w2 )

The (class, phase) pairs of a word, both 1-based, oldest first.

Definition at line 229 of file matching_station.h.

References word_of().

Referenced by after_event(), matching_tput(), and word_of().