Package jline.api.cache
Class CacheSojourn
java.lang.Object
jline.api.cache.CacheSojourn
The average of a cache mean-field trajectory against a phase-type clock,
integrated WITH the drift. Java twin of MATLAB
cache_sojourn_ode.m.
For a drift dx/dt = f(x) and a clock with row phase vector
phi, dphi/dt = phi A, density g(t) = phi(t) c, it
returns xbar = int_0^T x g dt / int_0^T g dt and wtot = int_0^T
g dt, by augmenting the state with phi, int g x and
int g. The value is accurate to the ODE tolerance and does NOT depend
on any output grid: a Riemann sum over the grid did, and that is what made the
adaptive (MATLAB) and fixed-grid (JAR/Python/C++) ENV cache mean fields differ
in the third digit.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA phase-type clock:dphi/dt = phi A,phi(0) = phi0, densityphi c.static interfaceThe drift of the cache mean field.static final classA sojourn average: occupancyxbar(null whenwtotis 0), clock mass, per-user miss rate. -
Method Summary
Modifier and TypeMethodDescriptionstatic CacheSojourn.Resultaverage(CacheSojourn.Drift f, double[] x0, double t1, CacheSojourn.Clock clk) Integrates the augmented system over [0, t1] fromx0and returns the clock-weighted average.static CacheSojourn.ClockholdingClock(Matrix D0in, Matrix D1in, double lam) The holding-time clock of a random-environment stage whose holding time is the MAP {D0,D1}, in a drift time unit that islamtimes real time:A = D0/lam,c = -D0 1/lam,phi0 = map_pie, so thatint_0^T g = F(T/lam)with F the holding-time CDF.static double[]Per-user miss rateMU(v) = sum_i lambda_v(i) pi0(i)of a per-item out-of-cache probabilitypi0, the same functional as the transientMU_t, which is affine in the occupancy.
-
Method Details
-
holdingClock
The holding-time clock of a random-environment stage whose holding time is the MAP {D0,D1}, in a drift time unit that islamtimes real time:A = D0/lam,c = -D0 1/lam,phi0 = map_pie, so thatint_0^T g = F(T/lam)with F the holding-time CDF. -
average
public static CacheSojourn.Result average(CacheSojourn.Drift f, double[] x0, double t1, CacheSojourn.Clock clk) Integrates the augmented system over [0, t1] fromx0and returns the clock-weighted average. -
missRate
Per-user miss rateMU(v) = sum_i lambda_v(i) pi0(i)of a per-item out-of-cache probabilitypi0, the same functional as the transientMU_t, which is affine in the occupancy.
-