Class SolverDES

  • All Implemented Interfaces:

    
    public class SolverDES
    extends NetworkSolver
                        
    Since:

    1.0

    Author:

    QORE Lab, Imperial College London

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      LayeredNetwork getLNModel() Returns the LayeredNetwork model (if solving an LQN).
      Collector getStream() Returns the current streaming collector, or null if not streaming.
      ExecutorService getThreadPool() Returns the thread pool for parallel replication execution.
      int getNumThreads() Returns the number of threads for parallel execution.
      void setNumThreads(int numThreads) Sets the parallelism level for replication execution.
      static FeatureSet getFeatureSet() Returns the feature set supported by the DES solver.
      NetworkStruct getStruct() Returns the network structure for this solver.
      void getTranAvg() Performs a transient analysis of the model using discrete event simulation.
      SolverResult getAvg() Computes and returns average station metrics at steady-state.
      List<String> listValidMethods() Returns the list of valid solution methods for DES.
      List<String> listValidMethods(Network model) Returns the list of valid solution methods for DES.
      void runAnalyzer() Executes the solver algorithm to analyze the model.
      SolverResult runMethodSpecificAnalyzer() Run the DES analyzer with current options including init_sol.
      boolean supports(Network model) Checks if this solver supports the given network model.
      boolean supports(LayeredNetwork model) Checks if the solver supports the given LayeredNetwork model.
      static FeatureSet getLNFeatureSet() Returns the feature set supported by the DES solver for LayeredNetwork models.
      LayeredNetworkStruct getLNStruct() Returns the LayeredNetworkStruct (if solving an LQN).
      LayeredNetworkAvgTable getLNAvgTable() Returns average metrics for a LayeredNetwork model as a table.
      static SolverOptions defaultOptions() Returns the default solver options for the DES solver.
      Ret.SampleResult sample(StatefulNode node, int numSamples) Generates a sample path (state trajectory) for a specific node using DES transient simulation.
      Ret.SampleResult sampleAggr(StatefulNode node, int numSamples) Generates an aggregated sample path for a specific node.
      Ret.SampleResult sampleSys(int numSamples) Generates a system-wide sample path (state trajectory) for all stateful nodes.
      Ret.SampleResult sampleSysAggr(int numSamples) Generates an aggregated system-wide sample path for all stateful nodes.
      Ret.SampleResult stream(StatefulNode node, StreamingOptions streamingOptions) Generates a sample path with streaming metrics pushed via OTLP.
      Ret.SampleResult stream(StatefulNode node, int numSamples, StreamingOptions streamingOptions) Generates a sample path with streaming metrics pushed via OTLP.
      Ret.SampleResult streamAggr(StatefulNode node, StreamingOptions streamingOptions) Generates an aggregated sample path with streaming metrics pushed via OTLP.
      Ret.SampleResult streamAggr(StatefulNode node, int numSamples, StreamingOptions streamingOptions) Generates an aggregated sample path with streaming metrics pushed via OTLP.
      Ret.ProbabilityResult getProb(StatefulNode node, Matrix state) Estimates the steady-state probability of a specific state at a node via DES simulation.
      Ret.ProbabilityResult getProb(int nodeIndex, Matrix state) Estimates state probability using node index.
      Ret.ProbabilityResult getProb(StatefulNode node) Estimates state probability using current network state.
      Ret.ProbabilityResult getProbAggr(StatefulNode node, Matrix stateAggr) Estimates the steady-state probability of a specific aggregated (per-class) state at a node.
      Ret.ProbabilityResult getProbAggr(int nodeIndex, Matrix stateAggr) Estimates aggregated state probability using node index.
      Ret.ProbabilityResult getProbAggr(StatefulNode node) Estimates aggregated state probability using current network state.
      Ret.ProbabilityResult getProbSys() Estimates the joint steady-state probability of the entire system state via DES simulation.
      Ret.ProbabilityResult getProbSysAggr() Estimates the joint steady-state probability of the entire aggregated system state.
      Ret.DistributionResult getTranCdfRespT() Returns cumulative distribution functions of response times during transient analysis.
      Ret.DistributionResult getTranCdfRespT(AvgHandle R) Returns cumulative distribution functions of response times during transient analysis.
      Ret.DistributionResult getTranCdfPassT() Returns cumulative distribution functions of passage times during transient analysis.
      Ret.DistributionResult getTranCdfPassT(AvgHandle R) Returns cumulative distribution functions of passage times during transient analysis.
      Ret.ProbabilityResult getTranProb(StatefulNode node) Computes transient state probabilities at a specific node over time using DES simulation.
      Ret.ProbabilityResult getTranProbAggr(StatefulNode node) Computes transient aggregated state probabilities at a specific node over time.
      Ret.ProbabilityResult getTranProbSys() Computes transient system-wide state probabilities over time using DES simulation.
      Ret.ProbabilityResult getTranProbSysAggr() Computes transient system-wide aggregated state probabilities over time.
      • Methods inherited from class jline.solvers.NetworkSolver

        aCT, aCT, aCT, aCT, aCT, aCT, aNCT, aNCT, aNCT, aNCT, aNCT, aNCT, aNT, aNT, aNT, aNT, aNT, aNT, 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, cdfPassT, cdfPassT, cdfRespT, cdfRespT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, chainAvgT, getAllSolvers, getAvg, getAvg, getAvgArvR, getAvgArvRChain, getAvgArvRHandles, getAvgChain, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgChainTable, getAvgHandles, getAvgNode, getAvgNodeArvRChain, getAvgNodeChain, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeChainTable, getAvgNodeQLenChain, getAvgNodeResidTChain, getAvgNodeRespTChain, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTable, getAvgNodeTputChain, getAvgNodeUtilChain, getAvgQLen, getAvgQLenChain, getAvgQLenHandles, getAvgResidT, getAvgResidTChain, getAvgResidTHandles, getAvgRespT, getAvgRespTChain, getAvgRespTHandles, getAvgSys, getAvgSys, getAvgSys, getAvgSysRespT, getAvgSysTable, getAvgSysTable, getAvgSysTable, getAvgSysTput, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgT, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTable, getAvgTput, getAvgTputChain, getAvgTputHandles, getAvgUtil, getAvgUtilChain, getAvgUtilHandles, getAvgWaitT, getCdfPassT, getCdfPassT, getCdfRespT, getCdfRespT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getChainAvgT, getDeadlineTable, getModel, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getNodeChainAvgT, getProb, getProbAggr, getProbMarg, getProbMarg, getProbNormConstAggr, getStageT, getStageT, getStageTable, getStageTable, getSysAvgT, getSysAvgT, getSysAvgT, getTranHandles, hasAvgResults, hasDistribResults, hasTranResults, initHandles, model, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, nodeChainAvgT, print, prob, prob, probAggr, probAggr, probMarg, probMarg, probNormConstAggr, probSys, probSysAggr, runAnalyzerChecks, sample, sampleAggr, setAvgHandles, setAvgResults, setDistribResults, setLang, setModel, setTranAvgResults, setTranHandles, setTranProb, stageT, stageTable, sysAvgT, sysAvgT, sysAvgT, tranAvg, tranCdfPassT, tranCdfPassT, tranCdfRespT, tranCdfRespT, tranHandles
      • Methods inherited from class jline.solvers.Solver

        getName, getOptions, getResults, hasResults, isJavaAvailable, isValidOption, listValidOptions, parseOptions, parseOptions, reset, resetRandomGeneratorSeed, setChecks, setOptions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SolverDES

        SolverDES(Network model)
        Constructs a SolverDES with the given model using default options.
        Parameters:
        model - the queueing network model to solve
      • SolverDES

        SolverDES(LayeredNetwork model)
        Constructs a SolverDES with the given LayeredNetwork model using default options.
        Parameters:
        model - the layered queueing network model to solve
      • SolverDES

        SolverDES(LayeredNetwork model, Array<Object> args)
        Constructs a SolverDES with the given LayeredNetwork model and variable arguments.
        Parameters:
        model - the layered queueing network model to solve
        args - variable arguments for solver options
      • SolverDES

        SolverDES(LayeredNetwork model, SolverOptions options)
        Constructs a SolverDES with the given LayeredNetwork model and options.
        Parameters:
        model - the layered queueing network model to solve
        options - solver configuration options
      • SolverDES

        SolverDES(Network model, Array<Object> args)
        Constructs a SolverDES with the given model and variable arguments.
        Parameters:
        model - the queueing network model to solve
        args - variable arguments for solver options
      • SolverDES

        SolverDES(Network model, String method)
        Constructs a SolverDES with the given model and method.
        Parameters:
        model - the queueing network model to solve
        method - the solution method to use
      • SolverDES

        SolverDES(Network model, SolverOptions options)
        Constructs a SolverDES with the given model and options.
        Parameters:
        model - the queueing network model to solve
        options - solver configuration options
    • Method Detail

      • getLNModel

         LayeredNetwork getLNModel()

        Returns the LayeredNetwork model (if solving an LQN).

        Returns:

        the LayeredNetwork model, or null if solving a regular Network

      • getStream

         Collector getStream()

        Returns the current streaming collector, or null if not streaming.

        Returns:

        the streaming collector

      • getNumThreads

         int getNumThreads()

        Returns the number of threads for parallel execution.

        Returns:

        the number of threads

      • setNumThreads

         void setNumThreads(int numThreads)

        Sets the parallelism level for replication execution.

        Parameters:
        numThreads - number of parallel threads
      • getFeatureSet

         static FeatureSet getFeatureSet()

        Returns the feature set supported by the DES solver. Supports multiclass Jackson queueing networks with FCFS queues.

        Returns:

        the feature set supported by the DES solver

      • getStruct

         NetworkStruct getStruct()

        Returns the network structure for this solver.

        Returns:

        the network structure

      • getTranAvg

         void getTranAvg()

        Performs a transient analysis of the model using discrete event simulation. The simulation is run for the time horizon specified in options.timespan. If options.timespan is not specified, it defaults to [0, 30/min_rate]. The number of replications is determined by options.samples.

      • getAvg

         SolverResult getAvg()

        Computes and returns average station metrics at steady-state. For LayeredNetwork models, this delegates to the LN-specific analyzer.

        Returns:

        solver result containing average metrics

      • listValidMethods

         List<String> listValidMethods()

        Returns the list of valid solution methods for DES.

        Returns:

        list of valid method names

      • listValidMethods

         List<String> listValidMethods(Network model)

        Returns the list of valid solution methods for DES.

        Parameters:
        model - the network model (unused, for interface compatibility)
        Returns:

        list of valid method names

      • runAnalyzer

         void runAnalyzer()

        Executes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.

      • runMethodSpecificAnalyzer

         SolverResult runMethodSpecificAnalyzer()

        Run the DES analyzer with current options including init_sol. This method is called by SolverENV for transient analysis with initial conditions.

        Returns:

        SolverResult containing transient metrics (QNt, UNt, TNt, t)

      • supports

         boolean supports(Network model)

        Checks if this solver supports the given network model. Default implementation returns true; subclasses should override to provide specific feature validation.

        Parameters:
        model - the network model to check
        Returns:

        true if the model is supported, false otherwise

      • supports

         boolean supports(LayeredNetwork model)

        Checks if the solver supports the given LayeredNetwork model.

        Parameters:
        model - the LayeredNetwork model to check
        Returns:

        true if the model is supported

      • getLNFeatureSet

         static FeatureSet getLNFeatureSet()

        Returns the feature set supported by the DES solver for LayeredNetwork models.

        Returns:

        the feature set supported for LQN models

      • getLNStruct

         LayeredNetworkStruct getLNStruct()

        Returns the LayeredNetworkStruct (if solving an LQN).

        Returns:

        the LayeredNetworkStruct, or null if solving a regular Network

      • getLNAvgTable

         LayeredNetworkAvgTable getLNAvgTable()

        Returns average metrics for a LayeredNetwork model as a table. This method should be called after getAvg() for LayeredNetwork models.

        Returns:

        LayeredNetworkAvgTable containing average metrics per LQN element

      • defaultOptions

         static SolverOptions defaultOptions()

        Returns the default solver options for the DES solver.

        Returns:

        Default solver options with SolverType.DES

      • sample

         Ret.SampleResult sample(StatefulNode node, int numSamples)

        Generates a sample path (state trajectory) for a specific node using DES transient simulation.

        Parameters:
        node - The stateful node to sample
        numSamples - Number of time points to sample
        Returns:

        SampleResult containing the state trajectory for the node

      • sampleAggr

         Ret.SampleResult sampleAggr(StatefulNode node, int numSamples)

        Generates an aggregated sample path for a specific node. For DES, the sample() method already returns per-class queue lengths (nir), so this method simply marks the result as aggregated without additional marginal computation. This differs from SSA which requires toMarginal processing on raw state vectors.

        Parameters:
        node - The stateful node to sample
        numSamples - Number of time points to sample
        Returns:

        SampleResult containing the aggregated state trajectory

      • sampleSys

         Ret.SampleResult sampleSys(int numSamples)

        Generates a system-wide sample path (state trajectory) for all stateful nodes.

        Parameters:
        numSamples - Number of time points to sample
        Returns:

        SampleResult containing the state trajectory for all nodes

      • sampleSysAggr

         Ret.SampleResult sampleSysAggr(int numSamples)

        Generates an aggregated system-wide sample path for all stateful nodes.

        Parameters:
        numSamples - Number of time points to sample
        Returns:

        SampleResult containing the aggregated state trajectory for all nodes

      • stream

         Ret.SampleResult stream(StatefulNode node, StreamingOptions streamingOptions)

        Generates a sample path with streaming metrics pushed via OTLP.

        Parameters:
        node - The stateful node to sample
        streamingOptions - Configuration for streaming (endpoint, mode, frequency)
        Returns:

        SampleResult containing the state trajectory for the node

      • stream

         Ret.SampleResult stream(StatefulNode node, int numSamples, StreamingOptions streamingOptions)

        Generates a sample path with streaming metrics pushed via OTLP.

        Parameters:
        node - The stateful node to sample
        numSamples - Number of time points to sample
        streamingOptions - Configuration for streaming (endpoint, mode, frequency)
        Returns:

        SampleResult containing the state trajectory for the node

      • streamAggr

         Ret.SampleResult streamAggr(StatefulNode node, StreamingOptions streamingOptions)

        Generates an aggregated sample path with streaming metrics pushed via OTLP.

        Parameters:
        node - The stateful node to sample
        streamingOptions - Configuration for streaming (endpoint, mode, frequency)
        Returns:

        SampleResult containing the aggregated state trajectory

      • streamAggr

         Ret.SampleResult streamAggr(StatefulNode node, int numSamples, StreamingOptions streamingOptions)

        Generates an aggregated sample path with streaming metrics pushed via OTLP.

        Parameters:
        node - The stateful node to sample
        numSamples - Number of time points to sample
        streamingOptions - Configuration for streaming (endpoint, mode, frequency)
        Returns:

        SampleResult containing the aggregated state trajectory

      • getProb

         Ret.ProbabilityResult getProb(StatefulNode node, Matrix state)

        Estimates the steady-state probability of a specific state at a node via DES simulation. This method runs a DES simulation and estimates state probabilities by computing the fraction of total simulation time spent in each state. The simulation collects state trajectories and weights each state by its dwell time.

        Parameters:
        node - The stateful node to analyze
        state - The state vector to compute probability for.
        Returns:

        Estimated probability of the specified state (0 if state not observed)

      • getProb

         Ret.ProbabilityResult getProb(int nodeIndex, Matrix state)

        Estimates state probability using node index.

        Parameters:
        nodeIndex - Index of the stateful node
        state - The state vector to compute probability for
        Returns:

        Estimated probability of the specified state

      • getProb

         Ret.ProbabilityResult getProb(StatefulNode node)

        Estimates state probability using current network state.

        Parameters:
        node - The stateful node to analyze
        Returns:

        Estimated probability of current network state at the node

      • getProbAggr

         Ret.ProbabilityResult getProbAggr(StatefulNode node, Matrix stateAggr)

        Estimates the steady-state probability of a specific aggregated (per-class) state at a node. This method estimates the probability of observing a specific per-class job distribution (e.g., [2 jobs of class 1, 1 job of class 2]) at a station. States are aggregated over service phases - only the number of jobs per class matters.

        Parameters:
        node - The stateful node to analyze
        stateAggr - The aggregated state vector (per-class job counts) to compute probability for.
        Returns:

        Estimated probability of the specified aggregated state (0 if state not observed)

      • getProbAggr

         Ret.ProbabilityResult getProbAggr(int nodeIndex, Matrix stateAggr)

        Estimates aggregated state probability using node index.

        Parameters:
        nodeIndex - Index of the stateful node
        stateAggr - The aggregated state vector to compute probability for
        Returns:

        Estimated probability of the specified aggregated state

      • getProbAggr

         Ret.ProbabilityResult getProbAggr(StatefulNode node)

        Estimates aggregated state probability using current network state.

        Parameters:
        node - The stateful node to analyze
        Returns:

        Estimated probability of current aggregated network state at the node

      • getProbSys

         Ret.ProbabilityResult getProbSys()

        Estimates the joint steady-state probability of the entire system state via DES simulation. This method estimates the probability of observing the current system state (combined state across all stateful nodes) using simulation-based estimation. States include phase information from service distributions.

        Returns:

        Estimated joint probability of the current system state (0 if state not observed)

      • getProbSysAggr

         Ret.ProbabilityResult getProbSysAggr()

        Estimates the joint steady-state probability of the entire aggregated system state. This method estimates the probability of observing the current system state (combined per-class job counts across all stateful nodes) using simulation. States are aggregated over service phases - only job counts per class matter.

        Returns:

        Estimated joint probability of the current aggregated system state (0 if state not observed)

      • getTranCdfRespT

         Ret.DistributionResult getTranCdfRespT()

        Returns cumulative distribution functions of response times during transient analysis. Uses response time samples collected during DES simulation to compute empirical CDFs.

        Returns:

        DistributionResult containing empirical CDFs for each station-class pair

      • getTranCdfRespT

         Ret.DistributionResult getTranCdfRespT(AvgHandle R)

        Returns cumulative distribution functions of response times during transient analysis.

        Parameters:
        R - response time handles specifying which metrics to compute
        Returns:

        DistributionResult containing empirical CDFs for each station-class pair

      • getTranCdfPassT

         Ret.DistributionResult getTranCdfPassT()

        Returns cumulative distribution functions of passage times during transient analysis. For DES, passage times are equivalent to response times in single-visit networks.

        Returns:

        DistributionResult containing empirical CDFs for passage times

      • getTranCdfPassT

         Ret.DistributionResult getTranCdfPassT(AvgHandle R)

        Returns cumulative distribution functions of passage times during transient analysis.

        Parameters:
        R - response time handles specifying which metrics to compute
        Returns:

        DistributionResult containing empirical CDFs for passage times

      • getTranProb

         Ret.ProbabilityResult getTranProb(StatefulNode node)

        Computes transient state probabilities at a specific node over time using DES simulation.

        Parameters:
        node - the stateful node to analyze
        Returns:

        ProbabilityResult containing transient probability data

      • getTranProbAggr

         Ret.ProbabilityResult getTranProbAggr(StatefulNode node)

        Computes transient aggregated state probabilities at a specific node over time.

        Parameters:
        node - the stateful node to analyze
        Returns:

        ProbabilityResult containing transient aggregated probability data

      • getTranProbSys

         Ret.ProbabilityResult getTranProbSys()

        Computes transient system-wide state probabilities over time using DES simulation.

        Returns:

        ProbabilityResult containing transient system probability data

      • getTranProbSysAggr

         Ret.ProbabilityResult getTranProbSysAggr()

        Computes transient system-wide aggregated state probabilities over time.

        Returns:

        ProbabilityResult containing transient system aggregated probability data