Class Matching

All Implemented Interfaces:
Serializable, Cloneable, Copyable

public class Matching extends Queue implements Serializable
A stochastic matching node with first-come-first-matched (FCFM) policy.

Jobs of different open classes are paired off. The node carries an undirected compatibility graph G between classes, set with setCompatibility(jline.lang.JobClass, jline.lang.JobClass). On a class-r arrival:

  • if jobs of some class s with G(r,s) = 1 are waiting, the OLDEST of them is matched with the arrival and both leave the node at once, each following the routing of its own class (usually to a Sink);
  • otherwise the arrival joins the ordered buffer, or is dropped when the buffer already holds the capacity set with Station.setCap(int).
The waiting jobs therefore always form an independent set of G. A waiting job may renege after a per-class patience time, set with Station.setPatience(JobClass, Distribution) (ImpatienceType.RENEGING only).

This is the non-bipartite FCFM matching model of Comte (2022). Without patience it has the order-independent product form solved exactly by SolverNC (Qsys_match_fcfm). SolverCTMC and SolverSSA solve it with or without patience (any phase-type law), on the ordered word of waiting (class, patience phase) pairs; both require a finite capacity. A Matching node has no service time: per-class setService is refused.

Average measures reported for the node: QLen is the mean number of waiting class-r jobs, RespT is QLen over the accepted class-r arrival rate (0 for a job matched on arrival), Tput is the rate at which class-r jobs leave matched, and Util is 0 (no server).

Reference: Comte (2022). Stochastic non-bipartite matching models and order-independent loss queues. Stochastic Models 38(1):1-36.

See Also:
  • Constructor Details

  • Method Details

    • setCompatibility

      public void setCompatibility(JobClass a, JobClass b)
      Makes the two classes compatible (an undirected edge of the graph).
    • setCompatibility

      public void setCompatibility(JobClass a, JobClass b, boolean value)
      Adds (value true) or removes (value false) the undirected edge between the two classes.
    • setCompatibility

      public void setCompatibility(Matrix G)
      Sets the whole graph from an R x R symmetric 0/1 matrix with a zero diagonal, R the number of classes of the model, in class index order.
    • getCompatibility

      public Matrix getCompatibility()
      The compatibility graph as an R x R 0/1 matrix, R the classes of the model.
    • getCompatibility

      public Matrix getCompatibility(int R)
      The compatibility graph as an R x R 0/1 matrix.
    • setService

      public void setService(JobClass jobClass, Distribution distribution)
      Overrides:
      setService in class ServiceStation
    • setService

      public void setService(JobClass jobClass, Distribution distribution, double weight)
      Overrides:
      setService in class ServiceStation
    • setService

      public void setService(JobClass jobClass, Object distribution, double weight)
      Overrides:
      setService in class ServiceStation
    • setService

      public void setService(JobClass jobClass, ServerType serverType, Distribution distribution)
      Description copied from class: Queue
      Sets the service time distribution for a specific job class and server type.

      Used for heterogeneous multiserver queues where different server types may have different service rates for the same job class.

      Overrides:
      setService in class Queue
      distribution - the service time distribution
    • setService

      public void setService(SerializableFunction<Matrix,Double> muFun)
      Description copied from class: Queue
      Sets the total service rate function mu(c) of a pass-and-swap (PAS) queue. An order-independent/PAS queue is parameterized by mu(c) as a whole, not by per-class service distributions; this overload of setService accepts the mu(c) function directly.
      Overrides:
      setService in class Queue
      Parameters:
      muFun - maps the ordered state vector c (1xN row Matrix of 0-based class indices, c(0) oldest) to the scalar total service rate
    • setRepresentativeService

      public void setRepresentativeService(JobClass jobClass, Distribution distribution)
      Installs the representative per-class rate Exp(lambda(N(r))) (or Disabled) that Network.sanitize gives each class slot, so that the rate and process tables stay consistent. Not a service time: no solver reads it as one.