# NOT RUN {
##################################
## Optimizing the quartic with noise function
# define Quartic with noise function as objective function
quartic <- function(x){
dim <- length(x)
result <- sum(c(1:dim)*(x^4))+runif(1)
return(result)
}
## Define parameter
numVar <- 5
rangeVar <- matrix(c(-10,10), nrow=2)
PAR <- 0.3
HMCR <- 0.95
bandwith <- 0.05
## calculate the optimum solution using Harmony Search algorithm
resultHS <- HS(quartic, optimType="MIN", numVar, numPopulation=20,
maxIter=100, rangeVar, PAR, HMCR, bandwith)
## calculate the optimum value using quartic with noise function
optimum.value <- quartic(resultHS)
# }
Run the code above in your browser using DataLab