function [BestXTable, MinUCI] = minUCIPoint(this, Alpha)
% Attempts to find the feasible point BestXTable that minimizes
% the 100(1-Alpha)% upper confidence interval (UCI) of the
% ObjectiveFcn model.
%

%   Copyright 2016-2022 The MathWorks, Inc.

if isempty(this.ObjectiveFcnModel) || ...
        (this.PrivOptions.NumCoupledConstraints > 0 && any(cellfun(@isempty, this.ConstraintModels)))
    MinUCI = NaN;
    BestXTable = [];
else
    BOOptions = this.PrivOptions;
    BOOptions.MaxIterPerRestart = 40;
    BOOptions.RelTol = 1e-7;
    VarSpec = BOOptions.VarSpec;
    BestX = fminbndGlobal(this, @(X)GPF_UCI_OnPoints(this, X, Alpha), VarSpec.LBTrans, VarSpec.UBTrans, ...
        BOOptions.NumRestartCandidates, BOOptions.NumRestarts, BOOptions.VerboseRestarts, ...
        BOOptions.MaxIterPerRestart, BOOptions.RelTol);
    % XAtMin is not discretized (although it was discretized during optimization)
    BestX = legalizePoints(this, BestX);
    MinUCI = GPF_UCI_OnPoints(this, BestX, Alpha);
    BestXTable = untransformPoints(this, BestX, true);
end
% If none found, revert to the minVisitedUCIPoint
if isempty(BestXTable)
    [BestXTable, MinUCI] = minVisitedUCIPoint(this, Alpha);
end
end
