Package jline.api.sn

Class SnJoinSiblings

java.lang.Object
jline.api.sn.SnJoinSiblings

public final class SnJoinSiblings extends Object
Number of sibling tasks forked per parent job on a fork-join pair.

Port of matlab/src/api/fj/sn_join_siblings.m.

  • Method Details

    • snJoinSiblings

      public static int snJoinSiblings(NetworkStruct sn, Node joinNode)
      Class-blind form: the widest fork over the classes.
    • snJoinSiblings

      public static int snJoinSiblings(NetworkStruct sn, Node joinNode, int r)
      Siblings are counted at the FORK, as the simulation engines count them.

      THE COUNT IS PER LINK, not the out-degree times a node-wide scalar. A fork carries a VARIABLE FORKING LEVEL: setTasksPerLink(class, n [, dest]) sets one link of one class, setTasksPerLinkDistribution makes the degree a draw, and setBranchProb makes a link taken with probability below one. All three land in ForkNodeParam.fanOutLink and .fanOutProb, both (nnodes x nclasses) and indexed by DESTINATION NODE, with the DISTRIBUTION case storing its mean, so

          N = sum_d fanOutProb(d,r) * fanOutLink(d,r)

      which is the EXPECTED sibling count and reduces to out-degree times the node-wide fanOut on a model that sets none of the three. Falls back to that older product when fanOutLink is absent, and to the Join's in-degree when the matched fork cannot be identified.

      The result is what a quorum is measured against: the join fires on the k-th of N siblings and the remaining N-k are discarded when they arrive.

      Parameters:
      sn - the network structure
      joinNode - the Join node
      r - the class index, or -1 for the widest fork over the classes
      Returns:
      the number of siblings forked per parent job, 0 when it cannot be determined