Minor adaptations.

This commit is contained in:
Marcel Kronfeld
2008-04-11 11:39:24 +00:00
parent 50511b0ed5
commit 7633618f59
18 changed files with 180 additions and 84 deletions

View File

@@ -2,6 +2,10 @@ function int=runEvalLoopJE(int, optOrPostProc, optType, outputFilePrefix, steps,
% Internal method starting a JavaEvA optimization loop.
% Calling this directly may interfere with optimization.
% This function handles the communciation between JE and Matlab, main
% optimization configuration is done in the
% optimize/optimizeWith/postProcess functions from which this one should be
% called.
% optOrPostProc: 1 for optimize, 2 for postProcess
% optType, outputFilePrefix are parameters for optimize, dont care when
% postprocessing.
@@ -35,17 +39,19 @@ end
% own stop button). we decide this by checking if the global variable
% stopOptimization is empty. if it is then it is not the toolbox calling
% and we create an own button to stop it.
if isempty(stopOptimization),
% create a cancel button box (case without SBtoolbox)
h=figure('Position',[100 600 250 80], 'MenuBar', 'none', 'Name', 'JavaEvA optimization running...', 'NumberTitle','off');
uicontrol(h,'Style', 'pushbutton', 'String', 'Cancel', 'Position', [25 25 60 30], 'Callback', 'global stopOptimization; stopOptimization=1;');
uicontrol(h,'Style', 'text', 'String', stopText, 'Position', [100 25 120 30]);
drawnow;
% set it to 0 now
if isempty(stopOptimization),
% set switch to 0 now
stopOptimization = 0;
% create a cancel button box (case without SBtoolbox)
boxHandle=figure('Position',[100 600 250 80], 'MenuBar', 'none', 'Name', 'JavaEvA optimization running...', 'NumberTitle','off');
uicontrol(boxHandle,'Style', 'pushbutton', 'String', 'Cancel', 'Position', [25 25 60 30], 'Callback', 'global stopOptimization; stopOptimization=1;');
uicontrol(boxHandle,'Style', 'text', 'String', stopText, 'Position', [100 25 120 30]);
drawnow;
% set flag for non toolbox optimization
nontoolboxopt = 1;
else
% disp('seems like the toolbox is going on');
% its an estimation using the toolbox' parameter estimation thing
nontoolboxopt = 0;
end
@@ -77,10 +83,12 @@ catch
disp('Error in evaluate!');
%int.mediator.quit; % just in case
%int.mediator='';
if (nontoolboxopt == 1)
if (ishandle(h)) , close(h); end
clear global stopOptimization
end
% why should this be done more than once in the end?
%if (nontoolboxopt == 1)
% if (ishandle(int.boxHandle)) , close(int.boxHandle); int.boxHandle=''; end
% clear global stopOptimization
%end
end
% write back results
@@ -94,6 +102,6 @@ int.mediator='';
% and not from the toolboxes parameter estimation function (which has an
% own stop button). we decide this by checking nontoolboxopt
if nontoolboxopt == 1,
if (ishandle(h)) , close(h); end
if (ishandle(boxHandle)) , close(boxHandle); end
clear global stopOptimization
end