Description Usage Arguments Details Value Author(s) See Also Examples
Perform multiple COBRA runs. Each run starts with a different seed so that a different start point, a different initial design and different random restarts are choosen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
fn |
objective function that is to be minimized, should return a vector of the objective function value and the constraint values |
lower |
lower bound of search space |
upper |
upper bound of search space |
nrun |
[10] number of runs |
feval |
[200] function evaluations per run |
funcName |
["GXX"] name of the problem |
fName |
the results ( |
path |
[NULL] optional path |
cobra |
[NULL] list with COBRA settings. If NULL, initialize |
optim |
[NULL] the true optimum (or best known value) of the problem (only for diagnostics) |
target |
[0.05] a single run meets the target, if the final error is smaller than |
saveRdata |
[FALSE] if TRUE, save results (dfAll,optim,target,fName,funcName) on |
ylim |
the y limits |
plotPDF |
[FALSE] if TRUE, plot not only to current graphics device but
to |
startSeed |
[41] after each run the seed is incremented by 1, starting with |
Side effect: An error plot showing each run and the mean and median of all runs (see
multiRunPlot
). The results (dfAll
and others) are saved to
<fName>.Rdata
.
mres
, a list containing
|
the settings and results from last run |
|
a data frame with a result summary for all runs (see below) |
|
a vector containing for each run the ever-best feasible objective value |
|
a data frame containing for each run the minimum error
(if |
The data frame dfAll
contains one row per iteration with columns (among others)
fitness function calls (i.e. the iterations cobra$iter
)
true fitness function value
surrogate fitness function value
is current iterate feasible on the true constraints?
number of evaluations of the internal optimizer on the surrogate functions
(NA
if it is a repairInfeasible-step)
the DRC element used in the current iteration
the ever-best feasible fitness function value
the number of the current run
the solution in (original) input space
Wolfgang Konen, Samineh Bagheri, Cologne University of Applied Sciences
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## solve G11 problem nrun times and plot the results of all nrun runs
nrun=4
feval=25
## Defining the constrained problem (G11)
fn <- function(x) {
y<-x[1]*x[1]+((x[2]-1)^2)
y<-as.numeric(y)
g1 <- as.numeric(+(x[2] - x[1]^2))
return(c(objective=y, g1=g1))
}
funcName="G11"
lower<-c(-1,-1)
upper<-c(+1,+1)
## Initializing and running cobra
cobra <- cobraInit(xStart=c(0,0), fn=fn, fName=funcName, lower=lower, upper=upper,
feval=feval, initDesPoints=3*2, DOSAC=1, cobraSeed=1)
mres <- multiCOBRA(fn,lower,upper,nrun=nrun,feval=feval,optim=0.75
,cobra=cobra,funcName=funcName
,ylim=c(1e-12,1e-0),plotPDF=FALSE,startSeed=42)
## There are two true solutions at
## solu1 = c(-sqrt(0.5),0.5) and solu2 = c(+sqrt(0.5),0.5)
## where the true optimum is f(solu1) = f(solu2) = -0.75
## The solution from SACOBRA is close to one of the true solutions:
print(getXbest(mres$cobra))
print(getFbest(mres$cobra))
print(mres$z2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.