0001
0002
0003
0004
0005
0006 classdef objective_function
0007 properties
0008 descriptor='';
0009 scale_type='none';
0010 scale = 1.;
0011 weight = 1.;
0012 end
0013
0014 methods
0015 function [of]=objective_function(varargin)
0016
0017 switch nargin
0018
0019
0020
0021 case 0
0022
0023
0024
0025 otherwise
0026 if (nargin == 1) && isa(varargin{1},'objective_function')
0027 of=varargin{1};
0028 else
0029 of.descriptor=varargin{1};
0030
0031 if (nargin >= 2)
0032 of.scale_type=varargin{2};
0033 if (nargin >= 3)
0034 of.scale =varargin{3};
0035 if (nargin >= 4)
0036 of.weight =varargin{4};
0037
0038 if (nargin > 4)
0039 warning('objective_function:extra_arg',...
0040 'Extra arguments for object of class ''%s''.',...
0041 class(of));
0042 end
0043 end
0044 end
0045 end
0046 end
0047 end
0048
0049 end
0050 function [desc] =dresp_desc(of)
0051 desc=cell(size(of));
0052 for i=1:numel(of)
0053 desc(i)=cellstr(of(i).descriptor);
0054 end
0055 end
0056 function [stype ]=dresp_stype(of)
0057 stype=cell(size(of));
0058 for i=1:numel(of)
0059 stype(i)=cellstr(of(i).scale_type);
0060 end
0061 end
0062 function [scale] =dresp_scale(of)
0063 scale=zeros(size(of));
0064 for i=1:numel(of)
0065 scale(i)=of(i).scale;
0066 end
0067 end
0068 function [weight]=dresp_weight(of)
0069 weight=zeros(size(of));
0070 for i=1:numel(of)
0071 weight(i)=of(i).weight;
0072 end
0073 end
0074 function [lower] =dresp_lower(of)
0075 lower=[];
0076 end
0077 function [upper] =dresp_upper(of)
0078 upper=[];
0079 end
0080 function [target]=dresp_target(of)
0081 target=[];
0082 end
0083 end
0084 end