LN (Layered Network Solver)

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.

MethodAlgorithmReference
defaultAutomatic layer analysis and iteration
moment3Three-moment matching iterative algorithm
molMethod of layers iterative decomposition

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, lang: matlab] 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, lang: java] 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, lang: python] completed.

  Processor     Task         Entry          Util     Throughput    RespT
  AppServer     AppTask   handleRequest     0.85        0.85         1.2