# 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(-1.28, 1.28), nrow=2)
## calculate the optimum solution clonal selection algorithm
resultCLONALG <- CLONALG(quartic, optimType="MIN", numVar, numPopulation=20,
maxIter=100, rangeVar)
## calculate the optimum value using quartic with noise function
optimum.value <- quartic(resultCLONALG)
# }
Run the code above in your browser using DataLab