Class SolverLDES

Direct Known Subclasses:
LDES

public class SolverLDES extends NetworkSolver
  • Field Details

    • threadPool

      public ExecutorService threadPool
      Thread pool for parallel replication execution
  • Constructor Details

    • SolverLDES

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

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

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

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

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

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

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

      public SolverLDES(String filename)
      Load a JMT model file (.jsimg/.jsim/.jsimw/.jmva) and simulate with LDES.
      Parameters:
      filename - path to the JMT model file
    • SolverLDES

      public SolverLDES(String filename, Object... args)
      Load a JMT model file (.jsimg/.jsim/.jsimw/.jmva) and simulate with LDES, accepting variable option arguments (e.g., "seed", 23000, "samples", 50000).
      Parameters:
      filename - path to the JMT model file
      args - variable arguments for solver options
  • Method Details

    • getThreadPool

      public ExecutorService getThreadPool()
      Returns the thread pool for parallel replication execution.
      Returns:
      the thread pool
    • getNumThreads

      public int getNumThreads()
      Returns the number of threads for parallel execution.
      Returns:
      the number of threads
    • setNumThreads

      public void setNumThreads(int numThreads)
      Sets the parallelism level for replication execution.
      Parameters:
      numThreads - number of parallel threads
    • getFeatureSet

      public static FeatureSet getFeatureSet()
      Returns the feature set supported by the LDES solver. Supports multiclass Jackson queueing networks with FCFS queues.
      Returns:
      the feature set supported by the LDES solver
    • getStruct

      public NetworkStruct getStruct()
      Returns the network structure for this solver.
      Returns:
      the network structure
    • getTranAvg

      public 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.
      Overrides:
      getTranAvg in class NetworkSolver
    • getAvg

      public SolverResult getAvg()
      Computes and returns average station metrics at steady-state. For LayeredNetwork models, this delegates to the LN-specific analyzer.
      Overrides:
      getAvg in class NetworkSolver
      Returns:
      solver result containing average metrics
    • listValidMethods

      public List<String> listValidMethods()
      Returns the list of valid solution methods for LDES.
      Returns:
      list of valid method names
    • listValidMethods

      public List<String> listValidMethods(Network model)
      Returns the list of valid solution methods for LDES.
      Parameters:
      model - the network model (unused, for interface compatibility)
      Returns:
      list of valid method names
    • runAnalyzer

      Description copied from class: Solver
      Executes the solver algorithm to analyze the model. This abstract method must be implemented by concrete solver classes.
      Specified by:
      runAnalyzer in class Solver
      Throws:
      IllegalAccessException - if access to required resources is denied
      ParserConfigurationException - if XML parsing configuration fails
      IOException - if I/O operations fail
    • runMethodSpecificAnalyzer

      public SolverResult runMethodSpecificAnalyzer()
      Run the LDES 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

      public boolean supports(Network model)
      Description copied from class: Solver
      Checks if this solver supports the given network model. Default implementation returns true; subclasses should override to provide specific feature validation.
      Overrides:
      supports in class Solver
      Parameters:
      model - the network model to check
      Returns:
      true if the model is supported, false otherwise
    • supports

      public 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

      public static FeatureSet getLNFeatureSet()
      Returns the feature set supported by the LDES solver for LayeredNetwork models.
      Returns:
      the feature set supported for LQN models
    • getLNModel

      public LayeredNetwork getLNModel()
      Returns the LayeredNetwork model (if solving an LQN).
      Returns:
      the LayeredNetwork model, or null if solving a regular Network
    • getLNStruct

      public LayeredNetworkStruct getLNStruct()
      Returns the LayeredNetworkStruct (if solving an LQN).
      Returns:
      the LayeredNetworkStruct, or null if solving a regular Network
    • getLNAvgTable

      public 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
      Throws:
      RuntimeException - if not solving a LayeredNetwork model or results not available
    • defaultOptions

      public static SolverOptions defaultOptions()
      Returns the default solver options for the LDES solver.
      Returns:
      Default solver options with SolverType.LDES
    • sample

      public Ret.SampleResult sample(StatefulNode node, int numEvents)
      Generates a sample path (state trajectory) for a specific node using LDES transient simulation.
      Parameters:
      node - The stateful node to sample
      numEvents - Number of time points to sample
      Returns:
      SampleResult containing the state trajectory for the node
    • sampleAggr

      public Ret.SampleResult sampleAggr(StatefulNode node, int numEvents)
      Generates an aggregated sample path for a specific node. For LDES, 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
      numEvents - Number of time points to sample
      Returns:
      SampleResult containing the aggregated state trajectory
    • sampleSys

      public Ret.SampleResult sampleSys(int numEvents)
      Generates a system-wide sample path (state trajectory) for all stateful nodes.
      Overrides:
      sampleSys in class NetworkSolver
      Parameters:
      numEvents - Number of time points to sample
      Returns:
      SampleResult containing the state trajectory for all nodes
    • sampleSysAggr

      public Ret.SampleResult sampleSysAggr(int numEvents)
      Generates an aggregated system-wide sample path for all stateful nodes.
      Overrides:
      sampleSysAggr in class NetworkSolver
      Parameters:
      numEvents - Number of time points to sample
      Returns:
      SampleResult containing the aggregated state trajectory for all nodes
    • stream

      public 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

      public Ret.SampleResult stream(StatefulNode node, int numEvents, StreamingOptions streamingOptions)
      Generates a sample path with streaming metrics pushed via OTLP.
      Parameters:
      node - The stateful node to sample
      numEvents - Number of time points to sample
      streamingOptions - Configuration for streaming (endpoint, mode, frequency)
      Returns:
      SampleResult containing the state trajectory for the node
    • streamAggr

      public 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

      public Ret.SampleResult streamAggr(StatefulNode node, int numEvents, StreamingOptions streamingOptions)
      Generates an aggregated sample path with streaming metrics pushed via OTLP.
      Parameters:
      node - The stateful node to sample
      numEvents - Number of time points to sample
      streamingOptions - Configuration for streaming (endpoint, mode, frequency)
      Returns:
      SampleResult containing the aggregated state trajectory
    • getStream

      public Collector getStream()
      Returns the current streaming collector, or null if not streaming.
      Returns:
      the streaming collector
    • getProb

      public Ret.ProbabilityResult getProb(StatefulNode node, Matrix state)
      Estimates the steady-state probability of a specific state at a node via LDES simulation. This method runs a LDES 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. If null, uses current network state.
      Returns:
      Estimated probability of the specified state (0 if state not observed)
    • getProb

      public Ret.ProbabilityResult getProb(int nodeIndex, Matrix state)
      Estimates state probability using node index.
      Overrides:
      getProb in class NetworkSolver
      Parameters:
      nodeIndex - Index of the stateful node
      state - The state vector to compute probability for
      Returns:
      Estimated probability of the specified state
    • getProb

      public 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

      public 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. If null, uses current network state aggregated over phases.
      Returns:
      Estimated probability of the specified aggregated state (0 if state not observed)
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(int nodeIndex, Matrix stateAggr)
      Estimates aggregated state probability using node index.
      Overrides:
      getProbAggr in class NetworkSolver
      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

      public 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

      public Ret.ProbabilityResult getProbSys()
      Estimates the joint steady-state probability of the entire system state via LDES 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.
      Overrides:
      getProbSys in class NetworkSolver
      Returns:
      Estimated joint probability of the current system state (0 if state not observed)
    • getProbSysAggr

      public 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.
      Overrides:
      getProbSysAggr in class NetworkSolver
      Returns:
      Estimated joint probability of the current aggregated system state (0 if state not observed)
    • getTranCdfRespT

      public Ret.DistributionResult getTranCdfRespT()
      Returns cumulative distribution functions of response times during transient analysis. Uses response time samples collected during LDES simulation to compute empirical CDFs.
      Overrides:
      getTranCdfRespT in class NetworkSolver
      Returns:
      DistributionResult containing empirical CDFs for each station-class pair
    • getTranCdfRespT

      public Ret.DistributionResult getTranCdfRespT(AvgHandle R)
      Returns cumulative distribution functions of response times during transient analysis.
      Overrides:
      getTranCdfRespT in class NetworkSolver
      Parameters:
      R - response time handles specifying which metrics to compute
      Returns:
      DistributionResult containing empirical CDFs for each station-class pair
    • getTranCdfPassT

      public Ret.DistributionResult getTranCdfPassT()
      Returns cumulative distribution functions of passage times during transient analysis. For LDES, passage times are equivalent to response times in single-visit networks.
      Overrides:
      getTranCdfPassT in class NetworkSolver
      Returns:
      DistributionResult containing empirical CDFs for passage times
    • getTranCdfPassT

      public Ret.DistributionResult getTranCdfPassT(AvgHandle R)
      Returns cumulative distribution functions of passage times during transient analysis.
      Overrides:
      getTranCdfPassT in class NetworkSolver
      Parameters:
      R - response time handles specifying which metrics to compute
      Returns:
      DistributionResult containing empirical CDFs for passage times
    • getTranProb

      public Ret.ProbabilityResult getTranProb(StatefulNode node)
      Computes transient state probabilities at a specific node over time using LDES simulation.
      Parameters:
      node - the stateful node to analyze
      Returns:
      ProbabilityResult containing transient probability data
    • getTranProbAggr

      public 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

      public Ret.ProbabilityResult getTranProbSys()
      Computes transient system-wide state probabilities over time using LDES simulation.
      Returns:
      ProbabilityResult containing transient system probability data
    • getTranProbSysAggr

      public Ret.ProbabilityResult getTranProbSysAggr()
      Computes transient system-wide aggregated state probabilities over time.
      Returns:
      ProbabilityResult containing transient system aggregated probability data