plot.jaya {Jaya}R Documentation

Plot Function for Jaya Algorithm Results

Description

This function generates plots for single-objective optimization results from the Jaya algorithm. It visualizes the best objective function value against the number of iterations.

Usage

## S3 method for class 'jaya'
plot(x, ...)

Arguments

x

An object of class jaya containing the optimization results from the jaya function.

...

Additional graphical parameters passed to the plot function.

Details

This function supports plotting results for single-objective optimization. It creates a plot of the best objective function value observed across iterations. Ensure that the input object is from the jaya function.

Examples

# Example: Single-objective optimization
sphere_function <- function(x) sum(x^2)

lower_bounds <- rep(-5, 3)
upper_bounds <- rep(5, 3)
pop_size <- 20
max_iterations <- 50
num_variables <- length(lower_bounds)

# Run optimization
single_result <- jaya(
  fun = sphere_function,
  lower = lower_bounds,
  upper = upper_bounds,
  popSize = pop_size,
  maxiter = max_iterations,
  n_var = num_variables,
  opt = "minimize"
)

# Plot the result
plot(single_result)


[Package Jaya version 1.0.3 Index]