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

The priority branch of the mfq method: a port of solver_mfq_prio.m. More...

#include <algorithm>
#include <cmath>
#include <cstddef>
#include <numeric>
#include <string>
#include <vector>
#include "line/api/mam/mfq_prio_queue.h"
#include "line/api/mam/mmap_lambda.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/fluid/fluid_mfq.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for fluid_mfq_prio.h:

Go to the source code of this file.

Classes

struct  line::fluid::MfqPrioResult
 Per-class metrics of the priority queue, indexed by class. More...

Namespaces

namespace  line
namespace  line::fluid

Functions

template<class T>
MfqPrioResult line::fluid::fluid_mfq_prio (const qn::NetworkStruct< T > &sn, const MfqTopology &top, double tol)
 Solve the single priority fluid queue of sn.

Detailed Description

The priority branch of the mfq method: a port of solver_mfq_prio.m.

WHEN IT IS REACHED. solver_fluid_analyzer.m sends a single-queue open model to solver_mfq when every class has the same priority and HERE when they do not. The model is the same one mfq solves – Source -> Queue -> Sink – but the server now drains the highest-priority fluid first, preemptively, so the per-class levels no longer follow from one fluid-fluid queue.

WHAT IS SOLVED. Each class arrives as a MAP. The per-class background chains are SUPERPOSED into one joint chain by a Kronecker sum, and the joint chain modulates a K x N rate matrix, one row per class. That pair (Qjoint, Rjoint) with the constant drain rate d is exactly the input of the fluid priority queue of G. Horvath, "Efficient analysis of the MMAP[K]/PH[K]/1 priority queue", EJOR 246(1):128-139, 2015, already ported as mam::mfq_prio_queue. The fluid level of a class is read as its queue length and the fluid sojourn as its response time, the same reading solver_mfq.m makes.

THE ROW ORDER MATTERS AND IS INVERTED. LINE's classprio is a RANK: the SMALLER the value the HIGHER the priority. FluidPrioQueue takes the opposite convention, the LAST row being the highest priority. The reference therefore sorts the open classes by classprio DESCENDING before building the rows, and this port keeps that sort stable so ties preserve class order.

WHEN IT DECLINES. The reference falls back to the matrix fluid method, with a warning, whenever the fluid priority model degenerates: a non-MAP arrival, class-dependent or non-positive service, or a joint chain with a single state (unmodulated arrivals, where the fluid level is identically zero and the priority structure carries no information). This port reports the same decision through MfqPrioResult::fallback and lets the caller re-dispatch, rather than returning zeros that look like an answer.

A FLUID LEVEL IS NOT A CUSTOMER COUNT. The level is zero unless the ARRIVAL RATE EXCEEDS d in some background state; a class whose peak rate stays below the drain rate reports QN = 0 exactly, which is correct for the fluid model and is not a failure of the solve.

Definition in file fluid_mfq_prio.h.