ENV (Environment/Blending Solver)

Methods · Configuration · Shared options · All solvers

The ENV solver analyzes queueing systems operating in random environments with multiple operational stages. The solver uses stage-dependent analysis where system parameters vary according to the current environmental state. Performance metrics are computed as ensemble averages over all environmental stages, enabling modeling of systems subject to external conditions or failures.

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.

ENV methods and aliases
MethodAlgorithm and applicability
defaultAlias of meanfield.
meanfieldMean-field coupling of the stages: only the marginal means cross an environment switch.
meanAlias of meanfield, naming what crosses a switch rather than the limit it comes from.
meancovThe same coupling carrying a covariance beside the mean, seeding the next stage through config.init_qlen/init_qcov.
blendAlias of default/meanfield since 2026-09-13; it named statevec before then.
statevecState-vector coupling: the whole joint distribution crosses a switch (CTMC or MAM stage solvers, finite timespan).
statedepCoupling in which the environment transition depends on the state it leaves.
smpAccepted for a semi-Markov environment, but the arcs are still read as (D0,D1) pairs, so it runs the mean-field coupling on Markovian arcs only.
avgClosed-form fast-environment limit: the stages are averaged instead of iterated.
decClosed-form slow-environment limit: the stages are decoupled and solved separately.

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: iter_max, timespan, init_sol.

ENV defaults to iter_max=100. Configure each stage solver separately. The meancov coupling passes init_qlen and init_qcov to compatible fluid stage solvers. statevec requires CTMC or MAM stages and a finite time horizon. Use config.da for decomposition selection; decomp is a docstring name, not a field read by the code.

Solver-specific configuration
OptionDefaultDescription and values
da'courtois'Decomposition-aggregation algorithm for the coupled CTMC: 'courtois', 'kms' (Koury-McAllister-Stewart), 'takahashi', 'multi' (multigrid).
da_iter10Iterations of the kms and takahashi variants.
decompsee daThe name the ctmc_decompose docstring uses for the same selector; the code reads da.
env_alpha0.01Coupling threshold of the beam search that partitions an environment of more than 10 stages.

Example

This example demonstrates the ENV solver for queueing systems operating in random environments with multiple operational stages. The unique feature of ENV is its ability to analyze systems where parameters vary according to environmental states, computing ensemble averages over all stages.

% Create a simple M/M/1 queue operating in multiple environmental stages
model = Network('ENV Example');

source = Source(model, 'Source');
queue = Queue(model, 'Queue', SchedStrategy.FCFS);
sink = Sink(model, 'Sink');
jobclass = OpenClass(model, 'Class1');

source.setArrival(jobclass, Exp(0.8));
queue.setService(jobclass, Exp(1.0));

P = model.initRoutingMatrix();
P.set(jobclass, jobclass, source, queue, 1.0);
P.set(jobclass, jobclass, queue, sink, 1.0);
model.link(P);

% Solve with environment-aware analysis
ENV(model).avgTable()

Output:

ENV analysis [method: default; type: approximate, deterministic; lang: matlab; env: 2025a] completed in 0.08s.

  Station    JobClass     QLen      Util     RespT     ResidT    ArvR     Tput
   Queue      Class1        4       0.8         5         1      0.8      0.8

Ensemble averaged over environmental stages.
// Create a simple M/M/1 queue operating in multiple environmental stages
Network model = new Network("ENV Example");

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(0.8));
queue.setService(jobclass, new Exp(1.0));

RoutingMatrix P = model.initRoutingMatrix();
P.set(jobclass, jobclass, source, queue, 1.0);
P.set(jobclass, jobclass, queue, sink, 1.0);
model.link(P);

// Solve with environment-aware analysis
new ENV(model).avgTable.print();

Output:

ENV analysis [method: default; type: approximate, deterministic; lang: java; env: 17.0.9] completed.

  Station    JobClass     QLen      Util     RespT     ResidT    ArvR     Tput
    Queue      Class1        4       0.8         5         1      0.8      0.8

Ensemble averaged over environmental stages.
# Create a simple M/M/1 queue operating in multiple environmental stages
from line_solver import *

model = Network("ENV Example")

source = Source(model, "Source")
queue = Queue(model, "Queue", SchedStrategy.FCFS)
sink = Sink(model, "Sink")
jobclass = OpenClass(model, "Class1")

source.set_arrival(jobclass, Exp(0.8))
queue.set_service(jobclass, Exp(1.0))

P = model.init_routing_matrix()
P.set(jobclass, jobclass, source, queue, 1.0)
P.set(jobclass, jobclass, queue, sink, 1.0)
model.link(P)

# Solve with environment-aware analysis
print(ENV(model).avg_table)

Output:

ENV analysis [method: default; type: approximate, deterministic; lang: python; env: 3.13.7] completed.

  Station    JobClass     QLen      Util     RespT     ResidT    ArvR     Tput
    Queue      Class1        4       0.8         5         1      0.8      0.8

Ensemble averaged over environmental stages.