Learn R Programming

CEGO (version 2.4.3)

designMaxMinDist: Max-Min-Distance Design

Description

Build a design of experiments in a sequential manner: First candidate solution is created at random. Afterwards, candidates are added sequentially, maximizing the minimum distances to the existing candidates. Each max-min problem is resolved by random sampling. The aim is to get a rather diverse design.

Usage

designMaxMinDist(x = NULL, cf, size, control = list())

Value

Returns list with experimental design without duplicates

Arguments

x

Optional list of user specified solutions to be added to the design/population, defaults to NULL

cf

Creation function, creates random new individuals

size

size of the design

control

list of controls. control$distanceFunction requires a distance function to compare two candidates created by cf. control$budget is the number of candidates for the random sampling, defaults to 100.

See Also

optimMaxMinDist, designRandom

Examples

Run this code
# Create a design of 10 permutations, each with n=5 elements, 
# and with 50 candidates for each sample.
# Note, that in this specific case the number of candidates 
# should be no larger than factorial(n).
# The default (hamming distance) is used.
design <- designMaxMinDist(NULL,function()sample(5),10,
		control=list(budget=50))
# Create a design of 20 real valued 2d vectors, 
# with 100 candidates for each sample
# using euclidean distance.
design <- designMaxMinDist(NULL,function()runif(2),20,
	control=list(budget=100,
	distanceFunction=function(x,y)sqrt(sum((x-y)^2))))
# plot the resulting design
plot(matrix(unlist(design),,2,byrow=TRUE))

Run the code above in your browser using DataLab