LQNS (Layered Queueing Network Solver)
Methods · Configuration · Shared options · All solvers
The LQNS wrapper integrates the Layered Queueing Network Solver developed by the RADS group at Carleton University. LINE automatically exports network models to LQNS format, invokes the external LQNS tool, and imports the results back into LINE's data structures.
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.
| Method | Algorithm and applicability |
|---|---|
default | Run lqns with -Pstop-on-message-loss=false. |
lqns | The same as default, asked for by name. |
srvn | lqns -Playering=srvn: the SRVN layering strategy. |
exactmva | lqns -Pmva=exact: exact MVA inside the layer solves. |
srvn.exactmva | Both of the above: SRVN layering with exact MVA. |
sim, lqsim | lqsim, the LQN discrete-event simulator, at options.samples run length. |
lqnsdefault | Plain lqns with no LINE pragmas at all, i.e. the tool's own defaults. |
The multiserver approximation passed as -Pmultiserver= comes from options.config.multiserver (rolia when left at default).
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: samples, keep, timeout.
The wrapper uses local lqns/lqsim binaries unless config.remote selects the LQNS REST service. config.multiserver='default' resolves to rolia. container is ignored by LQNS and lqsim.
| Option | Default | Description and values |
|---|---|---|
remote | false | LQNS: solve through the lqns-rest service instead of the local binary. |
remote_url | 'http://localhost:8080' | URL of that service. |
multiserver | 'default' | LQNS and QNS: the multiserver approximation passed through to the external solver (-Pmultiserver=). |
Example
This example demonstrates the LQNS solver integration with the external Layered Queueing Network Solver. The unique feature of LQNS is its integration with the external LQNS tool from Carleton University, which LINE automatically invokes by exporting the model, running LQNS, and importing the results.
% Create a layered network for LQNS analysis
model = LayeredNetwork('LQNS Example');
% Define processor and task
processor = Processor(model, 'WebServer', 1, SchedStrategy.PS);
task = Task(model, 'WebTask', 1, SchedStrategy.REF);
entry = Entry(model, 'processRequest');
% Set service time
entry.setService(Exp(0.5));
% Link task to processor
task.on(processor);
task.addEntry(entry);
% Solve with external LQNS tool
LQNS(model).avgTable()
Output:
LQNS analysis [method: lqns; type: approximate, deterministic; lang: matlab; env: 2025a] completed in 0.15s. Processor Task Entry Util Throughput RespT WebServer WebTask processRequest 0.75 1.5 0.5
// Create a layered network for LQNS analysis
LayeredNetwork model = new LayeredNetwork("LQNS Example");
// Define processor and task
Processor processor = new Processor(model, "WebServer", 1, SchedStrategy.PS);
Task task = new Task(model, "WebTask", 1, SchedStrategy.REF);
Entry entry = new Entry(model, "processRequest");
// Set service time
entry.setService(new Exp(0.5));
// Link task to processor
task.on(processor);
task.addEntry(entry);
// Solve with external LQNS tool
new LQNS(model).avgTable.print();
Output:
LQNS analysis [method: lqns; type: approximate, deterministic; lang: java; env: 17.0.9] completed. Processor Task Entry Util Throughput RespT WebServer WebTask processRequest 0.75 1.5 0.5
# Create a layered network for LQNS analysis
from line_solver import *
model = LayeredNetwork("LQNS Example")
# Define processor and task
processor = Processor(model, "WebServer", 1, SchedStrategy.PS)
task = Task(model, "WebTask", 1, SchedStrategy.REF)
entry = Entry(model, "processRequest")
# Set service time
entry.set_service(Exp(0.5))
# Link task to processor
task.on(processor)
task.add_entry(entry)
# Solve with external LQNS tool
print(LQNS(model).avg_table)
Output:
LQNS analysis [method: lqns; type: approximate, deterministic; lang: python; env: 3.13.7] completed. Processor Task Entry Util Throughput RespT WebServer WebTask processRequest 0.75 1.5 0.5