MAM (Matrix Analytic Methods)

Methods · Configuration · Shared options · All solvers

The MAM solver analyzes open and closed queueing systems with Markovian structure using matrix-analytic methods. The core solver is built on top of the BuTools library [1], Q-MAM, SMCSolver, and MAMSolver [3]. Native algorithms for parametric decomposition of queueing networks are integrated with this solver.

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.

MAM methods and aliases
MethodAlgorithm and applicabilityReference
defaultPick the route from the topology: the fork-join codes on a homogeneous fork-join, the retrial or reneging analyzer on those shapes, otherwise the dec.source decomposition.[1]
dec.sourceQueue-by-queue decomposition: each station is solved as a QBD fed by the departure process its upstream neighbours produce.
dec.poissonThe same decomposition with the arrival superposition capped at one phase, i.e. Poisson inter-station traffic (space_max = 1).
dec.mmapDecomposition in which each class's service law scaled by its utilization is used as the departure process (marked traffic).
dec.source.mmapMMAP-based fork-join decomposition with mmap_max synchronization; the default on a general fork-join topology.
mnaMatrix-analytic network analysis: the open or closed MNA fixed point over INF/PS/FCFS stations.[2]
ldqbdRate matrices and stationary vector of a level-dependent QBD; one FCFS queue plus one delay (closed) or one Poisson source (open), single class.
bgchainFlow-equivalent aggregation of the untagged closed classes into the second class of a background modulating chain.
retrialThe BMAP/PH/N/N bufferless retrial analyzer and the MAP/M/s+G reneging analyzer, which default also resolves to on either shape.

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, cutoff, timespan.

The MATLAB iteration limit is iter_max=100. Shared merge, compress and fixed-point driver settings also control decomposition. For INAP methods, use AG.

Solver-specific configuration
OptionDefaultDescription and values
bgaggrunsetBackground-chain method: how many closed chains are aggregated together; lower it when the class count is refused.
bgenv'lump'How the background environment is built from those chains.
bgstates_maxcapLargest background CTMC state space mam_bgchain_ctmc will generate.
dep_scv'qna'Departure-SCV formula of the open decomposition: 'qna' is Whitt's, 'etaqa' takes the QBD joint moments.
dt_maxlevelderivedDiscrete-time M/G/1 queue: number of level components kept in the truncated solution.
etaqa_trunc8Truncation level of the ETAQA aggregation used for the marked-MMAP queue.
fj_accuracy100The C parameter of the fork-join matrix codes; higher is more accurate and slower.
fj_sync_q_len2Queue-length truncation of the fork-join synchronization station in the MMAP traffic model.
fj_tmode'NARE'How the fork-join T matrix is computed: 'NARE' (nonsymmetric algebraic Riccati) or 'Sylves' (Sylvester).
mapmsg_quantization11Quantization levels of the message MAP built for the retrial orbit.
orbit_maxlevelderivedLevel truncation of the retrial orbit's QBD.
orbit_tailtolderivedTail mass below which that orbit truncation is accepted.
qbdphases_max500Largest phase dimension a QBD block is allowed to reach.
space_maxmethod defaultCap on the state space of the basic MMAP queue solve, above which a cheaper arm is taken.

MAP/BMAP/1 Queue Solver

The MAM solver includes specialized support for MAP/BMAP/1 queues (Markovian Arrival Process with Batch Markovian Service). This solver models the queue as a GI/M/1 type Markov chain (skip-free to the right) and uses the ETAQA algorithm for efficient computation of stationary probabilities and queue length moments.

Key Characteristics:

  • MAP arrivals: Arrivals follow a Markovian Arrival Process, adding one customer at a time
  • BMAP service: Service completions can process batches of 1, 2, 3, ... customers
  • GI/M/1-type structure: Level increases by exactly 1 (arrivals), decreases by any amount (batch service)

Features:

  • Supports phase-type modulated arrival processes (MAP)
  • Handles batch service with arbitrary batch size distributions
  • Computes mean queue length, utilization, response time, and throughput
  • Returns aggregated stationary probabilities and R matrix

MATLAB Usage:

% Create 2-phase MAP for arrivals
C0 = [-3.0, 1.0; 0.5, -2.0];  % transitions without arrivals
C1 = [1.5, 0.5; 0.5, 1.0];    % arrival transitions

% Create BMAP for service with batch sizes 1 and 2
D0 = [-5.0, 1.0; 0.5, -4.5];  % transitions without service
D1 = [2.0, 0.5; 0.5, 2.0];    % batch size 1 service
D2 = [1.0, 0.5; 0.5, 1.0];    % batch size 2 service

% Solve MAP/BMAP/1
[QN, UN, RN, TN] = solver_mam_map_bmap_1({C0, C1}, {D0, D1, D2});

% Display results
fprintf('Mean queue length: %.4f\n', QN);
fprintf('Utilization: %.4f\n', UN);
fprintf('Mean response time: %.4f\n', RN);
fprintf('Throughput: %.4f\n', TN);

Python Usage:

import numpy as np
from line_solver.api_native.mam import solver_mam_map_bmap_1

# Create 2-phase MAP for arrivals
C0 = np.array([[-3.0, 1.0], [0.5, -2.0]])
C1 = np.array([[1.5, 0.5], [0.5, 1.0]])

# Create BMAP for service with batch sizes 1 and 2
D0 = np.array([[-5.0, 1.0], [0.5, -4.5]])
D1 = np.array([[2.0, 0.5], [0.5, 2.0]])
D2 = np.array([[1.0, 0.5], [0.5, 1.0]])

# Solve MAP/BMAP/1
result = solver_mam_map_bmap_1(C0, C1, [D0, D1, D2])

print(f"Mean queue length: {result.mean_queue_length:.4f}")
print(f"Utilization: {result.utilization:.4f}")
print(f"Mean response time: {result.mean_response_time:.4f}")
print(f"Throughput: {result.throughput:.4f}")

BMAP/MAP/1 Queue Solver

The MAM solver includes specialized support for BMAP/MAP/1 queues (Batch Markovian Arrivals with Markovian Service). This solver models the queue as an M/G/1 type Markov chain (skip-free to the left) and uses the ETAQA algorithm for efficient computation of stationary probabilities and queue length moments.

Key Characteristics:

  • BMAP arrivals: Batch arrivals with sizes 1, 2, 3, ... following a Batch Markovian Arrival Process
  • MAP service: Service completions follow a Markovian Arrival Process, serving one customer at a time
  • M/G/1-type structure: Level increases by any amount (batch arrivals), decreases by exactly 1 (single service)

Features:

  • Supports batch arrivals with arbitrary batch size distributions
  • Handles phase-type modulated service processes (MAP)
  • Computes mean queue length, utilization, response time, and throughput
  • Returns aggregated stationary probabilities and G matrix

MATLAB Usage:

% Create BMAP for arrivals with batch sizes 1 and 2
D0 = [-2.8, 1.6; 1.6, -2.8];  % transitions without arrivals
D1 = [0.5, 0.2; 0.2, 0.5];    % batch size 1 arrivals
D2 = [0.3, 0.2; 0.2, 0.3];    % batch size 2 arrivals

% Create 2-phase MAP for service
S0 = [-5.0, 1.0; 0.5, -4.5];  % transitions without service
S1 = [2.5, 1.5; 1.5, 2.5];    % service transitions

% Solve BMAP/MAP/1
[QN, UN, RN, TN] = solver_mam_bmap_map_1({D0, D1, D2}, {S0, S1});

% Display results
fprintf('Mean queue length: %.4f\n', QN);
fprintf('Utilization: %.4f\n', UN);
fprintf('Mean response time: %.4f\n', RN);
fprintf('Throughput: %.4f\n', TN);

Python Usage:

import numpy as np
from line_solver.api_native.mam import solver_mam_bmap_map_1

# Create BMAP for arrivals with batch sizes 1 and 2
D0 = np.array([[-2.8, 1.6], [1.6, -2.8]])
D1 = np.array([[0.5, 0.2], [0.2, 0.5]])
D2 = np.array([[0.3, 0.2], [0.2, 0.3]])

# Create 2-phase MAP for service
S0 = np.array([[-5.0, 1.0], [0.5, -4.5]])
S1 = np.array([[2.5, 1.5], [1.5, 2.5]])

# Solve BMAP/MAP/1
result = solver_mam_bmap_map_1([D0, D1, D2], S0, S1)

print(f"Mean queue length: {result.mean_queue_length:.4f}")
print(f"Utilization: {result.utilization:.4f}")
print(f"Mean response time: {result.mean_response_time:.4f}")
print(f"Throughput: {result.throughput:.4f}")

Example

This example demonstrates solving a simple M/M/1 queue using the MAM solver. The unique feature shown here is the iterative matrix-analytic method which converges to the solution (note the "Iterations: 4" in the output).

% Create a simple M/M/1 queue
model = Network('M/M/1 Example');
source = Source(model, 'Source');
queue = Queue(model, 'Queue1', SchedStrategy.FCFS);
sink = Sink(model, 'Sink');

jobclass = OpenClass(model, 'Class1');
source.setArrival(jobclass, Exp(0.9));
queue.setService(jobclass, Exp(1.0));

model.link(Network.serialRouting(source, queue, sink));

% Solve with MAM (Matrix Analytic Methods)
solver = MAM(model);

% Display average performance metrics
MAM(model).avgTable()

Output:

Default method: using dec.source
MAM analysis [method: default/dec.source; type: approximate, deterministic; lang: matlab; env: 2025a] completed in 0.123s. Iterations: 4.

ans =
  2×8 table
    Station    JobClass    QLen    Util    RespT    ResidT    ArvR    Tput
    _______    ________    ____    ____    _____    ______    ____    ____
    Source      Class1      0        0       0         0        0     0.9
    Queue1      Class1      9      0.9      10        10      0.9     0.9 
import jline.lang.*;
import jline.lang.constant.SchedStrategy;
import jline.lang.nodes.*;
import jline.lang.processes.Exp;
import jline.solvers.NetworkAvgTable;
import jline.solvers.mam.MAM;

public class MAMExample {
    public static void main(String[] args) {
        // Create a simple M/M/1 queue
        Network model = new Network("M/M/1 Example");

        Source source = new Source(model, "Source");
        Queue queue = new Queue(model, "Queue1", SchedStrategy.FCFS);
        Sink sink = new Sink(model, "Sink");

        OpenClass jobclass = new OpenClass(model, "Class1");
        source.setArrival(jobclass, Exp.fitRate(0.9));
        queue.setService(jobclass, Exp.fitRate(1.0));

        model.link(Network.serialRouting(source, queue, sink));

        // Solve with MAM (Matrix Analytic Methods)
        MAM solver = new MAM(model);

        // Display average performance metrics
        NetworkAvgTable avgTable = solver.avgTable;
        System.out.println(avgTable);
    }
}

Output:

Default method: using dec.source
MAM analysis [method: default/dec.source; type: approximate, deterministic; lang: java; env: 17.0.9] completed. Iterations: 4.

Station    JobClass    QLen    Util    RespT    ResidT    ArvR    Tput
Source     Class1      0.0     0.0     0.0      0.0       0.0     0.9
Queue1     Class1      9.0     0.9     10.0     10.0      0.9     0.9
from line_solver import *

# Create a simple M/M/1 queue
model = Network('M/M/1 Example')

source = Source(model, 'Source')
queue = Queue(model, 'Queue1', SchedStrategy.FCFS)
sink = Sink(model, 'Sink')

jobclass = OpenClass(model, 'Class1')
source.setArrival(jobclass, Exp(0.9))
queue.setService(jobclass, Exp(1.0))

model.link(Network.serialRouting(source, queue, sink))

# Solve with MAM (Matrix Analytic Methods)
solver = MAM(model)

# Display average performance metrics
print(solver.avg_table)

Output:

Default method: using dec.source
MAM analysis [method: default/dec.source; type: approximate, deterministic; lang: python; env: 3.13.7] completed. Iterations: 4.

  Station  JobClass  QLen  Util  RespT  ResidT  ArvR  Tput
0  Source    Class1   0.0   0.0    0.0     0.0   0.0   0.9
1  Queue1    Class1   9.0   0.9   10.0    10.0   0.9   0.9

References

  1. Horváth, G., & Telek, M. (2017). BuTools: Burstiness and heavy traffic modeling. IEEE Communications Surveys & Tutorials.
  2. Li, Z., & Casale, G. (2024). Matrix Network Analyzer: A new decomposition algorithm for phase-type queueing networks. Proc. of ACM/SPEC ICPE, 77-88.
  3. Riska, A., & Smirni, E. (2003). ETAQA: An Efficient Technique for the Analysis of QBD-Processes by Aggregation. Performance Evaluation, 54(2):151-177. MAMSolver