classdef LHSDesignParameterSpace < stats.internal.QuasiRandomParameterSpace
    %LHSDESIGNPARAMETERSPACE 
    %

    % Copyright 2022 The MathWorks, Inc.

    properties(Dependent = true)
        Options
    end

    properties(Access = protected)
        Options_ stats.internal.LHSDesignOptions = stats.internal.LHSDesignOptions
    end

    methods
        function obj = LHSDesignParameterSpace(varargin)
            %LHSDESIGNPARAMETERSPACE 
            %

            if ~license('test','Statistics_Toolbox') || isempty(ver('stats'))
                error(message('stats:sensitivity:general:errSample_LhsDesignStatsNoLicense'))
            end

            obj = obj@stats.internal.QuasiRandomParameterSpace(varargin{:});
        end
        function value = get.Options(obj)
            value = obj.Options_;
        end
        function obj = set.Options(obj,newValue)
            obj.Options_ = newValue;
        end
        function obj = syncOptions(obj,newOptions)
            arguments
                obj stats.internal.LHSDesignParameterSpace
                newOptions stats.internal.LHSDesignOptions
            end
            opts = obj.Options; %To avoid setting obj.Options repeatedly
            opts.Smooth = newOptions.Smooth;
            opts.Criterion = newOptions.Criterion;
            opts.Iterations = newOptions.Iterations;
            obj.Options = opts;
        end
    end

    methods(Access = protected)
        function sampler = createSampler_(obj)
            sampler = stats.internal.sampler.LHSDesignParameterSpace(obj);
        end
    end
end
