R/getRefPoint.R

Defines functions getRefPoint.smoof_wrapped_function getRefPoint.smoof_multi_objective_function getRefPoint.smoof_single_objective_function getRefPoint

Documented in getRefPoint

#' Returns the reference point of a multi-objective function.
#'
#' @template arg_smoof_function
#' @return [\code{numeric}]
#' @note Keep in mind, that this method makes sense only for multi-objective target functions.
#' @export
getRefPoint = function(fn) {
  UseMethod("getRefPoint")
}

#' @export
getRefPoint.smoof_single_objective_function = function(fn) {
  stopf("No reference point available for single-objective function.")
}

#' @export
getRefPoint.smoof_multi_objective_function = function(fn) {
  return(attr(fn, "ref.point"))
}

#' @export
getRefPoint.smoof_wrapped_function = function(fn) {
  return(getRefPoint(getWrappedFunction(fn)))
}

Try the smoof package in your browser

Any scripts or data that you put into this service are public.

smoof documentation built on March 31, 2023, 11:48 p.m.