Class Pfqn_explicit

java.lang.Object
jline.api.pfqn.nc.Pfqn_explicit

public final class Pfqn_explicit extends Object
  • Method Details

    • pfqn_explicit

      public static Pfqn_explicit.Result pfqn_explicit(Matrix L, Matrix N, double tol, String method, double maxloss)
      Explicit closed-form normalizing constant of a multiclass closed network.

      Evaluates the two explicit expressions of Casale (SIGMETRICS 2017), Eqs. (15) and (16). Both instantiate the divided-difference form of Corollary 3.2,

         G(N) = sum_{0<=t<=N} (-1)^(|N|-|t|)/(N_1!...N_R!) prod_r C(N_r,t_r) g_t(|N|)
       
      by substituting a closed form for the single-class constant g_t(|N|) at the induced demands theta_k(t) = sum_r t_r L(k,r). Eq. (15) is Gordon's partial fraction and needs the induced demands PAIRWISE DISTINCT; Eq. (16) is the general partial-fraction expansion over the distinct values and their multiplicities, and reduces term by term to Eq. (15) when every multiplicity is one. The choice is automatic: Eq. (16) is used as soon as two induced demands are closer than tol relative to the largest one.

      SINGLE CLASS. At R=1 the multiclass constant IS the single-class constant at demands L, so the outer sum is skipped: g_t(N) = t^N g_1(N) and sum_t (-1)^(N-t) t^N/(t!(N-t)!) = S(N,N) = 1. Running the difference anyway would add N alternating terms, and their cancellation, to a closed form that carries none of them. What is left is O(K^2) work at any population.

      Only single-server load-independent queues are admissible: infinite servers need the integral form of Corollary 3.4 and load-dependent rates need Pfqn_explicit_ld, which keeps this closed form as its inner kernel.

      NUMERICS. Both expressions alternate in sign with terms far larger than the result, so they are evaluated as signed log-sum-exps: this removes the floating-point RANGE problem but not the cancellation, which is what makes multiprecision arithmetic necessary on all but small models.

      Parameters:
      L - service demand matrix (K x R) of single-server load-independent queues
      N - population vector (1 x R)
      tol - relative tolerance declaring two induced demands redundant
      method - "auto", "distinct" (force Eq. 15) or "repeated" (force Eq. 16)
      maxloss - cancellation budget in decimal digits; a finite value turns the warnings into a silent REFUSAL (lG = NaN) once the budget is exceeded, for callers that hold a fallback; Double.POSITIVE_INFINITY keeps the warnings
      Returns:
      the constant, its logarithm, the expression used and the digits lost
    • pfqn_explicit

      public static Pfqn_explicit.Result pfqn_explicit(Matrix L, Matrix N)
      Overload with the documented defaults: machine precision, 'auto', no budget.
    • induced

      public static double[] induced(Matrix L, int[] t, int K, int R)
      Induced demands theta_k(t) = sum_r t_r L(k,r). Shared with Pfqn_explicit_ld.
    • redundantAt

      public static boolean redundantAt(double[] th, double tol)
      Whether two of the induced demands agree to within tol, relatively to the largest. A scale of zero leaves every induced demand at zero, so g_t(|N|) = 0 at sum(N) > 0 and the term takes no part in the sum.
    • nextLattice

      public static boolean nextLattice(int[] t, int[] N)
      Next vector of the lattice 0 <= t <= N; false once it is exhausted. Shared with Pfqn_explicit_ld.
    • gdistinct

      public static Pfqn_explicit.SignedLse gdistinct(double[] th, double Nt, int K)
      Eq. (14): single-class constant at pairwise distinct demands th, population Nt over K queues. A zero demand contributes nothing, which also realizes the 0/0 = 0 convention of Eq. (15) when the zero is repeated.
    • grepeated

      public static Pfqn_explicit.SignedLse grepeated(double[] th, double Nt, int K, double tol)
      Eq. (16): single-class constant at demands th of arbitrary multiplicity, population Nt over K queues. Demands within tol of each other, relatively to the largest one, are merged into one distinct value carrying their count.
    • signedLogSumExp

      public static Pfqn_explicit.SignedLse signedLogSumExp(double[] lterm, double[] sterm)
      Signed log-sum-exp of S = sum_i s_i exp(l_i). Returns log|S|, sign(S) and the decimal digits lost to cancellation.
    • factln

      public static double factln(double n)
    • toArray

      public static double[] toArray(List<Double> v)