Latest JEInterface

This commit is contained in:
Marcel Kronfeld
2008-04-02 12:36:34 +00:00
parent 11258ddbbf
commit 17411d6775
12 changed files with 311 additions and 25 deletions

View File

@@ -1,10 +1,23 @@
function v = getResult(int)
% Returns the optimization solution if the run has been finished, or an
% intermediate solution if the run has not finished yet or an empty array
function [sol, fit] = getResult(int)
% Returns the optimization solution and its fitness if the run has been finished, or an
% intermediate solution and ints fitness if the run has not finished yet or an empty array
% if there is no intermediate solution yet.
% [sol, fit] = getResult(int)
if (isFinished(int))
v = int.result;
sol = int.result;
else
v = int.mp.getIntermediateResult();
end
sol = int.mp.getIntermediateResult();
end
if (isempty(sol))
fit = NaN;
else
if (isempty(int.args))
fit = feval(int.f, sol);
else
fit = feval(int.f, sol, int.args);
end
end
%disp('Fitness: ');
%disp(y);