LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
solver_mva_sjn.h File Reference

Closed networks with shortest-job-next (SJF) stations, ladder branch 0. More...

#include <cmath>
#include <limits>
#include <string>
#include <vector>
#include "line/api/pfqn/pfqn_sjn.h"
#include "line/lang/lang_types.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/mva/mva_types.h"
#include "line/solvers/mva/sn_chain.h"
Include dependency graph for solver_mva_sjn.h:

Go to the source code of this file.

Classes

struct  line::mva::SjnAnalyzerResult< T >
 What the analyzer returns, the reference's metrics plus its actualmethod. More...

Namespaces

namespace  line
namespace  line::mva

Functions

template<class T>
bool line::mva::sn_has_sjn (const qn::NetworkStruct< T > &L)
 True when the layer has an SJF station, the reference's any(sn.sched == SchedStrategy.SJF).
template<class T>
SjnAnalyzerResult< T > line::mva::solver_mva_sjn_analyzer (const qn::NetworkStruct< T > &L, const MvaOptions &opt)
 Port of solver_mva_sjn_analyzer.m.

Variables

constexpr double line::mva::kSjnLatticeMax = 1e5
 Lattice size above which default prefers the fixed point.

Detailed Description

Closed networks with shortest-job-next (SJF) stations, ladder branch 0.

Templated port of matlab/src/solvers/MVA/solver_mva_sjn_analyzer.m, cross-checked against jar/src/main/java/jline/solvers/mva/analyzers/Solver_mva_sjn_analyzer.java.

A non-preemptive SJF station serves the shortest queued job first, the job size being known on arrival. It is not product form and no ordinary MVA equation covers it, so the station is modelled by the conditional waiting time equation of K. Kant, "MVA approximations for SJN scheduling", Performance Evaluation 15(1):41-61, 1992, which pfqn_sjn.h carries.

WHY THE LADDER PUTS THIS FIRST. mvaDispatch.m tests hasSJN ahead of every other branch, and the branches are NOT disjoint: a closed model with an SJF station and a delay would otherwise fall through to the generic AMVA path, which reads only the mean service time and would report the SJF station as if it scheduled size-blind. The answer would be a plausible number for a different model, which is worse than a refusal.

CLOSED MODELS ONLY, BY NAME. The conditional waiting time equation is a POPULATION recursion, so the open case has nothing to recur over. MATLAB's getFeatureSet declares SchedStrategy_SJF unconditionally and the dispatch then refuses the open case by name; the boolean registry cannot express "this discipline, but only in a closed model", so the C++ gate declares the feature and this file carries the same imperative refusal.

LATTICE OR FIXED POINT. The exact recursion steps over prod(N+1) states, so default switches to the Schweitzer closure once the lattice exceeds kLatticeMax. Ask for exact or mva to force the lattice, amva or bs to force the fixed point; sjn.mva and sjn.amva name them directly. The reported actualmethod is the one actually run.

OTHER STATIONS. The remaining stations are solved with the single-server MVA equation, so the reference restricts them to INF (folded into the think time) and single-server PS, LCFS-PR, FCFS or SIRO. Anything else, and any multi-server queueing station, is refused by name.

WARNINGS, AND HOW FAR THEY GET. The reference calls line_warning in two places that still return a usable answer: the utilization cap binding, and the fixed point exhausting its iterations. pfqn_sjn.h turns both into result flags because the api layer has no warning channel; this file turns the flags back into the reference's own text on SjnAnalyzerResult::warning, which mva_dispatch.h copies onto DispatchResult::warning. That is as far as it goes: this port has NO general warning facility, and solver_mva_runner.h does not read the field, so a user going through SolverMVA still does not see it. Recorded here as a known divergence rather than left silent – the capped answer is stable and satisfies the population law exactly, but its accuracy is not warranted, and a number that looks authoritative while carrying an accuracy claim the reference declines to make is worse than a visibly wrong one.

Arithmetic: TRANSCENDENTAL. The recursion evaluates regularized incomplete gammas on a Simpson grid; pfqn_sjn.h is a double-precision API for that reason, and the exact (Rational) path is refused by name below.

Definition in file solver_mva_sjn.h.