QNS (LQNS's qnsolver)
Methods · Configuration · Shared options · All solvers
The QNS wrapper exposes the corresponding tool for product-form queueing network analysis in the Layered Queueing Network Solver developed by the RADS group at Carleton University. Unlike the LQNS solver, QNS models are ordinary (non-layered) queueing networks.
Methods
The method names and defaults below describe the MATLAB interface. Aliases share a row; model-specific restrictions and backend differences are noted. Use solver.listValidMethods() to inspect the names available for your model.
The method names select the multiserver approximation qnsolver -m (or, on a closed non-product-form model, lqns through QN2LQN) will use.
| Method | Algorithm and applicability |
|---|---|
default | Let the tool choose (Rolia in practice). |
conway | Conway's multiserver approximation. |
rolia | Rolia's multiserver approximation. |
zhou | Zhou's multiserver approximation. |
suri | Suri's multiserver approximation; refused where a multi-server station is present, since qnsolver -m does not know it. |
reiser | Reiser's multiserver approximation. |
schmidt | Schmidt's multiserver approximation; same restriction as suri. |
Configuration options
The solver-specific fields below belong to options.config. Set them on an options struct, for example opt.config.name = value, and pass that struct to the solver constructor. See shared solver options for all top-level fields, shared configuration, defaults and usage. Options apply only to the methods and model features that consume them.
Relevant top-level options: keep, timeout.
QNS requires the local qnsolver binary (and lqns for the closed non-product-form fallback). Its named methods choose the multiserver approximation. container is ignored by qnsolver.
| Option | Default | Description and values |
|---|---|---|
multiserver | 'default' | Derived from method by SolverQNS, overriding a supplied configuration value; default resolves to rolia. Passed as qnsolver -m when multiserver stations are present, or as lqns -Pmultiserver= on the closed non-product-form fallback. Select the approximation through the method names above. |
Example
This example demonstrates the QNS solver on a simple tandem queueing network. QNS provides product-form analysis methods for ordinary (non-layered) queueing networks.
% Create an open queueing network (tandem queues)
model = Network('QNS Example');
source = Source(model, 'Source');
queue1 = Queue(model, 'Queue1', SchedStrategy.FCFS);
queue2 = Queue(model, 'Queue2', SchedStrategy.FCFS);
sink = Sink(model, 'Sink');
jobclass = OpenClass(model, 'Class1');
source.setArrival(jobclass, Exp(0.7));
queue1.setService(jobclass, Exp(1.0));
queue2.setService(jobclass, Exp(1.5));
P = model.initRoutingMatrix();
P.set(jobclass, jobclass, source, queue1, 1.0);
P.set(jobclass, jobclass, queue1, queue2, 1.0);
P.set(jobclass, jobclass, queue2, sink, 1.0);
model.link(P);
solver = QNS(model);
QNS(model).avgTable()
Output:
QNS analysis [method: default; type: approximate, deterministic; lang: matlab; env: 2025a] completed in 0.122s.
2×8 table
Station JobClass QLen Util RespT ResidT ArvR Tput
Queue1 Class1 0 0 0 0 0 0.7
Queue2 Class1 0 0 0 0 0.7 0.7
// Create an open queueing network (tandem queues)
Network model = new Network("QNS Example");
Source source = new Source(model, "Source");
Queue queue1 = new Queue(model, "Queue1", SchedStrategy.FCFS);
Queue queue2 = new Queue(model, "Queue2", SchedStrategy.FCFS);
Sink sink = new Sink(model, "Sink");
OpenClass jobclass = new OpenClass(model, "Class1");
source.setArrival(jobclass, new Exp(0.7));
queue1.setService(jobclass, new Exp(1.0));
queue2.setService(jobclass, new Exp(1.5));
RoutingMatrix P = model.initRoutingMatrix();
P.set(jobclass, jobclass, source, queue1, 1.0);
P.set(jobclass, jobclass, queue1, queue2, 1.0);
P.set(jobclass, jobclass, queue2, sink, 1.0);
model.link(P);
QNS solver = new QNS(model);
solver.avgTable.print();
Output:
QNS analysis [method: default; type: approximate, deterministic; lang: java; env: 17.0.9] completed.
Station JobClass QLen Util RespT ResidT ArvR Tput
Queue1 Class1 0 0 0 0 0 0.7
Queue2 Class1 0 0 0 0 0.7 0.7
# Create an open queueing network (tandem queues)
from line_solver import *
model = Network("QNS Example")
source = Source(model, "Source")
queue1 = Queue(model, "Queue1", SchedStrategy.FCFS)
queue2 = Queue(model, "Queue2", SchedStrategy.FCFS)
sink = Sink(model, "Sink")
jobclass = OpenClass(model, "Class1")
source.set_arrival(jobclass, Exp(0.7))
queue1.set_service(jobclass, Exp(1.0))
queue2.set_service(jobclass, Exp(1.5))
P = model.init_routing_matrix()
P.set(jobclass, jobclass, source, queue1, 1.0)
P.set(jobclass, jobclass, queue1, queue2, 1.0)
P.set(jobclass, jobclass, queue2, sink, 1.0)
model.link(P)
solver = QNS(model)
print(solver.avg_table)
Output:
QNS analysis [method: default; type: approximate, deterministic; lang: python; env: 3.13.7] completed.
Station JobClass QLen Util RespT ResidT ArvR Tput
Queue1 Class1 0 0 0 0 0 0.7
Queue2 Class1 0 0 0 0 0.7 0.7