1function
RD = getCdfRespT(self, R)
2%
RD = GETCDFRESPT(R) Returns cumulative distribution function of response times
4% @brief Computes steady-state response time distribution
for each station and
class
6% This method returns the cumulative distribution function (CDF) of response times
7% at each station
for each job
class. The response time represents the time from
8% when a job arrives at a station until it completes service and departs.
10% The Fluid solver uses ODE-based mean-field approximations to estimate response
11% time distributions. The distributions are fitted based on the computed steady-state
12% moments and assume phase-type characteristics.
14% @param self SolverFluid instance
15% @param R (optional) Response time computation handle. If provided, uses cached results.
16% Otherwise computes
new CDFs by solving the passage time ODEs.
18% @
return RD Nested cell array of CDF data
19% -
RD is a {nstations x nclasses} cell array
20% -
RD{i,k} contains CDF data
for station i, job
class k
21% - Each non-empty element
is [n x 2] matrix:
22% - Column 1: CDF values (cumulative probability from 0 to 1)
23% - Column 2: Response time values (increasing sequence)
24% - Empty cells indicate metric
is disabled or not applicable
26% @note Response time CDF depends on the queue length distribution and service
27% times at each station. Requires getAvg() to have been called first to
28% establish steady-state baseline metrics.
30% @warning The Fluid approximation
is mean-field based. For exact distributions,
31% use CTMC solver on small models or SSA for general models.
32% Results may not be accurate for systems with high variability or
33% strong state dependencies.
35% @see getAvg - Computes steady-state average metrics (prerequisite)
36% @see getCdfPassT - Returns first passage time distributions
40% model = Network('example');
41% % ... model construction ...
42% solver = SolverFluid(model);
43% solver.getAvg(); % Compute steady-state first
45% % Get response time CDFs
46% cdf_respt = solver.getCdfRespT();
48% % Access CDF for station 0, class 1
49% if ~isempty(cdf_respt{1,2})
50% cdf_matrix = cdf_respt{1,2};
51% probs = cdf_matrix(:,1);
52% times = cdf_matrix(:,2);
54% % Plot response time CDF
55% plot(times, probs,
'LineWidth', 2);
56% xlabel(
'Response Time');
57% ylabel(
'Cumulative Probability');
63if GlobalConstants.DummyMode
64 RD = cell(sn.nstations,sn.nclasses);
69if nargin<2 %~exist(
'R',
'var')
70 R = self.getAvgRespTHandles;
71 % to do: check if some R are disabled
73self.getAvg; % get steady-state solution
74options = self.getOptions;
75options.init_sol = self.result.solverSpecific.odeStateVec;
76% we need to pass the modified sn as the number of phases may have changed
77% during the fluid iterations, affecting the size of odeStateVec
78RD = solver_fluid_passage_time(self.result.solverSpecific.sn, options);
80self.setDistribResults(
RD, runtime);