function [tf, ReasonKey] = shouldChooseRandomPoint(this)
%

%   Copyright 2016-2023 The MathWorks, Inc.

tf = false;
ReasonKey = [];
if doingGridsearch(this)
    return;
elseif isequal(this.PrivOptions.AcquisitionFunctionName, 'asha')
    return;
elseif isequal(this.PrivOptions.AcquisitionFunctionName, 'random')
    % AF is 'random'
    tf = true;
    ReasonKey = 'RandomPointRandAcq';
elseif sum(this.ErrorTrain ~= 1) < this.PrivOptions.NumSeedPoints
    % Not enough non-error points
    tf = true;
    ReasonKey = 'RandomPointInsuffSeedPoints';
elseif isempty(this.ObjectiveFcnModel)
    % No Objective model
    tf = true;
    ReasonKey = 'RandomPointNoObjModel';
else
    if shouldChooseRandomPoint(this.ObjectiveFcnModel, this.PrivOptions.SigmaFTol)
        tf = true;
        ReasonKey = 'RandomPointFlatObjModel';
    end
end
end
