LN (Layered Network Solver)
Methods · Configuration · Shared options · All solvers
The LN solver analyzes layered queueing networks using iterative decomposition methods. It decomposes the network into layers and solves them iteratively, updating metrics and parameters until convergence. This approach is particularly effective for analyzing software architectures with multiple service layers and task dependencies.
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 | Alias of srvn. |
srvn | srvn.ph where it can serve the model, srvn.cs otherwise; resolved once at layer build. |
srvn.ph | One submodel per server, each activity graph reduced by exact series-parallel reduction into one phase-type entry service law. |
srvn.cs | One submodel per server with the activity graph encoded as class routing (a class per task, entry, activity and call); serves every layered feature. |
flat | Alias of flat.cs. |
flat.cs | Squashed layering: a single submodel holding every processor and task, activity graphs encoded as class routing. |
flat.ph | The same single submodel with each activity graph reduced to a phase-type entry service law. |
moment3 | Three-moment response-time distribution pass: the routing layers plus a distribution propagation. |
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: iter_max, iter_tol, timespan, init_sol.
LN defaults to iter_max=200 and iter_tol=5e-3. Configure the inner layer solver through its solver factory; its own method and options still apply.
| Option | Default | Description and values |
|---|---|---|
fluid_warmstart | true | Warm-start a fluid layer from the terminal ODE state of its previous outer iteration instead of restarting cold. |
interlock | internal | The per-class interlocking matrix LN hands down to the layer MVA. |
interlock_chain | internal | The chain-level interlock derived from it by sn_interlock_chain, consumed by solver_amva. |
interlocking | true | Whether interlocking is corrected for at all; false switches every method off. |
interlock_maxpaths | 32 | refpath refuses a layer whose reference path carries more routes than this. |
interlock_method | 'ilrate' | How the interlock is applied: 'ilrate' discounts residence times, 'refpath' gives the client Delay an explicit reference chain, 'none' measures without applying. |
interlock_refpath_scope | 'merging' | Which layers refpath transforms: 'merging' only those with two or more callers under one reference task, 'all' every layer. |
layering | 'srvn' | Submodel construction: 'srvn' gives each server its own submodel, 'flat' puts every processor and task in one. |
layer_init | 'none' | Initial throughputs of the layer iteration: 'bound'/'boxbound'/'mwba' seeds them from lqn_boxbounds. |
ln_transient | 'coupled' | Inter-layer coupling of a transient: 'coupled' reconciles the layers by waveform relaxation, 'decoupled' freezes demands at the fixed point. |
ln_transient_channels | all | Which inter-layer coupling channels that relaxation carries. |
ln_transient_iter_max | method default | Iteration cap of the waveform relaxation. |
ln_transient_tol | method default | Convergence tolerance of the same. |
relax | 'fixed' | Under-relaxation of the outer iteration: 'auto', 'fixed', 'adaptive', 'none'. |
relax_factor | 0.5 | The relaxation factor omega, in (0,1]. |
relax_history | 5 | Error history window the adaptive mode looks back over. |
relax_min | 0.1 | Floor on omega in adaptive mode. |
stochiter | 'auto' | Iteration scheme when the layer solvers are simulation-based and return noisy estimates: 'rm' (Robbins-Monro), 'crn' (common random numbers), 'off'. |
stochiter_a0 | 1.0 | Robbins-Monro initial step size after burn-in. |
stochiter_alpha | 0.6 | Robbins-Monro step decay exponent, in (0.5,1]. |
stochiter_burnin | 5 | Picard iterations run before the step decay starts. |
stochiter_conseq | 3 | Consecutive sub-tolerance iterations required before stopping. |
Example
This example demonstrates the LN solver on a simple layered queueing network with a processor-task-entry hierarchy. The unique feature of LN is its ability to analyze software architectures with multiple service layers and task dependencies using iterative decomposition methods.
% Create a simple layered network with processor and tasks
model = LayeredNetwork('LN Example');
% Define processor and tasks
processor = Processor(model, 'AppServer', 1, SchedStrategy.PS);
task = Task(model, 'AppTask', 1, SchedStrategy.REF);
entry = Entry(model, 'handleRequest');
% Set service time
entry.setService(Exp(1.0));
% Link task to processor
task.on(processor);
task.addEntry(entry);
% Solve with LN
LN(model).avgTable()
Output:
LN analysis [method: default; type: approximate, deterministic; lang: matlab; env: 2025a] completed in 0.05s. Processor Task Entry Util Throughput RespT AppServer AppTask handleRequest 0.85 0.85 1.2
// Create a simple layered network with processor and tasks
LayeredNetwork model = new LayeredNetwork("LN Example");
// Define processor and tasks
Processor processor = new Processor(model, "AppServer", 1, SchedStrategy.PS);
Task task = new Task(model, "AppTask", 1, SchedStrategy.REF);
Entry entry = new Entry(model, "handleRequest");
// Set service time
entry.setService(new Exp(1.0));
// Link task to processor
task.on(processor);
task.addEntry(entry);
// Solve with LN
new LN(model).avgTable.print();
Output:
LN analysis [method: default; type: approximate, deterministic; lang: java; env: 17.0.9] completed. Processor Task Entry Util Throughput RespT AppServer AppTask handleRequest 0.85 0.85 1.2
# Create a simple layered network with processor and tasks
from line_solver import *
model = LayeredNetwork("LN Example")
# Define processor and tasks
processor = Processor(model, "AppServer", 1, SchedStrategy.PS)
task = Task(model, "AppTask", 1, SchedStrategy.REF)
entry = Entry(model, "handleRequest")
# Set service time
entry.set_service(Exp(1.0))
# Link task to processor
task.on(processor)
task.add_entry(entry)
# Solve with LN
print(LN(model).avg_table)
Output:
LN analysis [method: default; type: approximate, deterministic; lang: python; env: 3.13.7] completed. Processor Task Entry Util Throughput RespT AppServer AppTask handleRequest 0.85 0.85 1.2