LDES

Methods · Configuration · Shared options · All solvers

The LDES solver is a discrete-event simulator built on the SSJ (Stochastic Simulation in Java) library. It has similar support as JMT in terms of models, but it is lighter and thus tends to run faster. It ships in two engines, a native C++ one and a Java one, both answering the same command line and emitting the same result document; MATLAB and Python drive either as a subprocess over a JSON model file.

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.

LDES methods and aliases
MethodAlgorithm and applicability
defaultOne simulation run of the LDES engine (native common/ldes, falling back to common/ldes.jar).
parallelIndependent replications of the same run, averaged (options.replications, else 8); not a second engine.

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: samples, events, seed, confint, replications, rest_url, timeout.

LDES defaults to samples=2e5. The MATLAB wrapper initially sets lang='java', but prefers the native engine when available and reports the engine that actually ran. The top-level replications overrides config.replications; parallel uses eight replications if the effective count is not greater than one. Pin the shared seed for reproducibility; the LINE default is randomized.

Solver-specific configuration
OptionDefaultDescription and values
cimethod'obm'Confidence-interval estimator: 'obm' (overlapping batch means), 'bm', 'spectral', 'none'.
ciminbatch10Minimum batch size before a CI is reported.
ciminobs100Minimum observations before a CI is reported.
cnvgbatch20Batches collected before convergence is first checked.
cnvgchk0Events between convergence checks; 0 lets the engine choose.
cnvgonfalseStop on achieved precision rather than on the sample budget.
cnvgtol0.05Relative precision that counts as converged.
mserbatch5Batch size of the MSER-5 transient filter.
numthreads[]Worker threads; empty leaves it to the engine.
obmoverlap0.5Overlap fraction of the OBM batches.
replications1Independent replications; above 1 each gets its own RNG stream and the CIs use cross-replication variance.
slotlength1Slot length in model time units when running slotted.
slottedfalseRun on a discrete time scale: every sampled time must land on the slot lattice.
spectrallowfreqfrac0.25Low-frequency fraction retained by the spectral CI estimator.
spectralLowFreqFracsee aboveThe camelCase spelling the JLINE bridge forwards to the Java engine.
tranfilter'mser5'Warm-up detection: 'mser5', 'fixed' (use warmupfrac), or 'none'.
warmupfrac0.2Warm-up fraction discarded by the 'fixed' filter.
nreplicas8Fallback replication count for method='parallel' when the effective replications is not greater than one.
runLengthPlanunsetOptional run-length plan used when estimating confidence intervals from the recorded simulation.

Example

This example demonstrates solving a simple M/M/1 queue using the LDES solver with discrete-event simulation. The engine is available natively in C++ and in Java, the latter built on 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 the LDES engine)
solver = LDES(model, 'samples', 5000, 'seed', 12345);

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

Output:

LDES analysis [method: default; type: approximate, randomized; lang: matlab; env: 2025a] 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
        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; type: approximate, randomized; lang: java; env: 17.0.9] 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 the LDES engine)
solver = LDES(model, samples=5000, seed=12345)

# Display average performance metrics
print(solver.avg_table)

Output:

LDES analysis [method: default; type: approximate, randomized; lang: python; env: 3.13.7] 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