function TF = exploitingTooMuch(this, X)
% X is a design matrix. TF is a logical vector. TF(i)=true if
% the function std is less than alpha times the noise std at
% the point X(i,:).
%
% "You can't overexploit an infeasible point": If X is being
% evaluated for overexploitation, then it has been chosen by
% the AF as the most desirable point. If this point is not
% known to be feasible, then there is something to be gained by
% evaluating it. We need to know whether it is feasible or not.
%

%   Copyright 2016-2022 The MathWorks, Inc.

if isempty(this.ObjectiveFcnModel)
    TF = false(size(X,1),1);
else
    % Check ObjectiveFcnModel condition
    [~, YSD] = predict(this.ObjectiveFcnModel, X);
    FSD = bayesoptim.funStd(YSD, this.ObjectiveFcnModel.Sigma);

    if strcmp(this.PrivOptions.ModelType,'GaussianProcess') || strcmp(this.PrivOptions.ModelType,'MultiGaussianProcess')
        TF = FSD < this.PrivOptions.ExplorationRatio*this.ObjectiveFcnModel.Sigma;
        % Check feasibility:
        TF = TF && allConstraintsSatisfied(this, X, this.ConstraintModels, this.ErrorModel);
    else
        TF = false(size(X,1),1);
    end

end
end
