LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_compress.m
1%{ @file mmap_compress.m
2 % @brief Compresses an MMAP into a smaller representation
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Compresses a Marked MAP into a smaller representation
9 %
10 % @details
11 % This function compresses an MMAP (Marked Markovian Arrival Process) into
12 % a smaller representation using various compression methods including
13 % mixture fitting, MAMAP2, and M3PP approaches.
14 %
15 % @par Syntax:
16 % @code
17 % MMAP = mmap_compress(MMAP)
18 % MMAP = mmap_compress(MMAP, config)
19 % @endcode
20 %
21 % @par Parameters:
22 % <table>
23 % <tr><th>Name<th>Description
24 % <tr><td>MMAP<td>Original Marked Markovian Arrival Process
25 % <tr><td>config<td>(Optional) Configuration struct with compression method
26 % </table>
27 %
28 % @par Returns:
29 % <table>
30 % <tr><th>Name<th>Description
31 % <tr><td>MMAP<td>Compressed MMAP
32 % </table>
33%}
34function MMAP = mmap_compress(MMAP, config)
35if nargin<1%~exist('config','var')
36 config = struct;
37end
38if ~isfield(config,'method')
39 config.method = 'default';
40end
41
42K = length(MMAP)-2;
43switch config.method
44 case {'default','mixture','mixture.order1'}
45 lambda = mmap_lambda(MMAP);
46 AMAPs = mmap_maps(MMAP);
47 for k=1:K
48 AMAPs{k} = mmpp2_fit1(map_mean(AMAPs{k}),map_scv(AMAPs{k}),map_skew(AMAPs{k}),map_idc(AMAPs{k}));
49 end
50 MMAP = mmap_mixture(lambda/sum(lambda), AMAPs);
51 case 'mixture.order2'
52 MMAP = mmap_mixture_fit_mmap(MMAP);
53 case 'mamap2'
54 MMAP = mmap_normalize(MMAP);
55 MMAP = mamap2m_fit_mmap(MMAP);
56 case 'mamap2.fb'
57 MMAP = mmap_normalize(MMAP);
58 MMAP = mamap2m_fit_gamma_fb_mmap(MMAP);
59 case 'm3pp.approx_cov'
60 MMAP = m3pp2m_fitc_theoretical(MMAP, 'approx_cov', 1, 1e6); %derivest
61 case 'm3pp.approx_ag'
62 MMAP = m3pp2m_fitc_theoretical(MMAP, 'approx_ag', 1, 1e6); %derivest
63 case 'm3pp.exact_delta'
64 MMAP = m3pp2m_fitc_theoretical(MMAP, 'exact_delta', 1, 1e6); %derivest
65 case 'm3pp.approx_delta'
66 MMAP = m3pp2m_fitc_theoretical(MMAP, 'approx_delta', 1, 1e6); %derivest
67end
68MMAP = mmap_normalize(MMAP);
69end