function ObjectiveEvaluationTime = predictObjectiveEvaluationTime(this, XTable)
%PREDICTOBJECTIVEEVALUATIONTIME Predict the objective
%function evaluation runtime at a set of points.
%   ObjectiveEvaluationTime =
%   predictObjectiveEvaluationTime(Results, XTable)
%   returns the posterior mean of ObjectiveEvaluationTime at
%   the points in XTable, according to a Gaussian Process
%   model. ObjectiveEvaluationTime is an N-by-1 vector, given N
%   rows of XTable.
%

%   Copyright 2016-2022 The MathWorks, Inc.

C = bayesoptim.suppressWarnings();
XTable = checkAndPrepareTableForPrediction(this, XTable, 'predictObjectiveEvaluationTime');
if isempty(XTable)
    ObjectiveEvaluationTime = [];
elseif isempty(this.ObjectiveEvaluationTimeModel)
    ObjectiveEvaluationTime = NaN(height(XTable),1);
else
    logObjectiveEvaluationTime = predict(this.ObjectiveEvaluationTimeModel, transformPoints(this, XTable));
    ObjectiveEvaluationTime = exp(logObjectiveEvaluationTime);
end
end
