Package jline.solvers

Class AvgTable

java.lang.Object
jline.solvers.AvgTable
Direct Known Subclasses:
LayeredNetworkAvgTable, LayeredNetworkSensitivityTable, NetworkAvgCacheTable, NetworkAvgChainTable, NetworkAvgItemTable, NetworkAvgNodeChainTable, NetworkAvgNodeTable, NetworkAvgSysTable, NetworkAvgTable, NetworkBoundsTable, NetworkMomentChainTable, NetworkMomentStationTable, NetworkMomentTable, NetworkSensitivityTable

public abstract class AvgTable extends Object
Abstract base class for representing average performance metrics tables.

AvgTable provides a unified interface for storing and accessing performance metrics computed by various solvers in LINE. The table stores metrics such as throughput, utilization, queue length, and response time organized by stations and job classes.

Subclasses implement specific table formats for different types of performance metrics and provide specialized printing methods for displaying results in human-readable formats.

The underlying data is stored as a Matrix and can be accessed either column-wise or as a complete matrix. The class includes utilities for sanitizing numerical results to handle small floating-point perturbations.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an AvgTable from a list of lists.
    Constructs an AvgTable from a Matrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static String
    fmtValue(double value, int digits)
    Formats a metric value compactly with the given number of significant digits, matching the MATLAB table display (e.g.
    get(int col)
    Retrieves a specific column from the table as a list.
    Returns the underlying matrix data.
    abstract void
    Prints the table contents in a human-readable format.
    protected static void
    printFormattedTable(String[] headers, List<String[]> rows)
    Prints a header row followed by data rows, sizing every column to its widest cell with a two-space gap and no trailing padding, as in the MATLAB and Python table displays.
    void
    Sanitizes the table data to fix small numerical perturbations.
    void
    Sets the solver options associated with this table.
    Returns the table data as a Matrix after sanitizing numerical values.

    Methods inherited from class java.lang.Object

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

    • AvgTable

      public AvgTable(Matrix table)
      Constructs an AvgTable from a Matrix.
      Parameters:
      table - the matrix containing performance metrics data
    • AvgTable

      public AvgTable(ArrayList<List<Double>> table)
      Constructs an AvgTable from a list of lists.
      Parameters:
      table - the data as a list of lists, where each inner list represents a row
  • Method Details

    • get

      public List<Double> get(int col)
      Retrieves a specific column from the table as a list.
      Parameters:
      col - the column index to retrieve
      Returns:
      the column data as a List of Double values
    • getData

      public Matrix getData()
      Returns the underlying matrix data.
      Returns:
      the Matrix containing the performance metrics
    • print

      public abstract void print()
      Prints the table contents in a human-readable format. Implementation is provided by subclasses for specific table types.
    • sanitize

      public void sanitize()
      Sanitizes the table data to fix small numerical perturbations.

      This method rounds values that are very close to integers to their nearest integer values, and sets very small values to zero to eliminate numerical noise that can accumulate during floating-point computations.

    • setOptions

      public void setOptions(SolverOptions options)
      Sets the solver options associated with this table.
      Parameters:
      options - the solver options used when computing this table
    • toMatrix

      public Matrix toMatrix()
      Returns the table data as a Matrix after sanitizing numerical values.
      Returns:
      the sanitized Matrix containing the performance metrics
    • fmtValue

      protected static String fmtValue(double value, int digits)
      Formats a metric value compactly with the given number of significant digits, matching the MATLAB table display (e.g. 0, 0.5, 1, 0.33333, 1.5e-06). Integers print without a fractional part.
      Parameters:
      value - the value to format
      digits - number of significant digits
      Returns:
      the formatted value
    • printFormattedTable

      protected static void printFormattedTable(String[] headers, List<String[]> rows)
      Prints a header row followed by data rows, sizing every column to its widest cell with a two-space gap and no trailing padding, as in the MATLAB and Python table displays. Name columns are left-aligned and numeric columns (all data cells numeric) are right-aligned, following the MATLAB table display convention.
      Parameters:
      headers - the column headers
      rows - the data rows, each with one cell per header