Class AvgTable
- Direct Known Subclasses:
LayeredNetworkAvgTable,LayeredNetworkSensitivityTable,NetworkAvgCacheTable,NetworkAvgChainTable,NetworkAvgItemTable,NetworkAvgNodeChainTable,NetworkAvgNodeTable,NetworkAvgSysTable,NetworkAvgTable,NetworkBoundsTable,NetworkMomentChainTable,NetworkMomentStationTable,NetworkMomentTable,NetworkSensitivityTable
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringfmtValue(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.getData()Returns the underlying matrix data.abstract voidprint()Prints the table contents in a human-readable format.protected static voidprintFormattedTable(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.voidsanitize()Sanitizes the table data to fix small numerical perturbations.voidsetOptions(SolverOptions options) Sets the solver options associated with this table.toMatrix()Returns the table data as a Matrix after sanitizing numerical values.
-
Constructor Details
-
AvgTable
Constructs an AvgTable from a Matrix.- Parameters:
table- the matrix containing performance metrics data
-
AvgTable
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
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
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
Sets the solver options associated with this table.- Parameters:
options- the solver options used when computing this table
-
toMatrix
Returns the table data as a Matrix after sanitizing numerical values.- Returns:
- the sanitized Matrix containing the performance metrics
-
fmtValue
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 formatdigits- number of significant digits- Returns:
- the formatted value
-
printFormattedTable
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 headersrows- the data rows, each with one cell per header
-