LDES (LINE Discrete Event Simulator)
The LDES solver is a discrete-event simulator implemented using the SSJ (Stochastic Simulation in Java) library in the JAR backend. It has similar support as JMT in terms of models, but it is lighter and thus tends to run faster. Both MATLAB and Python call the JAR backend via subprocess.
| Method | Algorithm | Reference |
|---|---|---|
default | Discrete-event simulation (SSJ in JAR) | — |
Key Options
| Option | Values | Default | Description |
|---|---|---|---|
samples | integer | 200,000 | Maximum service completion events to simulate |
seed | integer | 23000 | Random seed; use -1 for a random seed |
tranfilter | mser5, fixed, none | mser5 | Warmup detection method. mser5 uses the MSER-5 adaptive algorithm; fixed discards a fixed fraction (see warmupfrac) |
warmupfrac | 0.0–1.0 | 0.20 | Fraction of events discarded as warmup when tranfilter=fixed |
cimethod | obm, bm, spectral, none | obm | Confidence interval method. obm = overlapping batch means; bm = non-overlapping batch means; spectral = Heidelberger–Welch spectral analysis (log-periodogram regression at low frequencies, accounts for batch autocorrelation, gives wider but more honest CIs) |
obmoverlap | 0.0–1.0 | 0.50 | Batch overlap fraction for cimethod=obm |
cnvgon | boolean | false | Stop early when CI half-width / mean falls below cnvgtol for all metrics |
cnvgtol | 0.0–1.0 | 0.05 | Relative precision threshold for convergence stopping (5% by default) |
replications | integer | 1 | Number of independent parallel replications; when >1 uses cross-replication variance for CIs |
Example
This example demonstrates solving a simple M/M/1 queue using the LDES solver with discrete-event simulation. LDES is primarily implemented in the JAR backend using the SSJ (Stochastic Simulation in Java) library.
% 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 LDES (via JAR backend)
solver = LDES(model, 'samples', 5000, 'seed', 12345);
% Display average performance metrics
LDES(model).avgTable()
Output:
LDES analysis [method: default, lang: matlab] completed.
ans =
2×8 table
Station JobClass QLen Util RespT ResidT ArvR Tput
_______ ________ ______ _______ ______ ______ _______ _______
Source Class1 0 0 0 0 0 0.89856
Queue1 Class1 8.2105 0.88742 9.1954 9.1954 0.89856 0.89315
import jline.lang.*;
import jline.lang.constant.SchedStrategy;
import jline.lang.nodes.*;
import jline.lang.processes.Exp;
import jline.solvers.NetworkAvgTable;
import jline.solvers.ldes.LDES;
public class LDESExample {
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 LDES (LINE Discrete Event Simulator)
LDES solver = new LDES(model);
solver.options.samples = 5000;
solver.options.seed = 12345;
// Display average performance metrics
NetworkAvgTable avgTable = solver.avgTable;
System.out.println(avgTable);
}
}
Output:
LDES analysis [method: default, lang: java] completed. Station JobClass QLen Util RespT ResidT ArvR Tput Source Class1 0.0 0.0 0.0 0.0 0.0 0.89856 Queue1 Class1 8.2105 0.88742 9.1954 9.1954 0.89856 0.89315
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 LDES (via JAR backend)
solver = LDES(model, samples=5000, seed=12345)
# Display average performance metrics
print(solver.avg_table)
Output:
LDES analysis [method: default, lang: python] completed. Station JobClass QLen Util RespT ResidT ArvR Tput 0 Source Class1 0.0 0.0 0.0 0.0 0.0 0.89856 1 Queue1 Class1 8.2105 0.88742 9.1954 9.1954 0.89856 0.89315