LINE is an open source solver for simulation and analytical solution of queueing models. The tool is developed by the QORE lab at Imperial College London and distributed under the BSD-3 license (full license text).

Getting started

Download Icon Download integrated release 3.0.9 (Python, Matlab, Java, and C++)

Notes:

  • The C++ port ships as source: unpack the archive and build it with ./make.sh at its root.
  • With the lang option, Python can run the Java and C++ engines (lang="java" or lang="cpp"), while MATLAB can run the Java, Python, and C++ engines (lang='java', lang='python', or lang='cpp').

Quick Example: Solving an M/M/1 Queue

Build and solve an open M/M/1 queueing model with arrival rate λ = 1.0 and service rate μ = 2.0 in a few lines of code (see Tutorials for more examples):

from line_solver import *

model = Network('M/M/1')
source = Source(model, 'Source')
queue = Queue(model, 'Queue', SchedStrategy.FCFS)
sink = Sink(model, 'Sink')

jobclass = OpenClass(model, 'Class1')
source.setArrival(jobclass, Exp(1.0))
queue.setService(jobclass, Exp(2.0))
model.link(Network.serialRouting(source, queue, sink))

print(MVA(model).avgTable)
model = Network('M/M/1');
source = Source(model, 'Source');
queue = Queue(model, 'Queue', SchedStrategy.FCFS);
sink = Sink(model, 'Sink');

jobclass = OpenClass(model, 'Class1');
source.setArrival(jobclass, Exp(1.0));
queue.setService(jobclass, Exp(2.0));
model.link(Network.serialRouting(source, queue, sink));

MVA(model).getAvgTable
Network model = new Network("M/M/1");
Source source = new Source(model, "Source");
Queue queue = new Queue(model, "Queue", SchedStrategy.FCFS);
Sink sink = new Sink(model, "Sink");

OpenClass jobclass = new OpenClass(model, "Class1");
source.setArrival(jobclass, new Exp(1.0));
queue.setService(jobclass, new Exp(2.0));
model.link(Network.serialRouting(source, queue, sink));

new MVA(model).getAvgTable().print();
#include <line/line.hpp>
using namespace line;

int main() {
    Network model("M/M/1");
    Source source(model, "Source");
    Queue queue(model, "Queue", SchedStrategy::FCFS);
    Sink sink(model, "Sink");

    OpenClass jobclass(model, "Class1");
    source.setArrival(jobclass, Exp(1.0));
    queue.setService(jobclass, Exp(2.0));
    model.link(Network::serialRouting({&source, &queue, &sink}));

    MVA(model).getAvgTable().print();
    return 0;
}

MCP Integration

LINE is available as a Model Context Protocol (MCP) server, enabling LLM tools to build and solve queueing models through natural language. Install with pip install line-solver, which puts a line-mcp command on your path for the client to launch, and see the MCP Integration page or the MCP Getting Started Guide for details.

Acknowledgement

The development of LINE has been partially funded by the European Commission grants FP7-318484 (MODAClouds), H2020-644869 (DICE), H2020-825040 (RADON), the Horizon Europe grants 101299128 (EuroFMX) and 101298393 (f-inference), and by the EPSRC grant EP/M009211/1 (OptiMAM).

If you use LINE for a research paper, please cite the following article:

Supported Models

LINE can evaluate several types of queueing models and systems, including:

  • M/M/1 queues
  • M/M/c multiserver queues
  • G/G/1 queues
  • G/G/c queues
  • Matrix analytic methods
    • M/G/1 queues
    • M/G/c queues
    • PH/PH/1 queues
    • ME/ME/1 queues
    • PH/PH/c queues
    • MAP/MAP/1 queues
    • MAP/MAP/c queues
    • RAP/RAP/1 queues
    • BMAP/BMAP/1 queues
  • BCMP/Kelly product-form queueing networks
    • open
    • closed
    • mixed
    • load-dependent
    • class-dependent
    • class switching
  • Extended queueing networks
    • fork-join
    • priority
    • blocking
    • state-dependent routing
    • random environments
    • polling
    • finite-capacity regions
    • order-independent stations
    • retrial, balking and reneging
    • server breakdowns and setup times
  • G-networks with signals
    • negative customers
    • triggers and replies
    • catastrophes
  • Stochastic Petri nets
    • timed and immediate transitions
    • marking-dependent firing rates
    • queueing Petri nets
  • Loss networks with finite capacity and blocking
  • Cache models with LRU, FIFO, and other replacement policies
  • Layered networks
    • Layered queueing networks (LQN)
    • Layered cache-queueing models (LCQ)

For further details, see the project statistics page and the algorithm catalog.

Solvers

Each solver page lists all methods, aliases, model restrictions and configuration fields. See shared solver options for common defaults and usage, or browse the Algorithms catalog of all solution methods. When no specific solver is required, AUTO examines the model topology, distributions and scheduling disciplines, and selects a suitable exact, approximate or simulation method.

LINE Native Solvers

The following solvers are implemented natively in LINE:

Solver Description Best For
AG Agent-based reversed-rate fixed points for cooperating processes and G-networks. G-networks with signals, negative customers, and product-form RCAT processes
BA Throughput, queue-length and response-time bounds, including blocking and Petri-net relaxations. Fast asymptotic bounds on throughput and response time without full state-space exploration
CTMC Constructs and solves the underlying Markov chain using the global-balance equations and uniformization. Small state spaces, exact steady-state and transient probability analysis
LDES Discrete-event simulator built on the SSJ library, available as a native C++ engine and as a Java engine. MATLAB and Python drive either through a JSON subprocess interface. High-speed discrete-event simulation of general non-Markovian and extended queueing networks
FLD Solves models using fluid/mean-field approximation based on ODEs. Large populations, multi-server queues, and transient dynamics via ODEs
MAM Applies matrix-analytic methods and parametric decomposition for quasi-birth-death processes. Single queues and open networks with MAP/PH arrivals and non-exponential service
MVA Implements exact and approximate mean value analysis for closed and mixed networks. Fast steady-state averages of product-form and extended closed/open/mixed networks
NC Computes performance metrics, including probability distributions, by estimating normalizing constants. Exact and asymptotic normalizing constants and state probabilities in closed networks
SSA Performs continuous-time Markov-chain simulation with Gillespie and next-reaction methods, plus exact-corrected multilevel Monte Carlo estimates of finite-horizon rewards. Stochastic simulation of Markovian models with arbitrary features and finite-horizon rewards

LINE Native Meta-Solvers

Meta-solvers analyze complex models by coordinating the execution of other solvers:

Solver Description Best For
AUTO Automatically selects the most appropriate solver based on model characteristics. General-purpose usage when you want LINE to pick the best solver automatically
ENV Analyzes queueing models operating in random environments with multiple operational stages. Systems subject to breakdowns, repairs, or phase-changing random environments
LN Analyzes layered queueing networks using iterative decomposition. Multi-tier software architectures and microservices modeled as Layered Queueing Networks
UQ Quantifies parameter uncertainty by propagating a prior distribution through a model and aggregating the results into posterior performance metrics. Sensitivity analysis and confidence intervals under uncertain input parameters

LINE Wrappers

LINE provides wrapper solvers that integrate external tools for specialized analysis:

Solver Description Best For
JMT A wrapper for the Java Modelling Tools suite enabling execution of JMVA and JSIM. Discrete-event simulation via JSIMio and cross-validation with Java Modelling Tools
LQNS A wrapper for the LQNS solver for layered queueing networks, which also runs the qnsolver library of the LQNS suite for product-form analysis of ordinary queueing networks. Solving layered queueing networks via the external LQNS/LQSIM toolchain

External Tools Integration

LINE integrates with several external performance modeling tools to extend its analysis capabilities:

Tool Description Reference
BuTools A collection of tools for phase-type distributions and Markovian arrival processes developed at Budapest University of Technology. [63]
JMT Java Modelling Tools, an open-source suite for performance evaluation developed at Politecnico di Milano. LINE uses a custom build: JAR, sources. [11]
KPC-Toolbox A MATLAB toolbox for fitting Markovian Arrival Processes developed at William & Mary. DOI
MAMSolver A tool for matrix-analytic methods developed at William & Mary. [101]
Q-MAM A MATLAB toolbox for matrix-analytic methods in queueing theory developed at University of Antwerp. DOI
rmf_tool A library for computing refined mean field approximations for density-dependent population processes, developed at Inria by Nicolas Gast. [52]
SMCSolver A solver for structured Markov chains in queueing models developed at University of Pisa and University of Antwerp. DOI
SSJ A library for stochastic simulation developed at Université de Montréal. DOI

Interoperability

LINE supports cross-language execution, model transformations, and integration with external tools. See the Interoperability page.

Manuals & Publications

LINE provides six documentation types for every supported language:

  • Primer (PDF): A gentle tutorial introduction to queueing modeling concepts and your first LINE models.
  • User Manual (PDF): Comprehensive guide to all node types, job classes, scheduling strategies, solvers, and options.
  • Examples (PDF): Catalog of worked examples covering classical queues, BCMP networks, LQNs, and random environments.
  • Internals (PDF): Architectural reference describing data structures (NetworkStruct), solver pipelines, and algorithms.
  • Cheatsheet (PDF): Compact quick-reference card summarizing constructors, distributions, and solver calls.
  • API Reference (HTML): Searchable class, method, and function documentation generated via Sphinx, Javadoc, and Doxygen.

Language-independent: MCP Getting Started PDF

Citing LINE

If you use LINE for a research paper, please cite the following article:

Selected Publications

The following research papers extend or apply LINE across different domains (see also the full Algorithms Bibliography):