Class BasBlock

java.lang.Object
jline.lang.state.BasBlock

public final class BasBlock extends Object
The true-BAS held-job block of a blocking station's local state (BUG-110).

A station that blocks after service holds a completed job at its server until the job's destination has room. The trailing block of the local row (nvars column 2R) holds one counter per TARGET CODE code(r, jst, s) = 1 + r + R*(s + R*jst) (0-based r, jst, s): how many completed class-r jobs the station holds for station jst, where they will enter as class s. A multi-server station (a Delay, a multiserver queue) can hold several jobs at once, one per server that completed towards a full destination, each released only into its own target and as its own class.

Before BUG-110 a single {0,1} column recorded only THAT a job was held: the second completion towards a full destination was re-served instead of held, a held job was released into whichever destination freed first and as any class, and the chain split into many closed communicating classes.

Same encoding and rules as Python native ctmc_ssg.bas_*. The code set is derived from sn alone (see codes(NetworkStruct, int)).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A become-blocked arc: the rate factor and the local row after the job is held.
    static final class 
    A departure arc: the rate factor, the held block after it (null = unchanged), and whether it is the transfer of a held job.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    LINE's immediate rate, used for every vanishing move, here a held job's transfer.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    anyHeld(int[] h)
     
    static Matrix
    appendHeld(NetworkStruct sn, int ind, Matrix space)
    Appends the held block to every row of a station's local space: each row is widened by ncols zero columns and repeated once per admissible held vector (per class at most its jobs in service across its codes, a single-server station at most one job in total).
    blockArc(NetworkStruct sn, int indA, int[] codes, Matrix row, int classA, int nodeP, int classP)
    Become-blocked arc for a completion of class_a refused by class_p at node_p, or null: the factor free/in-service of class_a and the row with one more job held for that target.
    static int
    code(NetworkStruct sn, int r, int jst, int s)
     
    static int[]
    codes(NetworkStruct sn, int ind)
    Sorted target codes of the true-BAS blocking station at node ind, read from sn.
    static int[]
    codes(NetworkStruct sn, int ind, Matrix isbasblocking, Matrix isbasdestination)
    Sorted target codes of node ind: one per (held class r, destination station jst, arriving class s) such that the routing sends class r at ind to class s at jst with positive probability and jst is a BAS destination for class s.
    static int[]
    decode(NetworkStruct sn, int code)
    Inverse of code(jline.lang.NetworkStruct, int, int, int): {r, jst, s}, all 0-based.
    depArcs(NetworkStruct sn, int indA, int[] codes, Matrix row, int classA, int nodeP, int classP)
    The departure arcs of class_a at blocking station ind_a towards class_p at node_p, from the pre-event local row.
    static int[]
    held(int[] codes, Matrix row)
    Held counts per code, read from the trailing block of a local row.
    static int
    indexOf(int[] codes, int code)
     
    static boolean
    isBlocking(NetworkStruct sn, int ind)
    True when node ind is a true-BAS blocking station of sn.
    static int
    ncols(int[] codes)
    Width of the block: one counter per code, at least one column.
    static boolean
    True when station ist serves one job at a time (not INF, at most one server).
    static Matrix
    withHeld(Matrix row, int[] codes, int[] h)
    Copy of a local row (1 x w) with its trailing block set to h.

    Methods inherited from class java.lang.Object

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

    • TRANSFER_RATE

      public static final double TRANSFER_RATE
      LINE's immediate rate, used for every vanishing move, here a held job's transfer.
      See Also:
  • Method Details

    • code

      public static int code(NetworkStruct sn, int r, int jst, int s)
    • decode

      public static int[] decode(NetworkStruct sn, int code)
      Inverse of code(jline.lang.NetworkStruct, int, int, int): {r, jst, s}, all 0-based.
    • isBlocking

      public static boolean isBlocking(NetworkStruct sn, int ind)
      True when node ind is a true-BAS blocking station of sn.
    • codes

      public static int[] codes(NetworkStruct sn, int ind)
      Sorted target codes of the true-BAS blocking station at node ind, read from sn.
      See Also:
    • codes

      public static int[] codes(NetworkStruct sn, int ind, Matrix isbasblocking, Matrix isbasdestination)
      Sorted target codes of node ind: one per (held class r, destination station jst, arriving class s) such that the routing sends class r at ind to class s at jst with positive probability and jst is a BAS destination for class s. A destination that can hold the whole closed population never refuses and is left out.

      The destination mask is sn.isbasdestination, the union over blocking stations, rather than a per-station mask, because a per-station declaration does not survive into sn (sn.droprule is normalized at infinite-capacity stations). Where several blocking stations declare differently this can list a code a per-station mask would not; such a counter is simply never incremented.

      Parameters:
      isbasblocking - (nnodes x 1) blocking flags
      isbasdestination - (nstations x nclasses) destination mask
    • ncols

      public static int ncols(int[] codes)
      Width of the block: one counter per code, at least one column.
    • indexOf

      public static int indexOf(int[] codes, int code)
    • singleServer

      public static boolean singleServer(NetworkStruct sn, int ist)
      True when station ist serves one job at a time (not INF, at most one server).
    • held

      public static int[] held(int[] codes, Matrix row)
      Held counts per code, read from the trailing block of a local row.
    • anyHeld

      public static boolean anyHeld(int[] h)
    • withHeld

      public static Matrix withHeld(Matrix row, int[] codes, int[] h)
      Copy of a local row (1 x w) with its trailing block set to h.
    • depArcs

      public static List<BasBlock.DepArc> depArcs(NetworkStruct sn, int indA, int[] codes, Matrix row, int classA, int nodeP, int classP)
      The departure arcs of class_a at blocking station ind_a towards class_p at node_p, from the pre-event local row. With nothing held: one ordinary arc. Otherwise the transfer of a held job for exactly this target (rate TRANSFER_RATE, no routing probability, block minus one) and, unless the station is single-server, the completion of a job still in service at factor free/in-service of its class.
    • blockArc

      public static BasBlock.BlockArc blockArc(NetworkStruct sn, int indA, int[] codes, Matrix row, int classA, int nodeP, int classP)
      Become-blocked arc for a completion of class_a refused by class_p at node_p, or null: the factor free/in-service of class_a and the row with one more job held for that target. A single-server station already holding a job has no server left.
    • appendHeld

      public static Matrix appendHeld(NetworkStruct sn, int ind, Matrix space)
      Appends the held block to every row of a station's local space: each row is widened by ncols zero columns and repeated once per admissible held vector (per class at most its jobs in service across its codes, a single-server station at most one job in total). Called while nvars(ind, 2R) already holds the width.