LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getTranAvg.m
1function [QNclass_t, UNclass_t, TNclass_t] = getTranAvg(self,Qt,Ut,Tt)
2% [QNCLASS_T, UNCLASS_T, TNCLASS_T] = GETTRANAVG(SELF,QT,UT,TT)
3% Returns transient mean performance metrics over time
4%
5% @brief Computes transient queue length, utilization, and throughput time series
6%
7% This method returns transient performance metrics (time-dependent averages)
8% for each station and job class. The transient analysis tracks how metrics
9% evolve from the initial state toward steady state over the specified time span.
10%
11% The Fluid solver uses ODE-based mean-field approximations to compute transient
12% behavior efficiently. The method returns different data structures depending on
13% whether optional handles are provided.
14%
15% @param self SolverFluid instance (must have timespan configured, e.g.,
16% SolverFluid(model, 'timespan', [0, 50]))
17% @param Qt (optional) Queue length handle from previous computation. If provided,
18% returns cached results. Otherwise computes new QN(t).
19% @param Ut (optional) Utilization handle. If provided, uses cached results.
20% Otherwise computes new UN(t).
21% @param Tt (optional) Throughput handle. If provided, uses cached results.
22% Otherwise computes new TN(t).
23%
24% @return QNclass_t Nested cell array of queue length time series
25% - Structure: {station_1, station_2, ...} where each station contains
26% {class_1_timeseries, class_2_timeseries, ...}
27% - Each element is a vector of queue lengths at each time point
28% - Shape: [num_stations][num_classes] with each element a time-series array
29%
30% @return UNclass_t Nested cell array of utilization time series
31% - Same structure as QNclass_t but containing utilization values
32%
33% @return TNclass_t Nested cell array of throughput time series
34% - Same structure as QNclass_t but containing throughput values
35%
36% @note Transient analysis is only available for certain solvers (CTMC, Fluid, JMT).
37% Must configure timespan when creating solver instance:
38% solver = SolverFluid(model, 'timespan', [0, 100]);
39%
40% @warning The Fluid approximation is mean-field based and provides estimates
41% rather than exact transient probabilities. Use CTMC for small models
42% requiring exact transient analysis.
43%
44% @see getTranHandles - Get result handles for transient metrics
45% @see getAvg - Get steady-state average metrics
46%
47% Example:
48% @code
49% model = Network('example');
50% % ... model construction ...
51% solver = SolverFluid(model, 'timespan', [0, 50]);
52% [QN_t, UN_t, TN_t] = solver.getTranAvg();
53%
54% % Access queue length time series for station 0, class 1
55% qlen_time_series = QN_t{1}{2};
56% plot(qlen_time_series);
57% @endcode
58%
59% Copyright (c) 2012-2026, Imperial College London
60% All rights reserved.
61
62% temporarily switch to closing method
63if nargin == 1
64 [Qt,Ut,Tt] = self.getTranHandles;
65end
66
67options = self.options;
68switch options.method
69 case {'default', 'matrix', 'closing'}
70 % These methods can switch to closing silently for transient analysis
71 self.options.method = 'closing';
72 otherwise
73 line_warning(mfilename,'getTranAvg is not offered by the specified method. Setting the solution method to ''''closing''''.\n');
74 self.options.method = 'closing';
75 self.reset();
76end
77
78[QNclass_t, UNclass_t, TNclass_t] = getTranAvg@NetworkSolver(self,Qt,Ut,Tt);
79self.options = options;
80end