Class SolverQNS

Direct Known Subclasses:
QNS

public class SolverQNS extends NetworkSolver
SolverQNS class implements a queueing network solver that wraps the external qnsolver tool. This solver provides various multiserver approximation methods for analyzing queueing networks.
  • Constructor Details

    • SolverQNS

      public SolverQNS(Network model)
      Default constructor with network model
    • SolverQNS

      public SolverQNS(Network model, String method)
      Constructor with network model and method string
    • SolverQNS

      public SolverQNS(Network model, SolverOptions options)
      Constructor with network model and solver options
    • SolverQNS

      public SolverQNS(Network model, Object... varargin)
      Constructor with network model and variable arguments
  • Method Details

    • parseOptions

      public static SolverOptions parseOptions(Object... varargin)
      Parse options from variable arguments
    • defaultOptions

      public static SolverOptions defaultOptions()
      Get the default options for the QNS solver
    • getFeatureSet

      public static FeatureSet getFeatureSet()
      Get the feature set supported by this solver
    • supports

      public boolean supports(Network model)
      Check if the solver supports the given model
      Overrides:
      supports in class Solver
      Parameters:
      model - the network model to check
      Returns:
      true if the model is supported, false otherwise
    • supportsModelMethod

      public String supportsModelMethod(String method)
      Structural finite-capacity gate.

      NOTHING under the QNS tree reads sn.cap or sn.classcap -- the model is written out for qnsolver, whose MVA-family algorithms have no representation of a finite buffer -- so a capped station was solved as an unbounded one and the table reported the unconstrained answer under this solver's name. There is no registry feature name for plain capacity, hence the structural test; SolverMVA, SolverNC, SolverAG and SolverFluid gate the same way through the same helper.

      Without it SolverAUTO.listValidMethods offered all eight "qns" method names on the BAS-blocking model of cqn_bas_blocking.

      Overrides:
      supportsModelMethod in class Solver
      Parameters:
      method - the concrete method name
      Returns:
      empty string if supported, else the offending reason
    • qnsImmfeedRefusal

      public static String qnsImmfeedRefusal(NetworkStruct sn)
      Why SolverQNS cannot serve a model with immediate feedback, or "" when the model has none.

      Immediate feedback (sn.immfeed) keeps a self-looping job on its server instead of re-queueing it, and neither path of SolverQNS can state that: the JMVA document qnsolver reads carries a mean demand and a visit count per chain, and the LQN QN2LQN writes turns the routing into OR-fork precedences of pseudo-activities on the reference task, where a repeated visit is a new call. Either would answer for re-queueing under this solver's name.

      ONE PREDICATE, TWO CALLERS: supportsModelMethod(java.lang.String) (the gate, hence model.help and SolverAUTO) and runAnalyzer() (the run, for a caller with enableChecks off). SolverJMT keeps its own wording in jmtMethodRefusal. Mirrors matlab/src/solvers/wrappers/QNS/qns_immfeed_refusal.m.

      Parameters:
      sn - the network struct
      Returns:
      the refusal, or "" when the model carries no immediate feedback
    • qnsMultiserverRefusal

      public static String qnsMultiserverRefusal(NetworkStruct sn, String method)
      Whether qnsolver's own -m switch offers this multiserver approximation.

      THE RULE IS INSIDE THE MULTISERVER BRANCH, and that is not a detail. Without a multiserver station the reference emits no -m at all and answers under the caller's method name, so refusing "suri" there would refuse a model this solver does solve.

      "qnsolver -m" accepts conway, reiser, rolia and zhou. "suri" and "schmidt" are LQNS approximations, reachable only on the non-product-form closed SolverLQNS branch, and qnsolver has no flag for either. Mirrors matlab/src/solvers/wrappers/QNS/qns_multiserver_refusal.m and the C++ is_qnsolver_multiserver.

      Parameters:
      sn - the network struct
      method - the requested method name
      Returns:
      the refusal, or "" when the pair is served
    • listValidMethods

      public String[] listValidMethods()
      List valid methods for this solver
    • runAnalyzer

      Run the analyzer for the QNS solver
      Specified by:
      runAnalyzer in class Solver
      Throws:
      IllegalAccessException - if access to required resources is denied
      ParserConfigurationException - if XML parsing configuration fails
      IOException - if I/O operations fail
    • isAvailable

      public static boolean isAvailable()
      Check if the solver is available: a native qnsolver binary is on the PATH. qnsolver ships with LQNS, whose licence forbids redistribution, so LINE never runs it from a container image; use run-tests.sh --lqns-docker to test a containerised build.
    • getProbNormConstAggr

      public Ret.ProbabilityResult getProbNormConstAggr()
      Description copied from class: NetworkSolver
      Returns the logarithm of the normalizing constant of state probabilities. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProbNormConstAggr in class NetworkSolver
      Returns:
      result containing the log normalizing constant
    • getProb

      public Ret.ProbabilityResult getProb(int node, Matrix state)
      Description copied from class: NetworkSolver
      Returns marginal state probabilities for a specific node and state. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProb in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      state - the state vector to query (optional, null for all states)
      Returns:
      result containing marginal state probabilities
    • getProb

      public Ret.ProbabilityResult getProb(int node)
      Description copied from class: NetworkSolver
      Returns marginal state probabilities for a specific node (all states). This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProb in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      Returns:
      result containing marginal state probabilities
    • getProbSys

      public Ret.ProbabilityResult getProbSys()
      Description copied from class: NetworkSolver
      Returns joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProbSys in class NetworkSolver
      Returns:
      result containing joint state probabilities
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(int node, Matrix state_a)
      Description copied from class: NetworkSolver
      Probability of a SPECIFIC per-class job distribution at a station. Returns P(n1 jobs of class 1, n2 jobs of class 2, ...) for given state.

      Compare with NetworkSolver.getProbMarg(int, int, jline.util.matrix.Matrix): returns queue-length distribution for a single class, i.e., P(n jobs of class r) for n=0,1,...,N(r).

      Overrides:
      getProbAggr in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      state_a - per-class job counts, e.g., [2,1] = 2 class-1, 1 class-2
      Returns:
      scalar probability in [0,1]
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(int node)
      Description copied from class: NetworkSolver
      Probability of a SPECIFIC per-class job distribution at a station (current state). Returns P(n1 jobs of class 1, n2 jobs of class 2, ...).

      Compare with NetworkSolver.getProbMarg(int, int, jline.util.matrix.Matrix): returns queue-length distribution for a single class, i.e., P(n jobs of class r) for n=0,1,...,N(r).

      Overrides:
      getProbAggr in class NetworkSolver
      Parameters:
      node - the node index for which to compute probabilities
      Returns:
      scalar probability in [0,1]
    • getProbSysAggr

      public Ret.ProbabilityResult getProbSysAggr()
      Description copied from class: NetworkSolver
      Returns aggregated joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      getProbSysAggr in class NetworkSolver
      Returns:
      result containing aggregated joint state probabilities
    • sample

      public Ret.SampleResult sample(int node, int numEvents)
      Description copied from class: NetworkSolver
      Samples state trajectories for a specific node. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sample in class NetworkSolver
      Parameters:
      node - the node index to sample from
      numEvents - the number of events to sample
      Returns:
      result containing sampled state trajectories
    • sampleAggr

      public Ret.SampleResult sampleAggr(int node, int numEvents)
      Description copied from class: NetworkSolver
      Samples aggregated state trajectories for a specific node. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sampleAggr in class NetworkSolver
      Parameters:
      node - the node index to sample from
      numEvents - the number of events to sample
      Returns:
      result containing sampled aggregated state trajectories
    • sampleSys

      public Ret.SampleResult sampleSys(int numEvents)
      Description copied from class: NetworkSolver
      Samples joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sampleSys in class NetworkSolver
      Parameters:
      numEvents - the number of events to sample
      Returns:
      result containing sampled joint system state trajectories
    • sampleSysAggr

      public Ret.SampleResult sampleSysAggr(int numEvents)
      Description copied from class: NetworkSolver
      Samples aggregated joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.
      Overrides:
      sampleSysAggr in class NetworkSolver
      Parameters:
      numEvents - the number of events to sample
      Returns:
      result containing sampled aggregated joint system state trajectories