Class CacheSojourn

java.lang.Object
jline.api.cache.CacheSojourn

public final class CacheSojourn extends Object
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 Classes
    Modifier and Type
    Class
    Description
    static final class 
    A phase-type clock: dphi/dt = phi A, phi(0) = phi0, density phi c.
    static interface 
    The drift of the cache mean field.
    static final class 
    A sojourn average: occupancy xbar (null when wtot is 0), clock mass, per-user miss rate.
  • Method Summary

    Modifier and Type
    Method
    Description
    average(CacheSojourn.Drift f, double[] x0, double t1, CacheSojourn.Clock clk)
    Integrates the augmented system over [0, t1] from x0 and returns the clock-weighted average.
    holdingClock(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 is lam times real time: A = D0/lam, c = -D0 1/lam, phi0 = map_pie, so that int_0^T g = F(T/lam) with F the holding-time CDF.
    static double[]
    missRate(Matrix[] lambdaCache, double[] pi0)
    Per-user miss rate MU(v) = sum_i lambda_v(i) pi0(i) of a per-item out-of-cache probability pi0, the same functional as the transient MU_t, which is affine in the occupancy.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • holdingClock

      public static CacheSojourn.Clock holdingClock(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 is lam times real time: A = D0/lam, c = -D0 1/lam, phi0 = map_pie, so that int_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] from x0 and returns the clock-weighted average.
    • missRate

      public static double[] missRate(Matrix[] lambdaCache, double[] pi0)
      Per-user miss rate MU(v) = sum_i lambda_v(i) pi0(i) of a per-item out-of-cache probability pi0, the same functional as the transient MU_t, which is affine in the occupancy.