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

Port of solver_nc_retrieval_analyzer.m: the OPEN delayed-hit (retrieval-system) cache. More...

#include <cmath>
#include <cstddef>
#include <limits>
#include <string>
#include <vector>
#include "line/api/retrieval/cache_retrieval_inputs.h"
#include "line/api/retrieval/retrieval_metrics.h"
#include "line/api/retrieval/retrieval_nc.h"
#include "line/api/retrieval/retrieval_rayint.h"
#include "line/lang/qn/network_struct.h"
#include "line/solvers/nc/nc_types.h"
#include "line/solvers/nc/solver_nc.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/matrix.h"
Include dependency graph for solver_nc_retrieval.h:

Go to the source code of this file.

Classes

struct  line::nc::NcRetrievalSolution< T >
 What the delayed-hit analyzer returns beyond the metric table. More...

Namespaces

namespace  line
namespace  line::nc

Functions

template<class T>
NcRetrievalSolution< T > line::nc::solver_nc_retrieval_analyzer (const qn::NetworkStruct< T > &sn, const NcSolverOptions &opt)
 Port of solver_nc_retrieval_analyzer.m.
template<class T>
bool line::nc::nc_has_retrieval (const qn::NetworkStruct< T > &sn)
 True when the model's Cache carries a delayed-hit retrieval system.

Detailed Description

Port of solver_nc_retrieval_analyzer.m: the OPEN delayed-hit (retrieval-system) cache.

WHAT A DELAYED HIT IS, since the three-way split is the whole point. A miss does not simply fail: it starts a FETCH that circulates the item through the retrieval stations and back into the cache. A read arriving while that fetch is still in flight is neither a hit (the item is not resident) nor an ordinary miss (no second fetch is started) – it is a DELAYED HIT, and it waits for the fetch already running. So

true hit + delayed hit + miss = 1

and only the MISS fraction starts new work. That is why the throughput split below sends hits AND delayed hits to the hit class, and misses alone to the miss class: the delayed hit is served by a fetch the miss already paid for.

EXACT, NOT A FIXED POINT. SolverMVA solves this shape with retrieval_fpi, iterating to a tolerance. SolverNC uses the product-form recurrences instead: retrieval_nc for the normalizing constant and retrieval_metrics for the three ratios, both exact. The reference reports method = 'exact' on that basis and leaves LATENCY to SolverMVA, returning NaN – the latency needs retrieval_fpi_latency, which is a different algorithm and not this one's.

THE RETRIEVAL STATIONS ARE READ OFF phi, NOT SOLVED. pdh(s,i) is the mean number of copies of item i being fetched at station s, so summing over items gives the station occupancy directly; the throughput comes from the per-item fetch rate times the visit ratios of the fetch routing, and the response time from Little's law. No queueing solve is involved.

Definition in file solver_nc_retrieval.h.