function this = fitModels(this, useFitMethodNone)
%

%   Copyright 2016-2022 The MathWorks, Inc.

if nargin<2
    useFitMethodNone = false;
end
switch this.PrivOptions.ModelType
    case 'GaussianProcess'
        if isempty(this.ModelStrategy)
            this.ModelStrategy = bayesoptim.GPStrategy();
        end
        this = fitBayesOptModels(this, false, 1, useFitMethodNone);
    case 'MultiGaussianProcess'
        if isempty(this.ModelStrategy)
            this.ModelStrategy = bayesoptim.MultiGPStrategy(this.PrivOptions.GPActiveSetSize);
        end
        this = fitBayesOptModels(this, false, 1, useFitMethodNone);
    case 'SingleTreeBagger'
        if isempty(this.ModelStrategy)
            this.ModelStrategy = bayesoptim.SingleTreeBaggerStrategy();
        end
        this = fitBayesOptModels(this, useFitMethodNone);
    case 'MultiTreeBagger'
        if isempty(this.ModelStrategy)
            this.ModelStrategy = bayesoptim.MultiTreeBaggerStrategy();
        end
        this = fitBayesOptModels(this, useFitMethodNone);
    otherwise
        assert(false);
end
end
