Matlab interface bugfix
This commit is contained in:
@@ -12,9 +12,12 @@ function int = JEInterface(fhandle, datatype, range, varargin)
|
||||
% range: a 2 x dim array defining the solution subspace with lower and
|
||||
% upper bounds; or a scalar defining the bitwidth for binary
|
||||
% problems.
|
||||
% defaultArgs: (optional) additional constant argument to the target
|
||||
% initRange: in analogy to the range: a possibly different range for the
|
||||
% initial solutions. It applies to double and int data types only.
|
||||
% May be set equal to the range.
|
||||
% defaultArgs: additional constant argument to the target
|
||||
% function, empty by default.
|
||||
% options: (optional) options as name-value pairs defining optimization parameters,
|
||||
% options: options as name-value pairs defining optimization parameters,
|
||||
% especially tolerance and maximum function calls.
|
||||
% Check makeOoptions for default settings.
|
||||
%
|
||||
|
@@ -25,16 +25,17 @@ elseif strcmp(int.dataType,eva2.server.go.problems.MatlabProblemDataTypeEnum.typ
|
||||
% integer problem
|
||||
s=sprintf('Real valued problem in %d dimensions and range %s ', int.dim, mat2str(int.range));
|
||||
disp(s);
|
||||
size(int.range)
|
||||
%size(int.range);
|
||||
%x=int.range(1,:)+ceil(rand(1,int.dim).*int.range(2,:)-int.range(1,:));
|
||||
x=(int.range(:,1)+ceil(rand(int.dim,1).*int.range(:,2)-int.range(:,1)))';
|
||||
x=(int.range(:,1)+floor(rand(int.dim,1).*(ones(size(int.range(:,2)))+int.range(:,2)-int.range(:,1))))';
|
||||
else
|
||||
error('Invalid data type in testEvalFunc.m!');
|
||||
end
|
||||
|
||||
if (isempty(int.range))
|
||||
msg=sprintf('\nTesting value: %d, bin.: %s', x, dec2bin(x, int.dim));
|
||||
msg=sprintf('\nTesting binary string %s', x);
|
||||
else
|
||||
msg=sprintf('\nTesting value: %d', x);
|
||||
msg=sprintf('\nTesting value: %s', num2str(x));
|
||||
end
|
||||
disp(msg);
|
||||
|
||||
|
Reference in New Issue
Block a user