Class SolverFluid

Direct Known Subclasses:
FLD, Fluid

public class SolverFluid extends NetworkSolver
FLD - Fluid/Mean-Field Approximation solver. SolverFluid is based on fluid and mean-field approximation methods. It provides fluid-based analysis for queueing networks, particularly useful for large-scale systems where discrete-event simulation would be computationally expensive.
  • Constructor Details

    • SolverFluid

      public SolverFluid(Network model)
      Creates a new SolverFluid instance with default options.
      Parameters:
      model - The network model to analyze
    • SolverFluid

      public SolverFluid(Network model, Object... varargin)
      Creates a new SolverFluid instance with variable arguments for options.
      Parameters:
      model - The network model to analyze
      varargin - Variable arguments for solver options
    • SolverFluid

      public SolverFluid(Network model, String method)
      Creates a new SolverFluid instance with a specific method.
      Parameters:
      model - The network model to analyze
      method - The fluid analysis method to use
    • SolverFluid

      public SolverFluid(Network model, SolverOptions options)
      Creates a new SolverFluid instance with specific options.
      Parameters:
      model - The network model to analyze
      options - The solver options to use
  • Method Details

    • defaultOptions

      public static SolverOptions defaultOptions()
      Returns the default solver options for the Fluid solver.
      Returns:
      Default solver options with SolverType.FLUID
    • getFeatureSet

      public static FeatureSet getFeatureSet()
      Returns the feature set supported by the Fluid solver
      Returns:
      - the feature set supported by the Fluid solver
    • getCdfRespT

      public Ret.DistributionResult getCdfRespT()
      Description copied from class: NetworkSolver
      Returns cumulative distribution functions of response times at steady-state. Uses default response time handles.
      Overrides:
      getCdfRespT in class NetworkSolver
      Returns:
      result containing CDFs for response times [stations x classes]
    • getProbAggr

      public Ret.ProbabilityResult getProbAggr(int ist)
      Description copied from class: NetworkSolver
      Probability 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:
      getProbAggr in class NetworkSolver
      Parameters:
      ist - the node index for which to compute probabilities
      Returns:
      scalar probability in [0,1]
    • getTranCdfPassT

      public Ret.DistributionResult getTranCdfPassT()
      Description copied from class: NetworkSolver
      Returns cumulative distribution functions of passage times during transient analysis. Uses default response time handles.
      Overrides:
      getTranCdfPassT in class NetworkSolver
      Returns:
      result containing transient CDFs for passage times
    • initSol

      public void initSol()
      Initializes the solution vector for the fluid analysis. This method sets up the initial state representation for the fluid solver.
    • runAnalyzer

      public void runAnalyzer()
      Runs the fluid analyzer to solve the queueing network. This method executes the fluid approximation algorithm and stores the results in the solver's result object.
      Specified by:
      runAnalyzer in class Solver
    • runMethodSpecificAnalyzer

      public SolverResult runMethodSpecificAnalyzer()
    • supports

      public boolean supports(Network model)
      Checks whether the given model is supported by the Fluid solver. This method compares the features used by the model against the features supported by the Fluid solver.
      Overrides:
      supports in class Solver
      Parameters:
      model - The network model to check
      Returns:
      true if the model is supported, false otherwise
    • getStruct

      public NetworkStruct getStruct()
      Get model structure data structure summarizing the network
      Returns:
      NetworkStruct containing the model structure
    • listValidMethods

      public String[] listValidMethods()
      List all valid solution methods supported by this solver
      Returns:
      array of valid method names
    • runAnalyzerChecks

      public void runAnalyzerChecks(SolverOptions options)
      Validates model compatibility and method support before analysis
      Overrides:
      runAnalyzerChecks in class NetworkSolver
      Parameters:
      options - solver options containing method specification
      Throws:
      RuntimeException - if model contains unsupported features or method is invalid
    • initFluidHandles

      protected void initFluidHandles()
      Initialize performance metric handles from the model. This method ensures all handles are properly configured for fluid analysis.
    • setFluidTranAvgResults

      public void setFluidTranAvgResults(Matrix[][] Qt, Matrix[][] Ut, Matrix[][] Rt, Matrix[][] Tt, Matrix[][] Ct, Matrix[][] Xt, double runtimet)
      Set transient average results with proper validation
      Parameters:
      Qt - transient queue length matrices [time][stations x classes]
      Ut - transient utilization matrices [time][stations x classes]
      Rt - transient response time matrices [time][stations x classes]
      Tt - transient throughput matrices [time][stations x classes]
      Ct - transient system response time matrices [time][chains]
      Xt - transient system throughput matrices [time][chains]
      runtimet - computation time for transient analysis
    • setFluidDistribResults

      public void setFluidDistribResults(Matrix RD, double runtime)
      Set distribution results with enhanced metadata for fluid solver
      Parameters:
      RD - distribution data [stations x classes] containing CDFs
      runtime - computation time for distribution analysis
    • getAvgHandles

      public SolverAvgHandles getAvgHandles()
      Enhanced method to get average handles with validation
      Overrides:
      getAvgHandles in class NetworkSolver
      Returns:
      SolverAvgHandles with all handles properly initialized
    • setAvgHandles

      public void setAvgHandles(SolverAvgHandles handles)
      Enhanced method to set average handles with validation
      Overrides:
      setAvgHandles in class NetworkSolver
      Parameters:
      handles - the average handles to set
    • getTranHandles

      public SolverTranHandles getTranHandles()
      Enhanced method to get transient handles with validation
      Overrides:
      getTranHandles in class NetworkSolver
      Returns:
      SolverTranHandles with all handles properly initialized
    • setTranHandles

      public void setTranHandles(SolverTranHandles handles)
      Enhanced method to set transient handles with validation
      Overrides:
      setTranHandles in class NetworkSolver
      Parameters:
      handles - the transient handles to set
    • getAvgQLenHandles

      public AvgHandle getAvgQLenHandles()
      Get queue length handles with fluid-specific validation
      Overrides:
      getAvgQLenHandles in class NetworkSolver
      Returns:
      AvgHandle for queue length metrics
    • getAvgUtilHandles

      public AvgHandle getAvgUtilHandles()
      Get utilization handles with fluid-specific validation
      Overrides:
      getAvgUtilHandles in class NetworkSolver
      Returns:
      AvgHandle for utilization metrics
    • getAvgRespTHandles

      public AvgHandle getAvgRespTHandles()
      Get response time handles with fluid-specific validation
      Overrides:
      getAvgRespTHandles in class NetworkSolver
      Returns:
      AvgHandle for response time metrics
    • getAvgTputHandles

      public AvgHandle getAvgTputHandles()
      Get throughput handles with fluid-specific validation
      Overrides:
      getAvgTputHandles in class NetworkSolver
      Returns:
      AvgHandle for throughput metrics
    • getAvgArvRHandles

      public AvgHandle getAvgArvRHandles()
      Get arrival rate handles with fluid-specific validation
      Overrides:
      getAvgArvRHandles in class NetworkSolver
      Returns:
      AvgHandle for arrival rate metrics
    • getAvgResidTHandles

      public AvgHandle getAvgResidTHandles()
      Get residence time handles with fluid-specific validation
      Overrides:
      getAvgResidTHandles in class NetworkSolver
      Returns:
      AvgHandle for residence time metrics
    • getCdfPassT

      public Ret.DistributionResult getCdfPassT()
      Get cumulative distribution function for passage time. This method computes passage time distributions for job classes based on completion events at each station.
      Overrides:
      getCdfPassT in class NetworkSolver
      Returns:
      DistributionResult containing the passage time CDF data
    • getCdfPassT

      public Ret.DistributionResult getCdfPassT(AvgHandle R)
      Get cumulative distribution function for passage time with specific response time handles. This method computes passage time distributions for job classes based on completion events at each station using the provided handles.
      Overrides:
      getCdfPassT in class NetworkSolver
      Parameters:
      R - the response time handles to use for the analysis
      Returns:
      DistributionResult containing the passage time CDF data
    • getAvgAoI

      public Map<String,Object> getAvgAoI()
      Get average Age of Information metrics.

      Returns AoI and Peak AoI statistics computed by the Fluid solver. Requires the model to have a valid AoI topology (single open class, Source-Queue-Sink, capacity 1 or 2, single server, FCFS/LCFS/LCFSPR).

      Returns:
      Map with keys "AoI" and "PAoI", each mapping to a Map with "mean", "var", "std" entries. Also includes "systemType" and "preemption" at the top level. Returns null if no AoI results are available.
    • getCdfAoI

      public Matrix[] getCdfAoI(Matrix tValues)
      Get CDF of Age of Information.

      Computes the cumulative distribution function of AoI and Peak AoI using matrix exponential representations: F(t) = 1 - g * expm(A*t) * h

      Parameters:
      tValues - Time values at which to evaluate CDF. If null, uses automatic range based on mean AoI (0 to 5*mean, 200 points).
      Returns:
      Array of two Matrix objects: [AoI_cdf, PAoI_cdf]. Each is an n x 2 matrix with columns [CDF_values, t_values]. Returns null if no AoI results are available.
    • getCdfAoI

      public Matrix[] getCdfAoI()
      Get CDF of Age of Information with automatic time range.
      Returns:
      Array of two Matrix objects: [AoI_cdf, PAoI_cdf]
    • getSjrnT

      public Ret.DistributionResult getSjrnT()
      Get sojourn time CDF. Alias for getCdfRespT().
      Returns:
      DistributionResult containing response time CDFs
    • sjrnT

      public Ret.DistributionResult sjrnT()
      Get sojourn time CDF. Lowercase Kotlin-style alias for getSjrnT().
      Returns:
      DistributionResult containing response time CDFs