Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
gcasale committed Aug 5, 2016
1 parent a3ce5fc commit 5d32c0c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dicefg.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function dicefg(configFile)
version = '2.3.0';
xDoc = xmlread(configFile);
rootNode = xDoc.getDocumentElement.getChildNodes; % get the <DICE-FG> root

warning off;
Node = rootNode.getFirstChild;
while ~isempty(Node)
if strcmp(Node.getNodeName, 'configuration')
Expand Down
15 changes: 8 additions & 7 deletions dicefg_handler_fit.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
metric.ConfInt = [muci(1), muci(2); sigmaci(1), sigmaci(2)];
case 'fit-gamma'
dicefg_disp(1,sprintf('Fitting gamma distribution (%s).',metric.Algorithm))
metric.Result = gamfit(get_data(metric,metric.ResIndex,metric.ClassIndex));
metric.Result = gamfit(trace);
case 'fit-exp'
dicefg_disp(1,sprintf('Fitting exponential distribution (%s).',metric.Algorithm))
metric.Result = expfit(get_data(metric,metric.ResIndex,metric.ClassIndex));
metric.Result = expfit(trace);
case 'fit-erl'
dicefg_disp(1,sprintf('Fitting Erlang distribution (%s).',metric.Algorithm))
% we fit an erlang by fitting a gamma and rounding
% up the shape parameter later on
metric.Result = gamfit(get_data(metric,metric.ResIndex,metric.ClassIndex));
metric.Result = gamfit(trace);
metric.Result(1) = round(metric.Result(1));
case 'fit-ph2'
dicefg_disp(1,sprintf('Fitting PH(2) distribution (%s).',metric.Algorithm))
trace = kpcfit_init(get_data(metric,metric.ResIndex,metric.ClassIndex));
trace = kpcfit_init(trace);
metric.Result = kpcfit_auto(trace,'OnlyAC',1,'NumStates',2,'MaxRunsAC',1);
if map_isfeasible(metric.Result)
g2 = 0; % acf decay rate - 0 since PH is a renewal process
Expand All @@ -34,15 +35,15 @@
end
else
dicefg_disp(1,'Infeasible PH(2) fitting. Returning exponential.')
metric.Result = expfit(get_data(metric,metric.ResIndex,metric.ClassIndex));
metric.Result = expfit(trace);
end
case 'fit-map2'
dicefg_disp(1,sprintf('Fitting MAP(2) process (%s).',metric.Algorithm))
trace = kpcfit_init(get_data(metric,metric.ResIndex,metric.ClassIndex));
trace = kpcfit_init(trace);
metric.Result = kpcfit_auto(trace,'OnlyAC',1,'NumStates',2,'MaxRunsAC',1);
if ~map_isfeasible(metric.Result) || length(metric.Result{1})==1
dicefg_disp(1,'Infeasible MAP(2) fitting. Returning exponential.')
metric.Result = expfit(get_data(metric,metric.ResIndex,metric.ClassIndex));
metric.Result = expfit(trace);
end
end
catch err
Expand Down
9 changes: 4 additions & 5 deletions tests/test2/configuration_val.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,18 @@
<file type='SystemDataFile' path='./tests/test2/test-sysdata.json' />
<file type='SystemClassList' path='./tests/test2/test-sysclasses.json' />
</dataset>
<fitting type='fit-norm' flags=''>
<fitting type='fit-map2' flags=''>
<resource name='resource1' flags=''>
<output handler='uml-marte' path='./tests/test2/model.uml'>
<metric name='qlen' class='class1' confidence='mean' param='$redT' type='hostDemand' />
<metric name='qlen' class='class1' confidence='mean' param='$RT' type='hostDemand' />
</output>
</resource>
</fitting>
<estimation type='est-qmle' flags='warmUp=0'>
<resource name='resource1' flags='numServers=1'>
<output handler='uml-marte' path='./tests/test2/model.uml'>
<metric class='class1' confidence='mean' param='$redT' type='hostDemand' />
<metric class='class1' confidence='upper' param='$RT' type='hostDemand' />
<metric class='class1' confidence='lower' param='$mapT' type='hostDemand' />
<metric class='class1' confidence='mean' param='$mapT' type='hostDemand' />
<metric class='class1' confidence='upper' param='$redT' type='hostDemand' />
</output>
</resource>
</estimation>
Expand Down

0 comments on commit 5d32c0c

Please sign in to comment.