From 055a5f9914f9037c67d3598fdd9b8140ae7cb2af Mon Sep 17 00:00:00 2001 From: Mauricio Zambrano-Bigiarini <hzambran@users.noreply.github.com> Date: Tue, 25 Sep 2012 16:19:35 +0000 Subject: [PATCH] 'test\_functions': new test function 'sschwefel1\_2' --- NAMESPACE | 19 ++++++++++--------- NEWS | 13 +++++++------ R/test_functions.R | 16 ++++++++++++++-- man/test_functions.Rd | 9 +++++++-- 4 files changed, 38 insertions(+), 19 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index 9235cfe..534a396 100755 --- a/NAMESPACE +++ b/NAMESPACE @@ -42,20 +42,21 @@ export(hydroPSO, read_results, verification, wquantile, - sphere, - rosenbrock, + ackley, + griewank, rastrigrin, # wrong name, only used for backward compatibility rastrigin, - griewank, + rosenbrock, schafferF6, - ackley, - ssphere, - srosenbrock, - srastrigin, + schwefel + sphere, + sackley, sgriewank, + srastrigin, #schafferF6, - sackley, - sschwefel + srosenbrock, + sschwefel1_2, + ssphere ) S3method(params2ecdf, matrix) diff --git a/NEWS b/NEWS index 315b90a..e8cead8 100755 --- a/NEWS +++ b/NEWS @@ -55,12 +55,13 @@ NEWS/ChangeLog for hydroPSO -) boundary.wall: 'reflecting' in hydroPSO ver <= 0.1-58 is not longer equivalent to 'reflecting' in hydroPSO ver >= 0.1-58 o 'test_functions': -) new benchmark functions: - 'ssphere' : shifted Sphere (CEC 2005), - 'srosenbrock': shifted Rosenbrock (CEC 2005), - 'srastrigin' : shifted Rastrigin (CEC 2005), - 'sgriewank' : shifted Griewank (CEC 2005), - 'sackley' : shifted Ackley (CEC 2005), - 'sschwefel' : shifted Schwefel's Problem 1.2 (CEC 2005) + 'schwefel' : Schwefel function + 'ssphere' : shifted Sphere (CEC 2005), + 'srosenbrock' : shifted Rosenbrock (CEC 2005), + 'srastrigin' : shifted Rastrigin (CEC 2005), + 'sgriewank' : shifted Griewank (CEC 2005), + 'sackley' : shifted Ackley (CEC 2005), + 'sschwefel1_2': shifted Schwefel's Problem 1.2 (CEC 2005) 0.1-58 14-Sep-2012 o 'hydroPSO' : -) 'random.update' is now ONLY used when 'best.update="async". In hydroPSO 0.1-57 'random.update' was set to TRUE diff --git a/R/test_functions.R b/R/test_functions.R index 1fda72d..4785313 100755 --- a/R/test_functions.R +++ b/R/test_functions.R @@ -67,6 +67,18 @@ ackley <- function(x) { } # 'schafferF6' END +# MZB, 25-Sep-2012. Schwefel: f(xi,..,xi)=0, with xi= 420.968746 +# Minimization. In [-500, 500]^n. AcceptableError < +# Properties: Multimodal, Additively separable +# This function is deceptive in that the global minimum is geometrically +# distant, over the parameter space, from the next best local minima. +# Ref: http://www.scribd.com/doc/74351406/7/Schwefel%E2%80%99s-function +schwefel <- function(x) { + n <- length(x) + return( 418.98288727433799*n + sum( -x*sin( sqrt(abs(x)) ) ) ) +} # 'schwefel' END + + ################################################################################ ########################### Shifted Functions ################################## ################################################################################ @@ -127,12 +139,12 @@ srastrigin <- function(x, o=-5+10*runif(length(x)), fbias=-330) { # MZB, 25-Sep-2012. Shifted Schwefel's Problem 1.2 (CEC 2005): f(o,..,o)=-450. # Minimization. In [-100, 100]^n. AcceptableError < 100 # Properties: Unimodal, Shifted, Non-separable, Scalable -sschwefel <- function(x, o=-100+200*runif(length(x)), fbias=-450) { +sschwefel1_2 <- function(x, o=-100+200*runif(length(x)), fbias=-450) { n <- length(x) if (n != length(o)) stop("length(x) != length(o)") z <- x - o return( sum( (cumsum(z))^2 ) + fbias ) -} # 'srastrigin' END +} # 'sschwefel1_2' END #### TODO: find the definition of the rotation matrix M: diff --git a/man/test_functions.Rd b/man/test_functions.Rd index 1e1125c..b422d9b 100755 --- a/man/test_functions.Rd +++ b/man/test_functions.Rd @@ -10,12 +10,13 @@ \alias{rastrigin} \alias{rosenbrock} \alias{schafferF6} +\alias{schwefel} \alias{sphere} \alias{sackley} \alias{sgriewank} \alias{srastrigin} \alias{srosenbrock} -\alias{sschwefel} +\alias{sschwefel1_2} \alias{ssphere} %- Also NEED an '\alias' for EACH other topic documented here. @@ -31,12 +32,13 @@ griewank(x) rastrigrin(x) rosenbrock(x) schafferF6(x) +schwefel(x) sphere(x) sackley(x, o=-32+64*runif(length(x)), fbias=-140) sgriewank(x, o=-600+1200*runif(length(x)), fbias=-180) srastrigin(x, o=-5+10*runif(length(x)), fbias=-330) srosenbrock(x, o=-100+200*runif(length(x)), fbias=390) -sschwefel(x, o=-100+200*runif(length(x)), fbias=-450) +sschwefel1_2(x, o=-100+200*runif(length(x)), fbias=-450) ssphere(x, o=-100+200*runif(length(x)), fbias=-450) } @@ -73,6 +75,9 @@ GEATbx: Example Functions (single and multi-objective functions) \cr Problem Definitions and Evaluation Criteria for the CEC 2005 Special Session on Real-Parameter Optimization \cr \cite{\url{www.lri.fr/~hansen/Tech-Report-May-30-05.pdf}} +Benchmark Problems \cr +\cite{\url{http://www.cs.cmu.edu/afs/cs/project/jair/pub/volume24/ortizboyer05a-html/node6.html}} + \cite{\url{http://www.zsd.ict.pwr.wroc.pl/files/docs/functions.pdf}} } \author{ -- GitLab