www.gusucode.com > mbc 工具箱 matlab 源码程序 > mbc/+mbcdoe/@generator/generator.m

    classdef generator < mbcdoe.designproperties
    %MBCDOE.GENERATOR Generator class for design of experiments
    %
    % A mbcdoe.generator object represents the algorithm to generate
    % a design. The generator does not include any constraints used in a
    % design. Generator is a property of mbcdoe.design. Generator properties
    % can be used as property, value pairs in mbcdoe.design.Generate and
    % mbcdoe.design.Augment.
    %
    % Types = getAlternativeTypes(Generator) returns a list of valid
    % generator types. The list of valid generator types is:
    %
    % Style           Type
    %--------------------------------------------
    % Optimal    	  'D-optimal'
    %                 'V-optimal'
    %                 'A-optimal'
    % Space-filling   'Halton Sequence'
    %                 'Latin Hypercube Sampling'
    %                 'Lattice'
    %                 'Sobol Sequence'
    %                 'Stratified Latin Hypercube'
    % Classical  	  'Box-Behnken'
    %                 'Central Composite'
    %                 'Full Factorial'
    %                 'Plackett-Burman'
    %                 'Regular Simplex'
    %
    % See also mbcdoe.design.Generator, getAlternativeTypes,
    % mbcdoe.design.Generate, mbcdoe.design.Augment 

    %  Copyright 2007-2008 The MathWorks, Inc.
    
    properties (SetAccess=private)
        
        %STYLE Design style (read only)
        %
        %   Valid design styles are:
        %     'User-defined','Optimal','Space-filling','Classical', or
        %     'Experimental data'.
        %
        % See also Type
        Style
    end
    
    
    methods (Hidden)
        function obj = generator(des,varargin)
            obj = obj@mbcdoe.designproperties(des,varargin{:});
        end
        
        function disp(p)
            %DISP
            for i=1:numel(p)
                disp([p(i).Type,' design generator'])
            end
        end
        
    end
        
    methods
        function CLS = get.Style(D)
            %GET.STYLE get style for design
            
            CLSID = DesignType(D.Object);
            switch CLSID
                case 0
                    CLS = 'User-defined';
                case 1
                    CLS = 'Optimal';
                case 2
                    CLS = 'Space-filling';
                case 3
                    CLS = 'Classical';
                case 4
                    CLS = 'Experimental Data';
                otherwise
                    error(message('mbc:mbcdoe:InvalidState'))
            end
            
        end
        
        
        
        function list = getAlternativeTypes(D,Classification)
            %GETALTERNATIVETYPES list of design generator types 
            % 
            % list = getAlternativeTypes(D)
            %   The list is a list of design generator types which could be
            %   used as alternative designs for current design generator.
            % list = getAlternativeTypes(D,Style)
            %   returns a list of design generator types of the specified 
            %   style. The design generator style must be one of
            %   'Space-Filling', 'Classical' or 'Optimal'.
            %
            % See also Type, mbcdoe.generator
            
            if ~isscalar(D)
                error(message('mbc:doe:InvalidState', class( D )))
            end
            D = D(1);
            des = D.Object;
            nf = nfactors(D.Object);
            if nargin>1
                switch Classification
                    case 'Space-Filling'
                        list = mbcdoe.SpaceFillingDesignTypes(nf);
                    case 'Classical'
                        list = mbcdoe.ClassicalDesignTypes(nf);
                    case 'Optimal'
                        if isa(designobj(model(des)),'des_respsurf')
                            list = mbcdoe.OptimalDesignTypes(nf);
                        else 
                            list = {};
                        end
                    otherwise
                        error(message('mbc:doe:InvalidValue23'))
                end

            else
                % standard design types
                des = D.Object;
                if isa(designobj(model(des)),'des_respsurf')
                    list = mbcdoe.OptimalDesignTypes(nf);
                else
                    list = {};
                end
                list = [list
                    mbcdoe.SpaceFillingDesignTypes(nf);
                    mbcdoe.ClassicalDesignTypes(nf)];

            end
        end
    end

    
end