Nothing
#' Print method for SBOA objects
#'
#' Prints a summary of an SBOA optimization result.
#'
#' @param x An object of class \code{"sboa"}.
#' @param ... Additional arguments, ignored.
#'
#' @return The input object, invisibly.
#' @method print sboa
#' @export
print.sboa <- function(x, ...) {
cat("Secretary Bird Optimization Algorithm (SBOA)\n")
cat("Best objective value:", signif(x$value, 6), "\n")
cat("Dimension:", length(x$par), "\n")
cat("Number of iterations:", length(x$convergence), "\n")
invisible(x)
}
#' Plot method for SBOA objects
#'
#' Plots the convergence curve of an SBOA optimization result.
#'
#' @param x An object of class \code{"sboa"}.
#' @param ... Additional graphical arguments passed to \code{graphics::plot()}.
#'
#' @return No return value. Called for its side effect.
#' @method plot sboa
#' @export
plot.sboa <- function(x, ...) {
graphics::plot(
x$convergence,
type = "l",
xlab = "Iteration",
ylab = "Best objective value",
main = "SBOA Convergence Curve",
...
)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.