Title: | Jaya, a Gradient-Free Optimization Algorithm |
---|---|
Description: | Maximization or Minimization of a fitness function using Jaya Algorithm (JA). A population based method which repeatedly modifies a population of individual solutions. Capable of solving both constrained and unconstrained optimization problems. It does not contain any hyperparameters. For further details: R.V. Rao (2016) <doi:10.5267/j.ijiec.2015.8.004> . |
Authors: | Mayur Shende [aut], Neeraj Bokde [aut, cre] |
Maintainer: | Neeraj Bokde <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.9 |
Built: | 2024-11-08 02:56:58 UTC |
Source: | https://github.com/neerajdhanraj/jaya |
Jaya Algorithm, a gradient-free optimization algorithm. Maximization of a function using Jaya Algorithm (JA). A population based method which repeatedly modifies a population of individual solutions. Capable of solving both constrained and unconstrained optimization problems. Does not contain any hyperparameters.
jaya(fun, lower, upper, popSize = 50, maxiter, n_var, seed = NULL, suggestions = data.frame(), opt = "minimize")
jaya(fun, lower, upper, popSize = 50, maxiter, n_var, seed = NULL, suggestions = data.frame(), opt = "minimize")
fun |
as a function to be optimized |
lower |
as a vector of lower bounds for the vaiables in the function |
upper |
as a vector of upper bounds for the vaiables in the function |
popSize |
as population size |
maxiter |
as number of iterations to run for finding optimum solution |
n_var |
as number of variables used in the function to optimize |
seed |
as an integer vector containing the random number generator state |
suggestions |
as a data frame of solutions string to be included in the initial population |
opt |
as a string either "maximize" or "minimize" the function |
# Test Function to minimize square <- function(x){return((x[1]^2)+(x[2]^2))} jaya(fun = square, lower = c(-100,-100), upper = c(100,100), maxiter = 10, n_var = 2)
# Test Function to minimize square <- function(x){return((x[1]^2)+(x[2]^2))} jaya(fun = square, lower = c(-100,-100), upper = c(100,100), maxiter = 10, n_var = 2)
#' Function to plot the 'best value' VS 'no. of iterations'
## S3 method for class 'jaya' plot(x, ...)
## S3 method for class 'jaya' plot(x, ...)
x |
as an output object from 'jaya' function |
... |
as Additional graphical parameters given to plot function |
Returns plot showing 'best value' VS 'no. of iterations'
Function to summarize the Jaya function
## S3 method for class 'jaya' summary(object, ...)
## S3 method for class 'jaya' summary(object, ...)
object |
as an output object from 'jaya' function |
... |
Additional parameters given to the function |
returns the summary of output object from 'jaya' function
# Test Function to minimize square <- function(x){return((x[1]^2)+(x[2]^2))} a <- jaya(fun = square, lower = c(-100,-100), upper = c(100,100), maxiter = 10, n_var = 2) summary(a)
# Test Function to minimize square <- function(x){return((x[1]^2)+(x[2]^2))} a <- jaya(fun = square, lower = c(-100,-100), upper = c(100,100), maxiter = 10, n_var = 2) summary(a)