Class SamplePathRecorder

java.lang.Object
jline.solvers.ldes.handlers.SamplePathRecorder

public final class SamplePathRecorder extends Object
Row store of an LDES sample path.

Row k follows the SolverSSA convention: t[k] is the epoch of the events tagged with step k, and the state rows of step k are the state OCCUPIED UNTIL t[k] (the left limit), so sum_k state[k] * (t[k] - t[k-1]), with t[-1] = 0, is the time integral of the state over [0, t[last]].

Detailed rows are variable-width (a FCFS buffer grows and shrinks); they are left-padded with zeros to the widest row of their node on export, which is where SolverSSA pads too and what State.toMarginal expects of a right-aligned FCFS buffer.

  • Constructor Summary

    Constructors
    Constructor
    Description
    SamplePathRecorder(int limit, int[] statefulNodes, int numClasses, String[] detailRefusal)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRow(double time, double[][] state, double[][] aggr, List<double[]> evs)
    Appends one row.
    aggr(int isf)
    Per-class job counts of stateful node isf, one row per step.
    void
    Counts a service or interarrival phase script that could not be bound to a job.
    detailRefusal(int isf)
    Null when node isf carries detailed rows, else the reason it does not.
    Events, one per row: [step, t, type, node, class, jobId, phase].
    boolean
    True once limit rows have been recorded.
    int
    Index the next row will get.
    int
    Number of stateful nodes.
    int
    Rows recorded so far.
    state(int isf)
    Detailed rows of stateful node isf, left-padded with zeros; null if refused.
    int
    statefulNode(int isf)
    Node index (0-based) of stateful node isf.
    Row epochs as a column vector.
    int
     

    Methods inherited from class java.lang.Object

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

    • SamplePathRecorder

      public SamplePathRecorder(int limit, int[] statefulNodes, int numClasses, String[] detailRefusal)
      Parameters:
      limit - rows to record (N of --sample-path N)
      statefulNodes - node index of each stateful node, in stateful order
      numClasses - number of job classes
      detailRefusal - per stateful node, null or the reason detailed rows are refused
  • Method Details

    • isFull

      public boolean isFull()
      True once limit rows have been recorded.
    • size

      public int size()
      Rows recorded so far.
    • nextStep

      public int nextStep()
      Index the next row will get.
    • numStateful

      public int numStateful()
      Number of stateful nodes.
    • detailRefusal

      public String detailRefusal(int isf)
      Null when node isf carries detailed rows, else the reason it does not.
    • addRow

      public void addRow(double time, double[][] state, double[][] aggr, List<double[]> evs)
      Appends one row.
      Parameters:
      time - epoch of the row
      state - per stateful node, its detailed row (ignored where refused)
      aggr - per stateful node, its per-class job counts
      evs - events of this step, each [type, node, class, jobId, phase]
    • countUnboundScript

      public void countUnboundScript()
      Counts a service or interarrival phase script that could not be bound to a job.
    • unboundScripts

      public int unboundScripts()
    • times

      public Matrix times()
      Row epochs as a column vector.
    • events

      public Matrix events()
      Events, one per row: [step, t, type, node, class, jobId, phase].
    • state

      public Matrix state(int isf)
      Detailed rows of stateful node isf, left-padded with zeros; null if refused.
    • aggr

      public Matrix aggr(int isf)
      Per-class job counts of stateful node isf, one row per step.
    • statefulNode

      public int statefulNode(int isf)
      Node index (0-based) of stateful node isf.