optimMaOEA {MaOEA} | R Documentation |
Elitist Non-dominated Sorting Genetic Algorithm version III
Description
Main interface for the many-objective optimization evolutionary algorithm (MaOEA) package.
Usage
optimMaOEA(
x = NULL,
fun,
solver = NSGA3,
nObjective,
nGeneration = 1,
nVar = nrow(x),
populationSize = ncol(x),
seed = 2000,
control = list(),
...
)
Arguments
x |
The initial population. If not supplied, will be generated using LHS. Column major, each column contain one entry. |
fun |
Objective function being solved. |
solver |
Function name of the solver. Currently available: SMSEMOA, MOCMAES, SMOCMAES, and NSGA3. |
nObjective |
The number of objective functions. A scalar value. |
nGeneration |
Optional, the number of generation the solver should run. |
nVar |
Number of variables, will be used if |
populationSize |
Number of individuals in the population, will be used if |
seed |
random number seed for reproduction of code |
control |
A list, containing the following:
|
... |
Further arguments to be passed to |
Value
Returns a list for the next generation
population
The new generation design points.
populationObjective
The new generation's objective values.
Examples
nVar <- 14
nObjective <- 5
nIndividual <- 100
#control for NSGA3
ctrl <- list(crossoverProbability = 1,
mutationProbability = 1/nVar)
#Initial population can be supplied, like below but for this example, we skip it
#population <- matrix(runif(nIndividual*nVar), nrow = nVar)
numpyready <- reticulate::py_module_available('numpy')
pygmoready <- reticulate::py_module_available('pygmo')
py_module_ready <- numpyready && pygmoready
if(py_module_ready){ # prevent error on testing the example
# Hybrid NSGA-III and SMSEMOA example
# 2 calls for nObjective. 1 for optimMaOEA, 1 for WFG8
# generate initial population and run 10 gen. NSGA-III with standard WFG8 test function.
newPop <- optimMaOEA( , WFG8,NSGA3,nObjective,10,nVar,nIndividual,,ctrl,nObjective)$x
# run 5 generations of SMSEMOA with standard WFG8 test function starting with newPop.
result <- optimMaOEA( newPop, WFG8,SMSEMOA,nObjective,5,,,1000,ctrl,nObjective)
finalPop <- result$x
finalObjective <- result$y
}