Skip to content

Commit

Permalink
initial commit with CEC2019 test functions
Browse files Browse the repository at this point in the history
  • Loading branch information
kerschke committed Jun 24, 2019
1 parent e0d5a1f commit 0423e7a
Show file tree
Hide file tree
Showing 22 changed files with 1,417 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ S3method(resetEvaluationCounter,smoof_counting_function)
S3method(resetEvaluationCounter,smoof_wrapped_function)
S3method(shouldBeMinimized,smoof_function)
S3method(shouldBeMinimized,smoof_wrapped_function)
export()
export(addCountingWrapper)
export(addLoggingWrapper)
export(computeExpectedRunningTime)
Expand Down Expand Up @@ -172,6 +173,8 @@ export(makeKeaneFunction)
export(makeKearfottFunction)
export(makeKursaweFunction)
export(makeLeonFunction)
export(makeMMF1Function)
export(makeMMF2Function)
export(makeMOP1Function)
export(makeMOP2Function)
export(makeMOP3Function)
Expand Down
72 changes: 72 additions & 0 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,78 @@ mof_ED_2 <- function(x, m, gamma, theta) {
.Call(`_smoof_mof_ED_2`, x, m, gamma, theta)
}

mof_cec2019_SYM_PART_SIMPLE <- function(x, a, b, c) {
.Call(`_smoof_mof_cec2019_SYM_PART_SIMPLE`, x, a, b, c)
}

mof_cec2019_SYM_PART_ROTATED <- function(x, w, a, b, c) {
.Call(`_smoof_mof_cec2019_SYM_PART_ROTATED`, x, w, a, b, c)
}

mof_cec2019_OMNI_Test <- function(x) {
.Call(`_smoof_mof_cec2019_OMNI_Test`, x)
}

mof_cec2019_mmf1 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf1`, x)
}

mof_cec2019_mmf1_z <- function(x, k) {
.Call(`_smoof_mof_cec2019_mmf1_z`, x, k)
}

mof_cec2019_mmf1_e <- function(x, a) {
.Call(`_smoof_mof_cec2019_mmf1_e`, x, a)
}

mof_cec2019_mmf2 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf2`, x)
}

mof_cec2019_mmf3 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf3`, x)
}

mof_cec2019_mmf4 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf4`, x)
}

mof_cec2019_mmf5 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf5`, x)
}

mof_cec2019_mmf6 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf6`, x)
}

mof_cec2019_mmf7 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf7`, x)
}

mof_cec2019_mmf8 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf8`, x)
}

mof_cec2019_mmf9 <- function(x, np) {
.Call(`_smoof_mof_cec2019_mmf9`, x, np)
}

mof_cec2019_mmf10 <- function(x) {
.Call(`_smoof_mof_cec2019_mmf10`, x)
}

mof_cec2019_mmf11 <- function(x, np) {
.Call(`_smoof_mof_cec2019_mmf11`, x, np)
}

mof_cec2019_mmf12 <- function(x, np, q) {
.Call(`_smoof_mof_cec2019_mmf12`, x, np, q)
}

mof_cec2019_mmf13 <- function(x, np) {
.Call(`_smoof_mof_cec2019_mmf13`, x, np)
}

kursawe <- function(x) {
.Call(`_smoof_kursawe`, x)
}
Expand Down
64 changes: 64 additions & 0 deletions R/mof.SYMPARTrotated.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#' @title
#' MMF13 Function
#'
#' @description
#' Test problem from the set of "multimodal multiobjective functions" as for
#' instance used in the CEC2019 competition.
#'
#' @param w [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{w = pi / 4}.
#' @param a [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{a = 1}.
#' @param b [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{b = 10}.
#' @param c [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{c = 8}.
#'
#' @references
#' Caitong Yue, Boyang Qu, Kunjie Yu, Jing Liang, and Xiaodong Li, "A novel
#' scalable test problem suite for multimodal multiobjective optimization," in
#' Swarm and Evolutionary Computation, Volume 48, August 2019, pp. 62–71, Elsevier.
#' @return [\code{smoof_multi_objective_function}]
#' @export
makeSYMPARTrotatedFunction = function(w = pi / 4, a = 1, b = 10, c = 8) {
assertNumber(x = w, finite = TRUE)
assertNumber(x = a, finite = TRUE)
assertNumber(x = b, finite = TRUE)
assertNumber(x = c, finite = TRUE)
force(w)
force(a)
force(b)
force(c)

# C implementation
fn = function(x) {
assertNumeric(x, len = 2L, any.missing = FALSE, all.missing = FALSE, finite = TRUE)
return(mof_cec2019_SYM_PART_ROTATED(x = x, w = w, a = a, b = b, c = c))
}

n.objectives = 2L
makeMultiObjectiveFunction(
name = "SYMPART-rotated function",
id = sprintf("SYMPART-rotated-%id-%io", 2L, n.objectives),
description = "SYMPART-rotated function",
fn = fn,
par.set = makeNumericParamSet(
len = 2L,
id = "x",
lower = rep(-20, 2L),
upper = rep(20, 2L),
vector = TRUE
),
minimize = rep(TRUE, n.objectives),
n.objectives = n.objectives
)
}

class(makeSYMPARTrotatedFunction) = c("function", "smoof_generator")
attr(makeSYMPARTrotatedFunction, "name") = c("SYMPART-rotated")
attr(makeSYMPARTrotatedFunction, "type") = c("multi-objective")
attr(makeSYMPARTrotatedFunction, "tags") = c("multi-objective")
59 changes: 59 additions & 0 deletions R/mof.SYMPARTsimple.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#' @title
#' MMF13 Function
#'
#' @description
#' Test problem from the set of "multimodal multiobjective functions" as for
#' instance used in the CEC2019 competition.
#'
#' @param a [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{a = 1}.
#' @param b [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{b = 10}.
#' @param c [\code{double}(1)]\cr
#' Parametrizable factor. In the CEC2019 competition, the organizers used
#' \code{c = 8}.
#'
#' @references
#' Caitong Yue, Boyang Qu, Kunjie Yu, Jing Liang, and Xiaodong Li, "A novel
#' scalable test problem suite for multimodal multiobjective optimization," in
#' Swarm and Evolutionary Computation, Volume 48, August 2019, pp. 62–71, Elsevier.
#' @return [\code{smoof_multi_objective_function}]
#' @export
makeSYMPARTsimpleFunction = function(a = 1, b = 10, c = 8) {
assertNumber(x = a, finite = TRUE)
assertNumber(x = b, finite = TRUE)
assertNumber(x = c, finite = TRUE)
force(a)
force(b)
force(c)

# C implementation
fn = function(x) {
assertNumeric(x, len = 2L, any.missing = FALSE, all.missing = FALSE, finite = TRUE)
return(mof_cec2019_SYM_PART_SIMPLE(x = x, a = a, b = b, c = c))
}

n.objectives = 2L
makeMultiObjectiveFunction(
name = "SYMPART-simple function",
id = sprintf("SYMPART-simple-%id-%io", 2L, n.objectives),
description = "SYMPART-simple function",
fn = fn,
par.set = makeNumericParamSet(
len = 2L,
id = "x",
lower = rep(-20, 2L),
upper = rep(20, 2L),
vector = TRUE
),
minimize = rep(TRUE, n.objectives),
n.objectives = n.objectives
)
}

class(makeSYMPARTsimpleFunction) = c("function", "smoof_generator")
attr(makeSYMPARTsimpleFunction, "name") = c("SYMPART-simple")
attr(makeSYMPARTsimpleFunction, "type") = c("multi-objective")
attr(makeSYMPARTsimpleFunction, "tags") = c("multi-objective")
43 changes: 43 additions & 0 deletions R/mof.mmf1.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#' @title
#' MMF1 Function
#'
#' @description
#' Test problem from the set of "multimodal multiobjective functions" as for
#' instance used in the CEC2019 competition.
#'
#' @references
#' Caitong Yue, Boyang Qu, Kunjie Yu, Jing Liang, and Xiaodong Li, "A novel
#' scalable test problem suite for multimodal multiobjective optimization," in
#' Swarm and Evolutionary Computation, Volume 48, August 2019, pp. 62–71, Elsevier.
#' @return [\code{smoof_multi_objective_function}]
#' @export
makeMMF1Function = function() {

# C implementation
fn = function(x) {
assertNumeric(x, len = 2L, any.missing = FALSE, all.missing = FALSE, finite = TRUE)
return(mof_cec2019_mmf1(x = x))
}

n.objectives = 2L
makeMultiObjectiveFunction(
name = "MMF1 function",
id = sprintf("MMF1-%id-%io", 2L, n.objectives),
description = "MMF1 function",
fn = fn,
par.set = makeNumericParamSet(
len = 2L,
id = "x",
lower = c(1, -1),
upper = c(3, 1),
vector = TRUE
),
minimize = rep(TRUE, n.objectives),
n.objectives = n.objectives
)
}

class(makeMMF1Function) = c("function", "smoof_generator")
attr(makeMMF1Function, "name") = c("MMF1")
attr(makeMMF1Function, "type") = c("multi-objective")
attr(makeMMF1Function, "tags") = c("multi-objective")
43 changes: 43 additions & 0 deletions R/mof.mmf10.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#' @title
#' MMF10 Function
#'
#' @description
#' Test problem from the set of "multimodal multiobjective functions" as for
#' instance used in the CEC2019 competition.
#'
#' @references
#' Caitong Yue, Boyang Qu, Kunjie Yu, Jing Liang, and Xiaodong Li, "A novel
#' scalable test problem suite for multimodal multiobjective optimization," in
#' Swarm and Evolutionary Computation, Volume 48, August 2019, pp. 62–71, Elsevier.
#' @return [\code{smoof_multi_objective_function}]
#'
#' @export
makeMMF10Function = function() {
# C implementation
fn = function(x) {
assertNumeric(x, len = 2L, any.missing = FALSE, all.missing = FALSE, finite = TRUE)
return(mof_cec2019_mmf10(x = x))
}

n.objectives = 2L
makeMultiObjectiveFunction(
name = "MMF10 function",
id = sprintf("MMF10-%id-%io", 2L, n.objectives),
description = "MMF10 function",
fn = fn,
par.set = makeNumericParamSet(
len = 2L,
id = "x",
lower = rep(0.1, 2L),
upper = rep(1.1, 2L),
vector = TRUE
),
minimize = rep(TRUE, n.objectives),
n.objectives = n.objectives
)
}

class(makeMMF10Function) = c("function", "smoof_generator")
attr(makeMMF10Function, "name") = c("MMF10")
attr(makeMMF10Function, "type") = c("multi-objective")
attr(makeMMF10Function, "tags") = c("multi-objective")
50 changes: 50 additions & 0 deletions R/mof.mmf11.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#' @title
#' MMF11 Function
#'
#' @description
#' Test problem from the set of "multimodal multiobjective functions" as for
#' instance used in the CEC2019 competition.
#'
#' @param np [\code{integer}(1)]\cr
#' Number of global Pareto sets. In the CEC2019 competition, the organizers used
#' \code{np = 2L}.
#'
#' @references
#' Caitong Yue, Boyang Qu, Kunjie Yu, Jing Liang, and Xiaodong Li, "A novel
#' scalable test problem suite for multimodal multiobjective optimization," in
#' Swarm and Evolutionary Computation, Volume 48, August 2019, pp. 62–71, Elsevier.
#' @return [\code{smoof_multi_objective_function}]
#'
#' @export
makeMMF11Function = function(np = 2L) {
assertInt(x = np, lower = 1L)
force(np)

# C implementation
fn = function(x) {
assertNumeric(x, len = 2L, any.missing = FALSE, all.missing = FALSE, finite = TRUE)
return(mof_cec2019_mmf11(x = x, np = np))
}

n.objectives = 2L
makeMultiObjectiveFunction(
name = "MMF11 function",
id = sprintf("MMF11-%id-%io", 2L, n.objectives),
description = "MMF11 function",
fn = fn,
par.set = makeNumericParamSet(
len = 2L,
id = "x",
lower = rep(0.1, 2L),
upper = rep(1.1, 2L),
vector = TRUE
),
minimize = rep(TRUE, n.objectives),
n.objectives = n.objectives
)
}

class(makeMMF11Function) = c("function", "smoof_generator")
attr(makeMMF11Function, "name") = c("MMF11")
attr(makeMMF11Function, "type") = c("multi-objective")
attr(makeMMF11Function, "tags") = c("multi-objective")
Loading

0 comments on commit 0423e7a

Please sign in to comment.