Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion API/controlsClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
% resampleNPoints : whole number, default: 50
% The number of initial points to use for resampling.
% display : displayOptions, default: displayOptions.Iter
% How much RAT should print to the terminal. Can be 'off', 'iter', 'notify', or 'final'.
% How much RAT should print to the terminal. Can be 'off', 'iter', or 'final'.
% updateFreq : whole number, default: 1
% [SIMPLEX, DE] Number of iterations between printing progress updates to the terminal.
% updatePlotFreq : whole number, default: 20
Expand Down
1 change: 0 additions & 1 deletion API/enums/displayOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
enumeration
Off ('off')
Iter ('iter')
Notify ('notify')
Final ('final')
end
end
4 changes: 1 addition & 3 deletions minimisers/simplex/fMinSearch.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
%
msg = 'ok';

defaultopt = struct('Display','notify','MaxIter','200*numberOfVariables',...
defaultopt = struct('Display','iter','MaxIter','200*numberOfVariables',...
'MaxFunEvals','200*numberOfVariables','TolX',1e-4,'TolFun',1e-4, ...
'FunValCheck','off','OutputFcn',[],'PlotFcns',[]);

Expand All @@ -65,8 +65,6 @@
maxiter = optimget(options,'MaxIter',defaultopt,'fast');

switch dis % Changed from TMW fminsearch
case {'notify','notify-detailed'}
prnt = 1;
case {'none','off'}
prnt = 0;
case {'iter','iter-detailed'}
Expand Down
2 changes: 0 additions & 2 deletions minimisers/simplex/runSimplex.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
dis = 'none';
case coderEnums.displayOptions.Iter
dis = 'iter';
case coderEnums.displayOptions.Notify
dis = 'notify';
case coderEnums.displayOptions.Final
dis = 'final';
otherwise
Expand Down
22 changes: 10 additions & 12 deletions tests/testControlsClass.m
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ function testDisplay(testCase)
testCase.verifyEqual(testCase.controls.display, displayOptions.Off.value, 'set.display method is not working')
testCase.controls.display = displayOptions.Iter.value;
testCase.verifyEqual(testCase.controls.display, displayOptions.Iter.value, 'set.display method is not working')
testCase.controls.display = displayOptions.Notify;
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'set.display method is not working')
testCase.verifyError(@setDisplay, exceptions.invalidOption.errorID); % bad display option
function setDisplay
testCase.controls.display = 'any';
Expand Down Expand Up @@ -424,7 +422,7 @@ function testSetProcedureWithDream(testCase)
'numSimulationPoints', 1000,...
'resampleMinAngle', 0.1,...
'resampleNPoints', 10,...
'display', displayOptions.Notify.value);
'display', displayOptions.Final.value);
testCase.verifyEqual(testCase.controls.procedure, procedures.Dream.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.nSamples, 70000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.nChains, 15, 'setProcedure method is not working');
Expand All @@ -436,7 +434,7 @@ function testSetProcedureWithDream(testCase)
testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Final.value, 'setProcedure method is not working');

% Test passing invalid parameter values for dream procedure
testCase.verifyError(@() testCase.controls.setProcedure(procedures.Dream.value, 'boundHandling', 'invalid'), exceptions.invalidOption.errorID);
Expand Down Expand Up @@ -472,7 +470,7 @@ function testSetProcedureWithNS(testCase)
'numSimulationPoints', 1000,...
'resampleMinAngle', 0.1,...
'resampleNPoints', 10,...
'display', displayOptions.Notify.value);
'display', displayOptions.Final.value);
testCase.verifyEqual(testCase.controls.procedure, procedures.NS.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.nLive, 700, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.nMCMC, 5, 'setProcedure method is not working');
Expand All @@ -482,7 +480,7 @@ function testSetProcedureWithNS(testCase)
testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Final.value, 'setProcedure method is not working');

% Test passing wrong parameter for NS procedure
testCase.verifyError(@() testCase.controls.setProcedure(procedures.NS.value, 'funcTolerance', 1e-6), exceptions.invalidOption.errorID); % Simplex Parameter
Expand Down Expand Up @@ -521,7 +519,7 @@ function testSetProcedureWithDE(testCase)
'numSimulationPoints', 1000,...
'resampleMinAngle', 0.1,...
'resampleNPoints', 10,...
'display', displayOptions.Notify.value,...
'display', displayOptions.Final.value,...
'updateFreq', 1,...
'updatePlotFreq', 4);
testCase.verifyEqual(testCase.controls.procedure, procedures.DE.value, 'setProcedure method is not working');
Expand All @@ -535,7 +533,7 @@ function testSetProcedureWithDE(testCase)
testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Final.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.updateFreq, 1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.updatePlotFreq, 4, 'setProcedure method is not working');

Expand Down Expand Up @@ -574,7 +572,7 @@ function testSetProcedureWithSimplex(testCase)
'numSimulationPoints', 1000,...
'resampleMinAngle', 0.1,...
'resampleNPoints', 10,...
'display', displayOptions.Notify.value);
'display', displayOptions.Final.value);
testCase.verifyEqual(testCase.controls.procedure, procedures.Simplex.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.xTolerance, 3e-6, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.funcTolerance, 4e-6, 'setProcedure method is not working');
Expand All @@ -586,7 +584,7 @@ function testSetProcedureWithSimplex(testCase)
testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Final.value, 'setProcedure method is not working');

% Test passing wrong parameter for Simplex procedure
testCase.verifyError(@() testCase.controls.setProcedure(procedures.Simplex.value, 'crossoverProbability', 0.7), exceptions.invalidOption.errorID); % DE Parameter
Expand All @@ -611,13 +609,13 @@ function testSetProcedureWithCalculate(testCase)
'numSimulationPoints', 1000,...
'resampleMinAngle', 0.1,...
'resampleNPoints', 10,...
'display', displayOptions.Notify.value);
'display', displayOptions.Final.value);
testCase.verifyEqual(testCase.controls.procedure, procedures.Calculate.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.parallel, parallelOptions.Contrasts.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.numSimulationPoints, 1000, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleMinAngle, 0.1, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.resampleNPoints, 10, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Notify.value, 'setProcedure method is not working');
testCase.verifyEqual(testCase.controls.display, displayOptions.Final.value, 'setProcedure method is not working');

% Test passing wrong parameter for Calculate procedure
testCase.verifyError(@() testCase.controls.setProcedure(procedures.Calculate.value, 'maxIterations', 100), exceptions.invalidOption.errorID); % Simplex Parameter
Expand Down
Loading