LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
saveMetric.m
1function [simElem, simDoc]=saveMetric(self, simElem, simDoc, handles)
2sn = self.getStruct;
3
4% Get exportable classes (handles cache classes and class-switching)
5exportClasses = self.getExportableClasses();
6
7for i=1:size(handles,1)
8 for r=1:size(handles,2)
9 currentPerformanceIndex = handles{i,r};
10 if currentPerformanceIndex.disabled == 0
11 % Skip classes that should not be exported to JMT
12 classIdx = currentPerformanceIndex.class.index;
13 if ~exportClasses(classIdx)
14 continue;
15 end
16
17 performanceNode = simDoc.createElement('measure');
18 performanceNode.setAttribute('alpha', num2str(1 - self.simConfInt,2));
19 performanceNode.setAttribute('name', strcat('Performance_', int2str(i)));
20 % System-level metrics (station is empty) use nodeType=""
21 if isempty(currentPerformanceIndex.station)
22 performanceNode.setAttribute('nodeType', '');
23 performanceNode.setAttribute('referenceNode', '');
24 else
25 performanceNode.setAttribute('nodeType', 'station');
26 performanceNode.setAttribute('referenceNode', currentPerformanceIndex.station.name);
27 end
28 performanceNode.setAttribute('precision', num2str(self.simMaxRelErr,2));
29 performanceNode.setAttribute('referenceUserClass', currentPerformanceIndex.class.name);
30 performanceNode.setAttribute('type', MetricType.toText(currentPerformanceIndex.type));
31 performanceNode.setAttribute('verbose', 'false');
32 simElem.appendChild(performanceNode);
33 end
34 end
35end
36end