LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
get_distribution.m
1function [ S0, S1, sigma ] = get_distribution( mean, choice, CX2, decay )
2
3% return the MAP representation (S0,S1) of the required distribution
4% mean: mean rate of the distribution
5% choice: the targeted distribution, where 1 = Exp, 2 = HE2,
6% 3 = ER2, 4 = MAP2
7
8if (choice == 4)
9
10 % 2-phase MAP arrivals: MAP2
11 [ lambda1,lambda2,a ] = estimateH2( mean, CX2 );
12 [ S0, S1, p ] = map2( lambda1, lambda2, a, decay);
13 sigma = [p,1-p];
14
15else
16 if (choice == 1)
17 % Exponential distribution:Exp
18 S = -mean;
19 s = mean;
20 sigma = 1;
21
22 elseif (choice == 2)
23 % 2-phase Hyper-exponential distribution: HE2
24 [ lambda1,lambda2,a ] = estimateH2( mean, CX2 );
25 S = [-lambda1,0; 0,-lambda2];
26 s = [lambda1; lambda2];
27 sigma = [a,1-a];
28
29 elseif (choice == 3)
30 % 2-phase Erlang distribution: ER2
31 v = 2*mean;
32 S = [-v,v;0,-v];
33 s = [0;v];
34 sigma = [1,0];
35
36 end
37
38 S0 = S;
39 S1 = s*sigma;
40
41end
42