Learn R Programming

CEGO (version 2.0.0)

optimRS: Combinatorial Random Search

Description

Random Search for mixed or combinatorial optimization. Solutions are generated completely at random.

Usage

optimRS(x = NULL, fun, control = list())

Arguments

x
Optional set of solution(s) as a list, which are added to the randomly generated solutions and are also evaluated with the target function.
fun
target function to be minimized
control
(list), with the options budget The limit on number of target function evaluations (stopping criterion) (default: 100) vectorized Boolean. Defines whether target function is vectorized (takes a list of solutions as argument) or n

Value

  • a list: xbest best solution found ybest fitness of the best solution x history of all evaluated solutions y corresponding target function values f(x) count number of performed target function evaluations

See Also

optimCEGO, optimEA

Examples

Run this code
seed=0
glgseed=1
#distance
dF <- distancePermutationHamming
#mutation
mF <- mutationPermutationSwap
#recombination
rF <-  recombinationPermutationCycleCrossover
#creation
cF <- function()sample(5)
#objective function
lF <- landscapeGeneratorUNI(1:5,dF)
#start optimization
set.seed(seed)
res <- optimRS(,lF,list(creationFunction=cF,budget=100,
		vectorized=TRUE)) ##target function is "vectorized", expects list as input
res$xbest

Run the code above in your browser using DataLab