Class ReplyBlock

java.lang.Object
jline.lang.state.ReplyBlock
All Implemented Interfaces:
Serializable

public class ReplyBlock extends Object implements Serializable
Layout of, and accessors for, the synchronous-call (REPLY signal) blocked-server block that a node carries in its local-variable state.

A job of a class r with sn.syncreply(r) >= 0 makes a synchronous call: it leaves the station for the callee but KEEPS its server, which stays held until the matching REPLY signal class comes back. The held servers are not derivable from the marginal state (the job is at the callee, not here), so they are counted per calling class in this block. LDES keys the same information by job id (Solver_ssj.pendingReplyMap); a CTMC has no job identity, so it carries counts.

The block trails the modulation, routing and node blocks of sn.nvars (columns 0..R-1, R..2R-1 and 2R), occupying columns 2R+1+r. Appending keeps every existing nvars reader valid, and the columns stay zero-width for models without reply signals, so no other model changes state width.

Port of MATLAB State.replyBlockInfo and State.replyBlocked.

See Also:
  • Method Details

    • info

      public static ReplyBlock.Info info(NetworkStruct sn, int ind)
      Layout of the reply block that node ind carries.
      Parameters:
      sn - network structure
      ind - node index
      Returns:
      the block layout; width 0 when the node holds no synchronous call
    • holds

      public static boolean holds(NetworkStruct sn, int ind)
      True iff node ind holds servers for any synchronous call.
      Parameters:
      sn - network structure
      ind - node index
      Returns:
      true when the node carries a reply block
    • blocked

      public static Matrix blocked(NetworkStruct sn, int ind, Matrix spaceVar)
      Per-class counts of servers held at node ind by jobs that made a synchronous call and are waiting for their REPLY signal.
      Parameters:
      sn - network structure
      ind - node index
      spaceVar - local-variable part of the state, one row per state
      Returns:
      (rows x nclasses) counts; all zero when the node carries no block
    • blockedTotal

      public static Matrix blockedTotal(NetworkStruct sn, int ind, Matrix spaceVar)
      Total number of servers held for pending replies, one entry per row of spaceVar. Zero when the node carries no synchronous-call block, so callers can subtract it from the server count unconditionally.
      Parameters:
      sn - network structure
      ind - node index
      spaceVar - local-variable part of the state, one row per state
      Returns:
      (rows x 1) totals