Package jline.api.lqn

Class LqnPh

java.lang.Object
jline.api.lqn.LqnPh

public class LqnPh extends Object
Phase-type composition of an LQN activity graph, the machinery behind SolverLN method 'srvn.ph'.

An entry becomes a Workflow whose leaves are its activities and, when requested, its synchronous calls; the series-parallel reduction of that workflow is then the exact law of the entry service time. Mirrors the MATLAB lqn_entry_workflow, lqn_ph_serial_law and lqn_ph_moments.

  • Method Details

    • entryWorkflow

      public static LqnPh.EntryWorkflow entryWorkflow(LayeredNetwork model, LayeredNetworkStruct lqn, int eidx, boolean withCalls)
      Activity graph of LQN entry EIDX as a workflow.

      The activity precedences are read from the task object rather than reconstructed from lqn.graph, whose loop back-edges carry probabilities and not counts.

      Parameters:
      model - the layered network the struct was obtained from
      lqn - the layered network struct
      eidx - absolute index of the entry
      withCalls - true to expand every synchronous call into a leaf of its own, placed in series after its activity; false to keep only the host demands, which is the processor-demand law
      Returns:
      the workflow and its execution counts
    • serialLaw

      public static Pair<Matrix,Matrix> serialLaw(Workflow wf)
      Composed law of a workflow in which the branches of an AND fork are SERIAL rather than concurrent, that is, the total work the branches request rather than the elapsed time until the last of them finishes.

      This is the law of the PROCESSOR demand of an LQN entry. Two branches of an AND fork are two activity threads of the same task instance: they overlap in time, so the entry response time is the maximum of the branches, but they run on ONE processor, so the demand they place on it is the sum. Composing the host law with Workflow.toPH would charge the processor the maximum and let the layer report a utilization below the true one, which no amount of iterating recovers.

      Parameters:
      wf - the workflow
      Returns:
      the initial vector and subgenerator of the composed law
    • moments

      public static double[] moments(Matrix alpha, Matrix T)
      First two moments of a phase-type law without building a Distribution object, which is what the layered fixed point needs at every iteration for every composed entry law. A defective ALPHA carries an atom at zero and contributes nothing to either moment.
      Parameters:
      alpha - initial vector
      T - subgenerator
      Returns:
      {mean, squared coefficient of variation}