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 integrated release 3.0.9 (Python, Matlab, Java, and C++)
Python
Matlab
Java
Notes:
- The C++ port ships as source: unpack the archive and build it with
./make.shat its root. - With the
langoption, Python can run the Java and C++ engines (lang="java"orlang="cpp"), while MATLAB can run the Java, Python, and C++ engines (lang='java',lang='python', orlang='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:
- Giuliano Casale. Integrated Performance Evaluation of Extended Queueing Network Models with LINE. Proceedings of the 2020 Winter Simulation Conference, ACM Press, December 2020.
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:
- G. Casale. Integrated Performance Evaluation of Extended Queueing Network Models with LINE. Winter Simulation Conference, ACM Press, December 2020.
Selected Publications
The following research papers extend or apply LINE across different domains (see also the full Algorithms Bibliography):
- Y. Gao, G. Casale, R. Singhal. Performance Modeling of Distributed Data Processing in Microservice Applications. ACM TOMPECS, October 2024.
- Y. Zhou, M. Sheldon, G. Casale. Approximating Closed Queueing Networks in Semi-Markov Random Environments. IEEE MASCOTS, October 2024.
- G. Casale, Y. Gao, Z. Niu, L. Zhu. LN: A Flexible Algorithmic Framework for Layered Queueing Network Analysis. ACM TOMACS, July 2024.
- R.-A. Dobre, Z. Niu, G. Casale. Approximating Fork-Join Systems via Mixed Model Transformations. ACM/SPEC ICPE, May 2024.
- Z. Li, G. Casale. Matrix Network Analyzer: A New Decomposition Algorithm for Phase-type Queueing Networks. ACM/SPEC ICPE, May 2024.
- Z. Niu, G. Casale. Neural Density Estimation of Response Times in Layered Software Systems. IEEE TSE, January 2024.
- R. Wang, G. Casale, A. Filieri. Estimating Multiclass Service Demand Distributions Using Markovian Arrival Processes. ACM TOMACS, February 2023.
- Z. Niu, G. Casale. A Mixture Density Network Approach to Predicting Response Times in Layered Systems. IEEE MASCOTS, November 2021.
- G. Casale. Automated Multi-paradigm Analysis of Extended and Layered Queueing Models with LINE. ACM/SPEC ICPE, 2019.
- J. F. Perez and G. Casale. LINE: Evaluating Software Applications in Unreliable Environments. IEEE Transactions on Reliability, 66(3), pp. 837-853, Sept 2017.
- C. Muller, P. Rygielski, S. Spinner and S. Kounev. Enabling Fluid Analysis for Queueing Petri Nets via Model Transformation. Intl. Workshop on Practical Applications of Stochastic Modelling (PASM), 2016.
- D. J. Dubois and G. Casale. OptiSpot: minimizing application deployment cost using spot cloud resources. IEEE CLOUD, 2016.
- R. Osman, J. F. Perez and G. Casale. Quantifying the Impact of Replication on the Quality-of-Service in Cloud Databases. IEEE Intl. Conference on Software Quality, Reliability, and Security (QRS), 2016.
- D. J. Dubois and G. Casale. OptiSpot: minimizing application deployment cost using spot cloud resources. Cluster Computing, 2016.
- J. F. Perez and G. Casale. Assessing SLA compliance from Palladio component models. Proceedings of the 2nd Workshop on Management of resources and services in Cloud and Sky computing (MICAS), IEEE Press, 2013.