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.

LN methods and aliases
MethodAlgorithm and applicability
defaultAlias of srvn.
srvnsrvn.ph where it can serve the model, srvn.cs otherwise; resolved once at layer build.
srvn.phOne submodel per server, each activity graph reduced by exact series-parallel reduction into one phase-type entry service law.
srvn.csOne submodel per server with the activity graph encoded as class routing (a class per task, entry, activity and call); serves every layered feature.
flatAlias of flat.cs.
flat.csSquashed layering: a single submodel holding every processor and task, activity graphs encoded as class routing.
flat.phThe same single submodel with each activity graph reduced to a phase-type entry service law.
moment3Three-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.

Solver-specific configuration
OptionDefaultDescription and values
fluid_warmstarttrueWarm-start a fluid layer from the terminal ODE state of its previous outer iteration instead of restarting cold.
interlockinternalThe per-class interlocking matrix LN hands down to the layer MVA.
interlock_chaininternalThe chain-level interlock derived from it by sn_interlock_chain, consumed by solver_amva.
interlockingtrueWhether interlocking is corrected for at all; false switches every method off.
interlock_maxpaths32refpath 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_channelsallWhich inter-layer coupling channels that relaxation carries.
ln_transient_iter_maxmethod defaultIteration cap of the waveform relaxation.
ln_transient_tolmethod defaultConvergence tolerance of the same.
relax'fixed'Under-relaxation of the outer iteration: 'auto', 'fixed', 'adaptive', 'none'.
relax_factor0.5The relaxation factor omega, in (0,1].
relax_history5Error history window the adaptive mode looks back over.
relax_min0.1Floor 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_a01.0Robbins-Monro initial step size after burn-in.
stochiter_alpha0.6Robbins-Monro step decay exponent, in (0.5,1].
stochiter_burnin5Picard iterations run before the step decay starts.
stochiter_conseq3Consecutive 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