#' Print method for SBOA objects
#'
#' Prints a short summary of an SBOA optimization result.
#'
#' @param x An object of class \code{"sboa"}.
#' @param ... Additional arguments, ignored.
#'
#' @return The input object, invisibly.
#' @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{plot()}.
#'
#' @return No return value. Called for its side effect.
#' @export
plot.sboa <- function(x, ...) {
  plot(
    x$convergence,
    type = "l",
    xlab = "Iteration",
    ylab = "Best objective value",
    main = "SBOA Convergence Curve",
    ...
  )
}
