classdef gradoptions < modelpack.simoptions
    %modelpack.gradoptions class
    %   modelpack.gradoptions extends modelpack.simoptions.
    %

    %    modelpack.gradoptions properties:
    %       Configuration - Property is of type 'handle'
    %       InitialState - Property is of type 'handle vector'
    %       Outputs - Property is of type 'handle vector'
    %       Description - Property is of type 'ustring'
    %       GradientType - Property is of type 'Model_GradientType enumeration: {'basic','refined'}'
    %       Perturbation - Property is of type 'MATLAB array'
    %
    
    % Copyright 2000-2023 The MathWorks, Inc.

    properties (SetObservable)
        %GRADIENTTYPE Property is of type 'Model_GradientType enumeration: {'basic','refined'}'
        GradientType = 'basic';
        %PERTURBATION Property is of type 'MATLAB array'
        Perturbation = [];
    end


    methods  % constructor block
        function this = gradoptions(model, config, states, outputs, type, perturb)
            % GRADOPTIONS Constructor
            %
            % h = modelpack.gradoptions(model)
            %
            % MODEL is a Model object.

            % Create object

            % No argument constructor call
            if nargin == 0
                return
            end

            % Check model argument
            if ~isempty(model) && ~isa(model, 'modelpack.Model')
                error(message('SLControllib:modelpack:errArgumentType', ...
                    'MODEL', 'modelpack.Model' ));
            end

            % Default arguments
            if (nargin < 2 || isempty(config)),  config  = []; end
            if (nargin < 3 || isempty(states)),  states  = []; end
            if (nargin < 4 || isempty(outputs)), outputs = []; end
            if (nargin < 5 || isempty(type)),    type    = 'basic'; end
            if (nargin < 6 || isempty(perturb)), perturb = [1e-8 1e-1]; end

            % Set invariant properties
            this.Version = 1.0;

            % Set public properties
            this.Configuration = config;
            this.GradientType  = type;
            this.InitialState  = states;
            this.Outputs       = outputs;
            this.Perturbation  = perturb;

        end  % gradoptions

    end  % constructor block

    methods
        function set.GradientType(obj,value)
            % Enumerated DataType = 'Model_GradientType enumeration: {'basic','refined'}'
            value = validatestring(value,{'basic','refined'},'','GradientType');
            obj.GradientType = value;
        end

    end   % set and get functions
end  % classdef

% LocalWords:  GRADIENTTYPE
