Skip to content

Commit 24030ee

Browse files
authored
Copies resolution from r1 project correctly (#420)
1 parent 00abd3f commit 24030ee

File tree

4 files changed

+19
-0
lines changed

4 files changed

+19
-0
lines changed
40 Bytes
Binary file not shown.
-159 Bytes
Binary file not shown.
-159 Bytes
Binary file not shown.

utilities/misc/r1ToProjectClass.m

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
% Remove defaults
104104
project.removeBackgroundParam(1);
105105
project.removeBackground(1);
106+
project.removeResolutionParam(1);
107+
project.removeResolution(1);
106108
project.removeBulkIn(1);
107109
project.removeBulkOut(1);
108110
project.removeScalefactor(1);
@@ -124,6 +126,23 @@
124126
backParamNames{i});
125127
end
126128

129+
% Set resolutions
130+
resolParamNames = num2cell(arrayfun(@(i) sprintf("Resolution par %d", i), 1:problem.numberOfResolutions));
131+
problem.resolution_constr = fixConstrs(problem.numberOfResolutions, resolParamNames, problem.resolution_constr, problem.resolution, problem.resolution_fityesno);
132+
for i = 1:problem.numberOfResolutions
133+
% Add resolutions parameter
134+
% addResolutionParam <- (name, min, value, max, fit)
135+
project.addResolutionParam(resolParamNames{i}, ...
136+
problem.resolution_constr(i,1), ...
137+
problem.resolution(i), ...
138+
problem.resolution_constr(i,2), ...
139+
logical(problem.resolution_fityesno(i)));
140+
% Add resolution
141+
project.addResolution(problem.resolNames{i}, ...
142+
allowedTypes.Constant.value, ...
143+
resolParamNames{i});
144+
end
145+
127146
% Set bulk in params
128147
problem.nbairs_constr = fixConstrs(problem.numberOfNbas, problem.nbaNames, problem.nbairs_constr, problem.nba, problem.nbairs_fityesno);
129148
for i = 1:problem.numberOfNbas

0 commit comments

Comments
 (0)