io.+jlinebridge

class jlinebridge.Solvers

JAR solver construction and options marshalling (lang=’java’), and the bridge’s refusals. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static SolverAG(network_object, options)

The agent-based (RCAT) solver. Its options carry the truncation level of an open agent and the execution backend, neither of which SolverOptions(‘MAM’) has, so it builds AGOptions rather than the generic container.

static SolverAuto(network_object, options)
static SolverBA(network_object, options)
static SolverCTMC(network_object, options)
static SolverFluid(network_object, options)
static SolverJMT(network_object, options)
static SolverLDES(network_object, options)

Create LDES-specific options object

static SolverLN(layered_network_object, options, layerSolverType)

LN = SOLVERLN(LAYERED_NETWORK_OBJECT, OPTIONS, LAYERSOLVERTYPE)

LAYERSOLVERTYPE is the JAR SolverType of the LAYER solvers the caller asked for. Without it the JAR falls back to its own DefaultSolverFactory, which is SolverMVA at every layer, so LN(model, @(l)NC(l,…)) under lang=’java’ silently answered with MVA layers – the same defect the python bridge carries a fix for in PYLINE.SolverLN. The layer solver is what the fixed point is a fixed point OF, so substituting one answers a different question.

static SolverLQNS(network_object, options)

A flat Network, solved by the JAR SolverLQNS through its qns methods.

static SolverMAM(network_object, options)
static SolverMVA(network_object, options)
static SolverNC(network_object, options)
static SolverSSA(network_object, options)
static StreamingOptions(varargin)

STREAMINGOPTIONS Create Java StreamingOptions for SSA/LDES stream() method

@brief Creates StreamingOptions for streaming simulation metrics

@param varargin Name-value pairs for options:

‘transport’ - ‘http’ (recommended) or ‘grpc’ (default: ‘http’) ‘endpoint’ - Receiver endpoint (default: ‘localhost:8080/metrics’ for HTTP) ‘mode’ - ‘sampled’ or ‘time_window’ (default: ‘sampled’) ‘sampleFrequency’ - Push every N events in sampled mode (default: 100) ‘timeWindowSeconds’ - Window duration in time_window mode (default: 1.0) ‘serviceName’ - Service identifier (default: ‘line-stream’) ‘includeQueueLength’ - Include queue length metrics (default: true) ‘includeUtilization’ - Include utilization metrics (default: true) ‘includeThroughput’ - Include throughput metrics (default: true) ‘includeResponseTime’ - Include response time metrics (default: true) ‘includeArrivalRate’ - Include arrival rate metrics (default: true)

@return streamOpts Java StreamingOptions object

Example: @code streamOpts = JLINE.StreamingOptions(‘transport’, ‘http’, ‘sampleFrequency’, 50); @endcode

static applyConfig(solverOptions, config, solverName, handled)

APPLYCONFIG(SOLVEROPTIONS, CONFIG, SOLVERNAME, HANDLED) Set every options.config key whose value differs from the MATLAB default on the JAR options, through jline.solvers.ConfigValidator, which places it by the schema java column (typed Config field, additionalParams entry, or an options field such as LDESOptions.numThreads) and refuses what the JAR does not implement. HANDLED names the keys the caller already translated by hand. Internal keys are LINE plumbing the JAR recomputes, so they never cross.

static configValue(v, nm, typed)

JV = CONFIGVALUE(V, NM, TYPED) A MATLAB config value in a form ConfigValidator converts. A scalar bound for an untyped additionalParams entry crosses as text, which ConfigValidator reads as the schema default’s type (Integer, Double).

static getFeatureSet()

FEATSUPPORTED = GETFEATURESET()

static getSymbolicGenerator(ctmc, invertSymbol)

[INFGEN, EVENTFILT, SYNCINFO, STATESPACE, NODESTATESPACE] = GETSYMBOLICGENERATOR(CTMC, INVERTSYMBOL) Symbolic infinitesimal generator of a JLINE SolverCTMC object, with each event filtration normalized by its minimum positive rate and scaled by a symbolic variable x1..xE, as in the native SolverCTMC.getSymbolicGenerator. Coefficient matrices are computed by the JAR; symbolic objects are rebuilt with the Symbolic Toolbox.

static get_jar_location()

Get jline.jar location, downloading if necessary. Re-checks on each call, so deleted JAR triggers re-download. Treats lang=’java’ as a wrapper that auto-downloads jline.jar if absent.

static javaUnsupported(solverName, method, reason)

JAVAUNSUPPORTED(SOLVERNAME, METHOD, REASON) Refuse a getter this bridge cannot serve, naming the getter and the reason. The twin of CPPLINE.CPPUNSUPPORTED and PYLINE.PYUNSUPPORTED, in the same words: all three bridges refuse alike, so a caller (and the parity harness, which tells a refusal from a crash by the sentence) reads one contract and not three.

static lnLayerSolverType(solver)

LAYERSOLVERTYPE = LNLAYERSOLVERTYPE(SOLVER) Resolve the JAR SolverType of the layer solver a MATLAB SolverLN was built with, refusing anything the JAR has no layer factory for. Empty means “no factory recorded”, i.e. the caller kept the default and the JAR may keep its own. The factory is probed on a throwaway network, the same resolution CPPLINE.lnLayerSolver and PYLINE.lnLayerSolverName perform: under lang=’java’ no MATLAB layer is constructed, so there is no self.solvers to read it off.

static parseSolverOptions(solverOptions, options, solverName)

SOLVEROPTIONS = PARSESOLVEROPTIONS(SOLVEROPTIONS, OPTIONS, SOLVERNAME) Copy a MATLAB options struct onto a JAR SolverOptions. SOLVERNAME (‘MVA’, ‘LN’, …) selects the MATLAB defaults that config keys are compared against when deciding what crosses (JLINE.applyConfig).

static runFluidAnalyzer(network, options)

RUNFLUIDANALYZER Run JLINE fluid analyzer and return results

[QN, UN, RN, TN, CN, XN, T, QNT, UNT, TNT, XVEC] = JLINE.runFluidAnalyzer(NETWORK, OPTIONS)

Runs the JLINE fluid solver on the given network and converts results back to MATLAB data structures.

Input:

network - LINE Network model options - Solver options structure with fields:

.method - solver method .stiff - use stiff ODE solver

Output:

QN, UN, RN, TN - Steady-state metrics [M x K] CN, XN - System metrics [1 x K] t - Time vector [Tmax x 1] QNt, UNt, TNt - Transient metrics {M x K} cells xvec - State vector structure

static supports(model)

[BOOL, FEATSUPPORTED] = SUPPORTS(MODEL)

class jlinebridge.Result

JAR results back into MATLAB: the sn/lsn structs, average tables, events and sample paths. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static arrayListToResults(alist)
static convertSampleResult(jresult)

CONVERTSAMPLERESULT Convert Java sample result to MATLAB struct

@brief Converts Java SampleNodeState to MATLAB structure

@param jresult Java SampleNodeState object @return result MATLAB struct with fields: t, state, isaggregate

static eventFromJava(jev)

EV = EVENTFROMJAVA(JEV) build the MATLAB Event of a jline.lang.Event.

The Java and MATLAB EventType numberings disagree (Java ordinals start at INIT = 0, MATLAB at INIT = -1), so the two are matched by NAME, as the rest of the codebase does. Every member of the Java enum is listed: an unmapped one must raise rather than leave the synchronization silently unassigned.

static from_jline_struct(jnetwork, jsn)

lst and rtfun are not implemented Due to the transformation of Java lambda to matlab function

static from_jline_struct_layered(jlayerednetwork, jlsn)

JLINE indexes LayeredNetworkStruct elements from 0 and carries no padding row or column; MATLAB indexes them from 1. This is the only seam between the two conventions, so every element index crossing it is shifted by one here: map keys are looked up at key-1, and index VALUES (parent, callpair, tasksof/entriesof/actsof/callsof) come back +1. Java’s -1 “unset” parent becomes MATLAB’s 0. See _kb/04-networkstruct.md and _kb/07-cross-language-parity.md.

class jlinebridge.Process

Distributions, signal removal and function handles (rewards, PAS, class dependence) to and from their JAR forms. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static call_java_cdscaling(jfun, ni)

CALL_JAVA_CDSCALING Call a Java SerializableFunction for class dependence

Converts a MATLAB vector to a Java Matrix and calls the Java function’s apply() method.

@param jfun Java SerializableFunction<Matrix, Double> object @param ni MATLAB vector representing the state (jobs per class) @return result The scaling factor returned by the Java function

static enumerate_states(handle, serfun, maxPop, currentState, classIdx)

ENUMERATE_STATES Recursively enumerate all state combinations

@param handle MATLAB function handle @param serfun Java PrecomputedCDFunction object to populate @param maxPop Maximum population per class @param currentState Current state being built @param classIdx Current class index being enumerated

static from_jline_distribution(jdist)
static from_jline_signal_removal(jclass)

FROM_JLINE_SIGNAL_REMOVAL Read back a JAR signal’s batch-removal distribution and policy for the MATLAB signal constructors.

static from_line_distribution(line_dist)
static from_line_signal_removal(line_class)

FROM_LINE_SIGNAL_REMOVAL Marshal a signal class’s batch-removal distribution and removal policy. Returns empties when the class uses the defaults (remove exactly 1, RANDOM policy), so callers can keep using the short JAR constructors in that case.

static handle_to_serializablefun(handle, sn)

HANDLE_TO_SERIALIZABLEFUN Convert MATLAB function handle to Java SerializableFunction

Pre-computes the function values for all possible state combinations and creates a Java PrecomputedCDFunction object.

@param handle MATLAB function handle that takes a vector ni and returns a scalar @param sn Network struct containing njobs (population per class) @return serfun Java PrecomputedCDFunction object

static pas_enumerate_seqs(handle, serfun, nclasses, cap, prefix)

PAS_ENUMERATE_SEQS Recursively enumerate ordered class sequences (1-based, length 1..cap) and store mu(prefix) under the matching 0-based key expected by the JAR.

static pas_handle_to_serializablefun(handle, nclasses, cap)

PAS_HANDLE_TO_SERIALIZABLEFUN Convert a PAS service rate function mu(c) (MATLAB handle of the ordered class list) to a Java SerializableFunction by pre-computing mu over every ordered prefix up to the queue capacity.

The JAR queries mu(c) with the ordered prefix as a row vector of 0-based class indices (jline.lang.state.AfterEventStation), and the PrecomputedRateFunction keys on the stringified vector, so values are stored under the matching 0-based key.

@param handle MATLAB mu(c) handle taking a 1-based ordered class list @param nclasses Number of classes @param cap Station capacity (max ordered-list length) @return serfun Java PrecomputedCDFunction

static reward_enum_capped(M, caps, budget)

REWARD_ENUM_CAPPED All integer row vectors v (1 x M) with 0 <= v(i) <= caps(i) and sum(v) <= budget.

static reward_handle_to_tabulatedfun(rewardFn, sn)

REWARD_HANDLE_TO_TABULATEDFUN Convert a MATLAB reward function handle to a Java TabulatedRewardFunction by pre-computing its value over an enumerable superset of the aggregated state space.

The domain per class r is: all per-station count vectors with sum <= njobs(r) for closed classes, and per-station counts capped by classcap(i,r) (or the default CTMC cutoff of 100 when infinite) for open classes. The JAR reward analyzer evaluates the function only on reachable stateSpaceAggr rows, which are a subset of this domain; unseen states raise a descriptive error.

@param rewardFn MATLAB reward handle @(state) or @(state, sn) @param sn Network struct @return jfun Java jline.lang.reward.TabulatedRewardFunction

class jlinebridge.Model

Network <-> jline.lang.Network: nodes, classes, service and routing, plus workflows and random environments. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static from_jline_class(jclass, model)

Check signal classes first (their base classes would match below)

static from_jline_node(jline_node, model, job_classes)
static from_jline_routing(model, jnetwork)
static from_line_class(line_class, jnetwork)

Check signal classes first (before their base classes)

static from_line_environment(line_env)

Convert a MATLAB Environment to a JAR Environment.

static from_line_network(model)

w = warning; warning(‘off’);

static from_line_node(line_node, jnetwork, ~, forkNode, sn)

Handle optional sn argument

static from_line_workflow(line_wf)

Convert a MATLAB Workflow to a JAR Workflow.

static is_custom_handle(funCell, e, h, defaultStr)

IS_CUSTOM_HANDLE True if funCell{e,h} is a function handle that differs from the given identity default (whitespace-insensitive func2str comparison).

static jline_to_line(jnetwork)

True when jline_to_line restores the routing with link(rtorig). State-dependent routing (RROBIN, WRROBIN, JSQ, SQ) cannot go through link(P), which overwrites every strategy with PROB, and a model with no rtorig was never linked in the first place.

static line_to_jline(model)
static set_csMatrix(line_node, jnode, jclasses)
static set_delayoff(line_node, jnode, job_classes)

Transfer setup and delayoff times from MATLAB Queue to Java Queue

static set_derived_routing(jrt_matrix, jclasses, jnodes, sn, connections, matlab2java_node_idx, i, k)

Routing entries for a (node,class) pair whose strategy the JAR DERIVES from its connection matrix rather than from declared probabilities: RAND, JSQ and SQ.

link() builds that connection matrix out of the entries it is given and nothing else, so a pair contributing none leaves the node with NO outgoing arc: getRoutingMatrix then writes an all-zero row for it and every solver reads the model as degenerate – an empty AvgTable, or the whole closed population parked at one station. The probabilities are MATLAB’s own resolution (sn.rtnodes), which already excludes the Sink for a closed class and routes nothing out of a Source; the JAR re-derives the same uniform split once the strategy is re-declared after link().

static set_line_service(jline_node, line_node, job_classes, line_classes)
static set_service(line_node, jnode, job_classes)
static to_jline_sched_strategy(schedId)

Convert MATLAB SchedStrategy id to jline SchedStrategy enum

class jlinebridge.Matrix

MATLAB matrices <-> jline.util.matrix.Matrix and Java collections. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static arraylist_to_matrix(jline_matrix)
static from_jline_matrix(jline_matrix)
static from_jline_matrix_list(jlist)

java.util.List<Matrix> -> 1-by-n cell of double matrices

static from_jline_matrixcell(jcell)

jline.util.matrix.MatrixCell -> 1-by-n cell of double matrices

static from_line_matrix(matrix)
static shift_idx(idxs)

Convert JLINE 0-based element (or call) indices to MATLAB 1-based ones. Java marks “unset” with -1, which MATLAB spells as 0, so the same +1 carries both. An empty input stays empty.

class jlinebridge.Layered

LayeredNetwork -> jline.lang.layered.LayeredNetwork. Part of the JLINE facade.

Copyright (c) 2012-2026, Imperial College London All rights reserved.

Method Summary
static from_line_layered_network(line_layered_network)
static from_line_lqn_dist(ptype, dmean, dscv, dparams, dproc)

JDIST = FROM_LINE_LQN_DIST(PTYPE, DMEAN, DSCV, DPROC) Rebuild a JAR distribution from the LayeredNetworkStruct fields of an LQN distribution, keeping its variability. Passing the mean alone to a setSomething(double) overload rebuilds it as Exp(1/mean) with SCV 1, which silently discards everything above the first moment: an Erlang setup and an exponential one of the same mean would reach the JAR as the same process.

static set_layered_lincon(jelem, sn, eidx)

SET_LAYERED_LINCON(JELEM, SN, EIDX)

Admission constraint A*n <= b of a Host or a Task. SN.LINCON holds the resolved positional form, columns in the tasksof/entriesof order that the JAR uses as well, so the named rows of ADDCONSTRAINT cross already merged into A.

static set_layered_pools(jelem, sn, eidx)

SET_LAYERED_POOLS(JELEM, SN, EIDX)

Heterogeneous server pools of a Host or a Task. SN.POOLS{EIDX} holds the resolved compatibility matrix, columns in the tasksof/entriesof order, so each pool crosses with its operands BY NAME and the JAR resolves them again in its own getStruct.

static set_layered_rate_dependence(jelem, sn, eidx)

SET_LAYERED_RATE_DEPENDENCE(JELEM, SN, EIDX)

Load dependence is a numeric vector and crosses to the JAR; the class- and joint-dependent scalings are MATLAB function handles with no Java counterpart, so they are refused rather than dropped.