![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Port of matlab/src/api/sn/sn_schedule_nominal.m: unpack the MAPt or PHt slot of sn.proc at one (station, class) into the per-segment (D0, D1) pairs and their width-weighted time average. More...
#include <cstddef>#include <vector>#include "line/lang/lang_types.h"#include "line/lang/qn/network_struct.h"#include "line/num/number.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::sn::ScheduleNominal< T > |
| What sn_schedule_nominal returns, in the reference's own output order. More... | |
Namespaces | |
| namespace | line |
| namespace | line::sn |
Functions | |
| template<class T> | |
| bool | line::sn::sn_has_schedule (const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r) |
| True when (ist, r) carries a MAPt / PHt / NHPP schedule. | |
| template<class T> | |
| ScheduleNominal< T > | line::sn::sn_schedule_nominal (const qn::NetworkStruct< T > &sn, std::size_t ist, std::size_t r) |
| Port of sn_schedule_nominal(sn, ist, r); ist and r are 0-based here. | |
Port of matlab/src/api/sn/sn_schedule_nominal.m: unpack the MAPt or PHt slot of sn.proc at one (station, class) into the per-segment (D0, D1) pairs and their width-weighted time average.
IT IS AN ACCESSOR HERE AND A DECODER THERE, and the difference is where the conversion happens. MATLAB stores the slot as {breakpoints, A, B, cyclic} with A and B holding (D0, D1) for a MAPt and (alpha, S) for a PHt, so every reader must know which family it is looking at and rebuild the MAP pair (S, (-S e) alpha) itself. This port converts a PHt ONCE, in Distrib::pht, so what is stored is always the MAP schedule and every reader sees one representation. The nominal pair is likewise computed once, in the constructor, and lives in Distrib::D0 / D1 where a time-blind consumer – the phase count, sn.rates, the fluid layout – already looks for it.
What is left for this function is the CONTRACT: return the same six outputs the reference returns, and refuse a (station, class) that carries no schedule rather than inventing a one-segment one. A caller that wants the nominal of an ordinary process reads sn.service[i][r].D0 directly, which is what the reference's own nomD0/nomD1 fallback does.
Definition in file sn_schedule_nominal.h.