Class PetriClosures

java.lang.Object
jline.solvers.fluid.petri.PetriClosures

public final class PetriClosures extends Object
The min-normal moment closures a Petri-net transition mode needs. Java twin of the MATLAB fluid_min_closure and fluid_minmulti_closure.

A queueing station needs the TWO-argument min(n,c). A transition mode needs the many-argument one: its enabling degree is

    e(m) = min_a ( m_a / w_a )
over every input arc a, and the rate law then caps that at the mode's server count. There is no closed form for the expectation of a min of more than two correlated normals, so this uses the recursion of Clark (1961): the running min is replaced at each step by the normal with its exact first two moments, and the next argument is folded in with the exact bivariate formulas. The deterministic cap is folded in last, by the two-argument closure itself, so a single-arc mode reduces EXACTLY to the closure the queueing methods already use and no second code path exists for it.

THE RECURSION IS ORDER DEPENDENT, as Clark's approximation always is: only the first two moments of the running min are kept, so folding the arcs in a different order gives a slightly different answer. The order here is the caller's, i.e. increasing state coordinate, which the layout fixes and which therefore reproduces across the four codebases.

Reference: C. E. Clark, "The greatest of a finite set of random variables", Operations Research 9(2):145-162, 1961.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    The result of the many-argument closure.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    The band inside which two arguments are treated as equal at zero variance.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double[]
    minClosure(double n, double c, double s2, double vc, double cov)
    E[min(X,Y)] and dE/dE[X] for jointly normal X, Y.
    minMultiClosure(double[] mu, Matrix S, double c)
    Min-normal closure of E[min(X_1,...,X_A,c)] by Clark's recursion.
    static double
    normCdf(double z)
    The standard normal CDF, without a statistics dependency.
    static double
    normPdf(double z)
    The standard normal density.

    Methods inherited from class java.lang.Object

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

    • FINE_TOL

      public static final double FINE_TOL
      The band inside which two arguments are treated as equal at zero variance.
      See Also:
  • Method Details

    • minClosure

      public static double[] minClosure(double n, double c, double s2, double vc, double cov)
      E[min(X,Y)] and dE/dE[X] for jointly normal X, Y.
    • minMultiClosure

      public static PetriClosures.MinMulti minMultiClosure(double[] mu, Matrix S, double c)
      Min-normal closure of E[min(X_1,...,X_A,c)] by Clark's recursion.
      Parameters:
      mu - means of the arguments, already scaled by the arc weights
      S - covariance of the arguments, symmetric positive semi-definite
      c - deterministic cap (the mode's server count); infinite for none
    • normCdf

      public static double normCdf(double z)
      The standard normal CDF, without a statistics dependency.
    • normPdf

      public static double normPdf(double z)
      The standard normal density.