Class SolverLQNS
- Direct Known Subclasses:
LQNS
Network.
On a LayeredNetwork the methods are default, lqns, srvn, exactmva, srvn.exactmva,
sim, lqsim and lqns.default. On a Network they are default and qns, which leave the
multiserver approximation to the default, and qns.conway, qns.rolia, qns.zhou,
qns.suri, qns.reiser and qns.schmidt, which name it. A product-form or open Network
is written as a JMVA document for qnsolver; a closed non-product-form one is
converted by QN2LQN and solved with lqns. This is the arrangement
SolverJMT has for JMVA. The layered table is getLNAvgTable().
SolverLQNS provides integration with the external LQNS (Layered Queueing Network Solver) command-line tool developed at Carleton University. This solver enables high-performance analysis of complex layered queueing networks through native C++ implementations.
Key LQNS integration capabilities:
- External tool integration via command-line interface
- LQN model serialization to LQNS XML format
- High-performance native solver algorithms
- Result parsing and integration back to LINE
- Support for complex software system models
Requirements: This solver requires the 'lqns' and 'lqsim' command-line tools to be installed and available in the system PATH. Tools can be obtained from: http://www.sce.carleton.ca/rads/lqns/
- Since:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classEnhanced LayeredNetworkAvgTable with detailed metrics supportNested classes/interfaces inherited from class jline.solvers.NetworkSolver
NetworkSolver.SolverConfigurator -
Field Summary
Fields inherited from class jline.solvers.NetworkSolver
avgHandles, lastPerctMethod, lastPermEngine, model, sn, tranHandles -
Constructor Summary
ConstructorsConstructorDescriptionSolverLQNS(LayeredNetwork lqnmodel) SolverLQNS(LayeredNetwork lqnmodel, SolverOptions options) SolverLQNS(Network model) A solver for a flat Network, whose method names are the qns ones.SolverLQNS(Network model, Object... varargin) SolverLQNS(Network model, String method) SolverLQNS(Network model, SolverOptions options) -
Method Summary
Modifier and TypeMethodDescriptionstatic SolverOptionsReturns the default solver options for the LQNS solver.getAvg()The station table of a flat Network.protected SolverResultstatic FeatureSetThe feature set on a flat Network (the qns methods).static FeatureSetThe layered feature set: what a layer of a LayeredNetwork may use.The layered model this solver holds, or null for a flat Network.final LayeredNetworkAvgTableThe per-element table of a LayeredNetwork.protected final LayeredNetworkAvgTableBody ofgetLNAvgTable(), split out soLineResultRecordersees what the getter RETURNED.getMethodFeatureSet(String method) The per-method envelope: the Network feature set for the qns methods, and none on a LayeredNetwork, whose gate is the coarse layered test.getProb(int node) Returns marginal state probabilities for a specific node (all states).Returns marginal state probabilities for a specific node and state.getProbAggr(int node) Probability of a SPECIFIC per-class job distribution at a station (current state).getProbAggr(int node, Matrix state_a) Probability of a SPECIFIC per-class job distribution at a station.Returns the logarithm of the normalizing constant of state probabilities.Returns joint state probabilities for the entire system.Returns aggregated joint state probabilities for the entire system.Get raw average tables with detailed metrics for nodes and calls.static booleanTrue if a native lqns binary is available on the PATH.static booleanTrue if a native qnsolver binary is on the PATH (the qns methods on a Network).static booleanTrue if LQNS can run: a native lqns binary is on the PATH.static booleanisQnsMethod(String method) True for "qns" and every "qns.NAME".booleanisStochasticMethod(String method) The lqsim simulator is stochastic; the analytical lqns/srvn methods are deterministic.listValidMethods(Network model) The method names for the model this solver holds: the layered ones on a LayeredNetwork,qnsMethods()on a flat Network.static SolverOptionsThe default options on a flat Network (the former SolverQNS defaults).static SolverOptionsparseNetworkOptions(Object... varargin) Options for a flat Network from name-value pairs: method, multiserver, timespan.parseXMLResults(String filename) static StringWhy the qns methods of SolverLQNS cannot serve a model with immediate feedback, or "" when the model has none.The method names on a flat Network: "default" and "qns" leave the multiserver approximation to the default, "qns.NAME" selects NAME.static StringqnsMultiserver(String method) The multiserver approximation a Network method selects: the part after "qns.", or "default" for "default" and "qns".static StringqnsMultiserverRefusal(NetworkStruct sn, String method) Whether qnsolver's own -m switch offers this multiserver approximation.voidExecutes the solver algorithm to analyze the model.voidrunAnalyzer(SolverOptions options) sample(int node, int numEvents) Samples state trajectories for a specific node.sampleAggr(int node, int numEvents) Samples aggregated state trajectories for a specific node.sampleSys(int numEvents) Samples joint system state trajectories.sampleSysAggr(int numEvents) Samples aggregated joint system state trajectories.booleanCoarse gate.supportsModelMethod(String method) Structural finite-capacity gate.Methods inherited from class jline.solvers.NetworkSolver
aCaT, aCT, aCT, aCT, aCT, aCT, aCT, aIT, aLT, aNCT, aNCT, aNCT, aNCT, aNCT, aNCT, aNT, aNT, aNT, aNT, aNT, aNT, aOT, applyCacheResults, aRLT, aST, aST, aST, aT, aT, aT, aT, aT, aT, avg, avg, avg, avgArvR, avgArvRChain, avgArvRHandles, avgChain, avgChainT, avgChainT, avgChainT, avgChainT, avgChainT, avgChainT, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgChainTable, avgHandles, avgNode, avgNodeArvRChain, avgNodeChain, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainT, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeChainTable, avgNodeQLenChain, avgNodeResidTChain, avgNodeRespTChain, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeT, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTable, avgNodeTputChain, avgNodeUtilChain, avgQLen, avgQLenChain, avgQLenHandles, avgResidT, avgResidTChain, avgResidTHandles, avgRespT, avgRespTChain, avgRespTHandles, avgSys, avgSysRespT, avgSysT, avgSysT, avgSysT, avgSysTable, avgSysTable, avgSysTable, avgSysTput, avgT, avgT, avgT, avgT, avgT, avgT, avgTable, avgTable, avgTable, avgTable, avgTable, avgTable, avgTput, avgTputChain, avgTputHandles, avgUtil, avgUtilChain, avgUtilHandles, avgWaitT, bindingCapacityReason, cacheAvgT, cdfPassT, cdfPassT, cdfRespT, cdfRespT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, checkDeclaredMethod, citations, declaredAllMethods, declaredAllMethods, declaredValidMethods, declaredValidMethods, getAllSolvers, getAvg, getAvg, getAvgArvR, getAvgArvRChain, getAvgArvRHandles, getAvgCacheT, getAvgCacheTable, getAvgCacheTableImpl, getAvgChain, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTableImpl, getAvgChainTableImpl, getAvgHandles, getAvgItemT, getAvgItemTable, getAvgItemTableImpl, getAvgLossT, getAvgLossTable, getAvgNode, getAvgNodeArvRChain, getAvgNodeChain, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTableImpl, getAvgNodeChainTableImpl, getAvgNodeQLenChain, getAvgNodeResidTChain, getAvgNodeRespTChain, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTableImpl, getAvgNodeTableImpl, getAvgNodeTputChain, getAvgNodeUtilChain, getAvgOrbit, getAvgOrbitT, getAvgOrbitTable, getAvgOrbitTableImpl, getAvgQLen, getAvgQLenChain, getAvgQLenHandles, getAvgRegionLossT, getAvgRegionLossTable, getAvgResidT, getAvgResidTChain, getAvgResidTHandles, getAvgRespT, getAvgRespTChain, getAvgRespTHandles, getAvgSys, getAvgSys, getAvgSys, getAvgSysRespT, getAvgSysTable, getAvgSysTable, getAvgSysTable, getAvgSysTableImpl, getAvgSysTput, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTableImpl, getAvgTableImpl, getAvgTput, getAvgTputChain, getAvgTputHandles, getAvgUtil, getAvgUtilChain, getAvgUtilHandles, getAvgWaitT, getCdfPassT, getCdfPassT, getCdfRespT, getCdfRespT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getDeadlineTable, getLibrariesUsed, getModel, getMomentChainT, getMomentChainT, getMomentChainT, getMomentChainTable, getMomentChainTable, getMomentChainTable, getMomentStationT, getMomentStationT, getMomentStationT, getMomentStationTable, getMomentStationTable, getMomentStationTable, getMomentT, getMomentT, getMomentT, getMomentTable, getMomentTable, getMomentTable, getMomentTable, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getPerctRespT, getProbMarg, getProbMarg, getProbSysMarg, getProbSysMarg, getSensitivityT, getSensitivityT, getSensitivityTable, getSensitivityTable, getStageT, getStageT, getStageTable, getStageTable, getSysAvgT, getSysAvgT, getSysAvgT, getTranAvg, getTranCdfPassT, getTranCdfPassT, getTranCdfRespT, getTranCdfRespT, getTranHandles, hasAvgResults, hasBoundedBuffer, hasDistribResults, hasReneging, hasTranResults, initFromSolver, initHandles, itemAvgT, libraries, lossAvgT, mapEnvApprox, mCT, mCT, mCT, model, momentChainT, momentChainT, momentChainT, momentStationT, momentStationT, momentStationT, momentT, momentT, momentT, mST, mST, mST, mT, mT, mT, needsMapEnv, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, options, orbitAvgT, print, prob, prob, probAggr, probAggr, probMarg, probMarg, probNormConstAggr, probSys, probSysAggr, regionLossAvgT, runAnalyzerChecks, sensitivityT, sensitivityT, setAvgHandles, setAvgResults, setDistribResults, setLang, setModel, setTranAvgResults, setTranHandles, setTranProb, showLibraryAttribution, sT, sT, stageT, stageTable, supportsExactSensitivity, sysAvgT, sysAvgT, sysAvgT, tranAvg, tranCdfPassT, tranCdfPassT, tranCdfRespT, tranCdfRespT, tranHandles, unsupportedMethodReasonMethods inherited from class jline.solvers.Solver
getName, getOptions, getResults, hasResults, isJavaAvailable, isStochastic, isValidOption, listValidOptions, parseOptions, parseOptions, reset, resetRandomGeneratorSeed, resolveMethod, selectMethod, setChecks, setOptions, supportsTransientAnalysis, supportsTransientVariance, timeExceeded
-
Constructor Details
-
SolverLQNS
-
SolverLQNS
-
SolverLQNS
A solver for a flat Network, whose method names are the qns ones. Unlike the layered constructors it does not require lqns, which only a closed non-product-form model reaches; the run checks for the binary it needs. -
SolverLQNS
-
SolverLQNS
-
SolverLQNS
-
-
Method Details
-
getLayeredModel
The layered model this solver holds, or null for a flat Network. -
parseNetworkOptions
Options for a flat Network from name-value pairs: method, multiserver, timespan. -
networkDefaultOptions
The default options on a flat Network (the former SolverQNS defaults). -
qnsMethods
The method names on a flat Network: "default" and "qns" leave the multiserver approximation to the default, "qns.NAME" selects NAME. -
isQnsMethod
True for "qns" and every "qns.NAME". -
qnsMultiserver
The multiserver approximation a Network method selects: the part after "qns.", or "default" for "default" and "qns". -
getLayeredFeatureSet
The layered feature set: what a layer of a LayeredNetwork may use.- Returns:
- the feature set supported on the layered path
-
getFeatureSet
The feature set on a flat Network (the qns methods). The layered path isgetLayeredFeatureSet(). -
isAvailable
public static boolean isAvailable()True if LQNS can run: a native lqns binary is on the PATH. LINE never runs LQNS from a container image, because its licence is an evaluation agreement that forbids redistribution, so the binary must be one the user installed. To exercise a containerised build in the test suite, put a shim on the PATH withrun-tests.sh --lqns-docker. -
hasNativeLqns
public static boolean hasNativeLqns()True if a native lqns binary is available on the PATH. -
hasQnsolver
public static boolean hasQnsolver()True if a native qnsolver binary is on the PATH (the qns methods on a Network). -
getAvg
- Overrides:
getAvgin classNetworkSolver
-
getAvgTable
The station table of a flat Network. A LayeredNetwork is not indexed by station, so its table isgetLNAvgTable().- Overrides:
getAvgTablein classNetworkSolver- Returns:
- table containing station-level metrics for each class
-
getLNAvgTable
The per-element table of a LayeredNetwork. -
getLNAvgTableImpl
Body ofgetLNAvgTable(), split out soLineResultRecordersees what the getter RETURNED. The JAVA cross-codebase parity row is measured from that rather than from what an example printed. -
getEnsembleAvg
-
getStruct
-
listValidMethods
-
listValidMethods
The method names for the model this solver holds: the layered ones on a LayeredNetwork,qnsMethods()on a flat Network. A non-null argument asks about that Network instead. -
parseXMLResults
- Throws:
IOException
-
runAnalyzer
Description copied from class:SolverExecutes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.- Specified by:
runAnalyzerin classSolver- Throws:
IllegalAccessException- if access to required resources is deniedParserConfigurationException- if XML parsing configuration fails
-
runAnalyzer
public void runAnalyzer(SolverOptions options) throws IllegalAccessException, ParserConfigurationException -
isStochasticMethod
The lqsim simulator is stochastic; the analytical lqns/srvn methods are deterministic.- Overrides:
isStochasticMethodin classSolver- Parameters:
method- the method name to classify- Returns:
- true if the method returns stochastic estimates
-
supports
Coarse gate. On a flat Network it tests the model againstgetFeatureSet(); on a LayeredNetwork each layer againstgetLayeredFeatureSet(). -
getMethodFeatureSet
The per-method envelope: the Network feature set for the qns methods, and none on a LayeredNetwork, whose gate is the coarse layered test.- Overrides:
getMethodFeatureSetin classSolver- Parameters:
method- the concrete method name- Returns:
- the per-method FeatureSet, or null
-
supportsModelMethod
Structural finite-capacity gate.On a LayeredNetwork the gate refuses the qns names, which need a flat Network, and otherwise applies the coarse layered test.
On a Network: NOTHING on the qnsolver path reads sn.cap or sn.classcap -- the model is written out for
qnsolver, whose MVA-family algorithms have no representation of a finite buffer -- so a capped station was solved as an unbounded one and the table reported the unconstrained answer under this solver's name. There is no registry feature name for plain capacity, hence the structural test; SolverMVA, SolverNC, SolverAG and SolverFluid gate the same way through the same helper.Without it SolverAUTO.listValidMethods offered all eight qns method names on the BAS-blocking model of cqn_bas_blocking.
- Overrides:
supportsModelMethodin classSolver- Parameters:
method- the concrete method name- Returns:
- empty string if supported, else the offending reason
-
qnsImmfeedRefusal
Why the qns methods of SolverLQNS cannot serve a model with immediate feedback, or "" when the model has none.Immediate feedback (sn.immfeed) keeps a self-looping job on its server instead of re-queueing it, and neither qns path can state that: the JMVA document qnsolver reads carries a mean demand and a visit count per chain, and the LQN QN2LQN writes turns the routing into OR-fork precedences of pseudo-activities on the reference task, where a repeated visit is a new call. Either would answer for re-queueing under this solver's name.
ONE PREDICATE, TWO CALLERS:
supportsModelMethod(java.lang.String)(the gate, hence model.help and SolverAUTO) andrunAnalyzer()(the run, for a caller with enableChecks off). SolverJMT keeps its own wording in jmtMethodRefusal. Mirrors matlab/src/solvers/wrappers/LQNS/qns_immfeed_refusal.m.- Parameters:
sn- the network struct- Returns:
- the refusal, or "" when the model carries no immediate feedback
-
qnsMultiserverRefusal
Whether qnsolver's own -m switch offers this multiserver approximation.THE RULE IS INSIDE THE MULTISERVER BRANCH, and that is not a detail. Without a multiserver station the reference emits no -m at all and answers under the caller's method name, so refusing "suri" there would refuse a model this solver does solve.
"qnsolver -m" accepts conway, reiser, rolia and zhou. "suri" and "schmidt" are LQNS approximations, reachable only on the non-product-form closed lqns branch, and qnsolver has no flag for either. Mirrors matlab/src/solvers/wrappers/LQNS/qns_multiserver_refusal.m and the C++ is_qnsolver_multiserver.
- Parameters:
sn- the network structmethod- the multiserver approximation, i.e.qnsMultiserver(java.lang.String)of the method- Returns:
- the refusal, or "" when the pair is served
-
getRawAvgTables
Get raw average tables with detailed metrics for nodes and calls. This method provides more detailed metrics than getAvgTable(), including phase-specific utilization and service times, processor metrics, and call waiting times. Returns two tables aligned with MATLAB's getRawAvgTables: - NodeAvgTable: Node, NodeType, Utilization, Phase1Utilization, Phase2Utilization, Phase1ServiceTime, Phase2ServiceTime, Throughput, ProcWaiting, ProcUtilization - CallAvgTable: SourceNode, TargetNode, Type, Waiting- Returns:
- Array containing [NodeAvgTable, CallAvgTable] with detailed metrics
-
defaultOptions
Returns the default solver options for the LQNS solver.- Returns:
- Default solver options with SolverType.LQNS
-
getProbNormConstAggr
Description copied from class:NetworkSolverReturns the logarithm of the normalizing constant of state probabilities. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbNormConstAggrin classNetworkSolver- Returns:
- result containing the log normalizing constant
-
getProb
Description copied from class:NetworkSolverReturns marginal state probabilities for a specific node and state. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbin classNetworkSolver- Parameters:
node- the node index for which to compute probabilitiesstate- the state vector to query (optional, null for all states)- Returns:
- result containing marginal state probabilities
-
getProb
Description copied from class:NetworkSolverReturns marginal state probabilities for a specific node (all states). This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbin classNetworkSolver- Parameters:
node- the node index for which to compute probabilities- Returns:
- result containing marginal state probabilities
-
getProbSys
Description copied from class:NetworkSolverReturns joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbSysin classNetworkSolver- Returns:
- result containing joint state probabilities
-
getProbAggr
Description copied from class:NetworkSolverProbability of a SPECIFIC per-class job distribution at a station. Returns P(n1 jobs of class 1, n2 jobs of class 2, ...) for given state.Compare with
NetworkSolver.getProbMarg(int, int, jline.util.matrix.Matrix): returns queue-length distribution for a single class, i.e., P(n jobs of class r) for n=0,1,...,N(r).- Overrides:
getProbAggrin classNetworkSolver- Parameters:
node- the node index for which to compute probabilitiesstate_a- per-class job counts, e.g., [2,1] = 2 class-1, 1 class-2- Returns:
- scalar probability in [0,1]
-
getProbAggr
Description copied from class:NetworkSolverProbability of a SPECIFIC per-class job distribution at a station (current state). Returns P(n1 jobs of class 1, n2 jobs of class 2, ...).Compare with
NetworkSolver.getProbMarg(int, int, jline.util.matrix.Matrix): returns queue-length distribution for a single class, i.e., P(n jobs of class r) for n=0,1,...,N(r).- Overrides:
getProbAggrin classNetworkSolver- Parameters:
node- the node index for which to compute probabilities- Returns:
- scalar probability in [0,1]
-
getProbSysAggr
Description copied from class:NetworkSolverReturns aggregated joint state probabilities for the entire system. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
getProbSysAggrin classNetworkSolver- Returns:
- result containing aggregated joint state probabilities
-
sample
Description copied from class:NetworkSolverSamples state trajectories for a specific node. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
samplein classNetworkSolver- Parameters:
node- the node index to sample fromnumEvents- the number of events to sample- Returns:
- result containing sampled state trajectories
-
sampleAggr
Description copied from class:NetworkSolverSamples aggregated state trajectories for a specific node. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
sampleAggrin classNetworkSolver- Parameters:
node- the node index to sample fromnumEvents- the number of events to sample- Returns:
- result containing sampled aggregated state trajectories
-
sampleSys
Description copied from class:NetworkSolverSamples joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
sampleSysin classNetworkSolver- Parameters:
numEvents- the number of events to sample- Returns:
- result containing sampled joint system state trajectories
-
sampleSysAggr
Description copied from class:NetworkSolverSamples aggregated joint system state trajectories. This is an abstract method that must be implemented by concrete solver subclasses.- Overrides:
sampleSysAggrin classNetworkSolver- Parameters:
numEvents- the number of events to sample- Returns:
- result containing sampled aggregated joint system state trajectories
-