LINE Solver for Python
The Python version of the LINE solver for queueing models.
Installation
Requires Python 3.11 or later.
pip install line-solver
To install from source, run pip install . in this folder. Then run line-install to check optional dependencies such as Java and the symbolic backend (it only warns, never fails).
Quick start
The tutorials ship with the package and run from any directory:
python3 -m line_solver.examples.gettingstarted.tut01_mm1_basics
From a source checkout, python3 mm1.py solves an M/M/1 queue at 50% utilization and prints:
Station JobClass QLen Util RespT ResidT ArvR Tput
Source Class1 0 0 0 0 0 1
Queue Class1 1 0.5 1 1 1 1
You can also open mm1.ipynb in Jupyter. More tutorials are in examples/gettingstarted/.
Documentation
See the Python manual. The syntax closely mirrors the MATLAB version: compare the examples/gettingstarted/ scripts of the two.
Choosing the engine (lang=)
Every solver takes a lang keyword that selects which engine does the work. The model code stays the same:
MVA(model).avg_table() # native Python (default)
MVA(model, lang="java").avg_table() # Java engine (jline.jar)
MVA(model, lang="cpp").avg_table() # C++ engine (line-cli)
lang |
Needs | Solvers |
|---|---|---|
"python" |
nothing | all |
"java" |
a Java runtime | all |
"cpp" |
the line-cli binary |
MVA, NC, CTMC, MAM, FLD, SSA, BA, AG, AUTO, JMT, LN (steady state), ENV |
- Java: the JAR is taken from
$LINE_JLINE_JAR, the installed package or a checkout'scommon/, and downloaded automatically if none is found. - C++: the binary is taken from
$LINE_CLI_BINARY, a checkout'scommon/orcpp/build/, orPATH, and downloaded automatically (Linux x86-64) if none is found. From a source checkout you can instead build it withcmake -S cpp -B cpp/build -DCMAKE_BUILD_TYPE=Release && cmake --build cpp/build --target line-cli. It also acceptsarith="exact"orarith="real:<digits>"(16, 32, 64, 128 or 256 digits) for exact or extended-precision arithmetic.
Set LINE_SOLVER_LANG=java (or cpp) to change the default for a session. If the C++ binary cannot be found or run, LINE falls back to native Python with a warning; any other error, including a missing Java runtime for lang="java", is raised.
Symbolic backend (optional)
Symbolic analysis in SolverCTMC and SolverFLD runs on a SageMath service, falling back on sympy when it is not available. To enable it, pull its Docker image once:
docker pull imperialqore/line-sage-rest:latest
LINE then starts and stops the container automatically.
License
Released under the BSD-3 license.
Metadata
Release files for line-solver 3.0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| line_solver-3.0.9.0-py3-none-any.whl | Python 3 | none | any | Details for line_solver-3.0.9.0-py3-none-any.whl |
Release files / line_solver-3.0.9.0-py3-none-any.whl
| Download URL | line_solver-3.0.9.0-py3-none-any.whl |
|---|---|
| Size | 12.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc676bee2244b82f0e9f1fe0eeb1d775cabb5f12477d4cc44858a3071ce601f8
|
|
BLAKE2b-256 checksum How to use checksums |
fb5236115fee9dcba45b47b5827e1263792a1395ae44c0a5b90750e23ebfdc7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.1 CPython/3.12.16 Linux/6.8.0-138-generic
|
Security for line-solver 3.0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.