-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparseResultFilenames.m
More file actions
40 lines (34 loc) · 1.34 KB
/
parseResultFilenames.m
File metadata and controls
40 lines (34 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
function [parsed] = parseResultFilenames(resPath, resFormatSpec)
%{
EXAMPLE:
parsed = parseResultFolder();
figure(); histogram(parsed.Iteration, 'BinMethod', 'integers', 'EdgeColor', 'none').';
done = full(sparse(parsed.Iteration, parsed.("Fuel Price ID"), true, max(parsed.Iteration), max(parsed.("Fuel Price ID"))));
figure(); spy(done.'); ylabel('FuelId');
d2 = permute(reshape(done, [], 4, 6), [1,3,2]);
c = lines(4);
hF = figure('Position', [605,212,742,780]); hAx = gobjects(4,1); hT = tiledlayout(hF, 4, 1);
for id = 1:4
hAx(id) = nexttile(hT);
[x,y] = find( d2(:,:,id) );
plot(hAx(id), x, y, '.', 'Color', c(id,:));
title(hAx(id), "Building Type: " + string(BuildingType(id)));
end
xlim(hAx, [0 130]); xticks(hAx, 0:10:130);
ylim(hAx, [1 6]); yticks(hAx, 1:6);
xlabel(hAx, 'Case ID');
ylabel(hAx, 'Fuel Price ID');
grid(hAx, 'on');
%}
arguments
resPath (1,1) string = "../Data/Results";
resFormatSpec (1,1) string = "I%04u_AT%02d_AP%03u_B%1u_F%1u_PSF%4f.mat";
end
% List files
files = struct2table(dir(fullfile(resPath, 'I*.mat')));
% Turn the list into a table
parsed = [files(:,1), array2table(cell2mat(...
cellfun(@(x)sscanf(x, resFormatSpec), files.name, 'UniformOutput', false).')...
.', 'VariableNames', ["Iteration", "Algorithm Type", "Algorithm Parameters ID",...
"Building Type", "Fuel Price ID", "Power Scaling Factor"])];
end