LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
RandomDMAP.m
1% [D0, D1] = RandomDMAP(order, mean, zeroEntries, maxTrials, prec)
2%
3% Returns a random disctere Markovian arrival process.
4%
5% Parameters
6% ----------
7% order : int
8% The size of the DMAP
9% mean : double, optional
10% The mean inter-arrival times of the DMAP
11% zeroEntries : int, optional
12% The number of zero entries in the D0 and D1 matrices
13% maxTrials : int, optional
14% The maximum number of trials to find a proper DMAP
15% (that has an irreducible phase process and none of
16% its parameters is all-zero)
17% prec : double, optional
18% Numerical precision for checking the irreducibility.
19% The default value is 1e-14.
20%
21% Returns
22% -------
23% D0 : vector, shape (1,M)
24% The D0 matrix of the DMAP
25% D1 : matrix, shape (M,M)
26% The D1 matrix of the DMAP
27%
28% Notes
29% -----
30% If it fails, try to increase the 'maxTrials' parameter,
31% or/and the 'mean' parameter.
32
33function [d0,d1] = RandomDMAP(order, mean, zeroEntries, maxTrials, prec)
34% RandomDMAP [ order, zeroEntries[0], prec[10^-14], maxTrials[100] ]
35% -> [ matrix0, matrix1 ] :
36% Generates a random discrete time Markovian arrival process of the
37% given order. The obtained representation containes 'zeroEntries' zeros.
38% If it fails after 'maxTrials' trials, then it decreases the number of
39% zero entries. It prints a message, if the found representation contains
40% less zeros than given. 'prec' is the numerical precision.
41
42 if ~exist('zeroEntries','var')
43 zeroEntries = 0;
44 end
45
46 if ~exist('prec','var')
47 prec = 1e-7;
48 end
49
50 if ~exist('mean','var')
51 mean = 10;
52 end
53
54 if ~exist('maxTrials','var')
55 maxTrials = 1000;
56 end
57
58 D = RandomDMMAP(order, 1, mean, zeroEntries, maxTrials, prec);
59 d0=D{1};
60 d1=D{2};
61end