www.gusucode.com > mbcdata 工具箱 matlab 源码程序 > mbcdata/@cgoptim/cgoptim.m

    function obj=cgoptim(varargin)
%CGOPTIM Multi-objective optimization with constraints bookkeeper class
%
%  obj = CGOPTIM
%  obj = CGOPTIM(name)
%  obj = CGOPTIM(name)

%  Copyright 2000-2015 The MathWorks, Inc. and Ford Global Technologies, Inc.

if nargin == 0
    s = i_createstruct;
elseif nargin == 1
    if isstruct(varargin{1})
        % Structure passed in for loading.
        s = varargin{1};
    else
        s = i_createstruct;
        s.OptimSetup = setName(s.OptimSetup, varargin{1});
    end
end

obj = class(s, 'cgoptim');


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function s = i_createstruct


s = struct(...
    'fname'              , '',...  % filename of the optimization script
    'OptimSetup'         , cgoptimextoptions,...  % Stores the optimization capabilities
    'om'                 , [],...                 % used to store utility parameters eg. number of iterations
    'values'             , mbcpointer(0),...      % vector of cgvalues that are free variables
    'Objectives'         , {{}}, ...
    'Constraints'        , {{}}, ...
    'oppoints'           , cgoptimdataset,...     % cgoptimdatasets 
    'SetupGUID'          , guidarray(1),...       % guid that we save initial & fixed values with
    'NumberOfRuns'       , 1,...                  % Number of times to do the optimization
    'V11UpgradeData'     , [], ...                % Structure of data for major load upgrade
    'version'            , 20, ...
    'RunAPIMode'         , 0, ...                 % script API version to assume.  0 (auto), 2, 3.
    'ConstraintEnabled'  , true(1,0),...          % Flag indicating whether each constraint is enabled
    'Scaled'             , false);...              % Boolean indicating whether all optim items will be scaled or not