edaRun: Main Loop of an EDA

Description Usage Arguments Details Value References See Also Examples

Description

Main loop of an EDA.

Usage

1
edaRun(eda, f, lower, upper)

Arguments

eda

EDA instance.

f

Objective function.

lower

Lower bounds of the variables of the objective function.

upper

Upper bounds of the variables of the objective function.

Details

EDAs are implemented using S4 classes with generic functions for its main parts: seeding (edaSeed), selection (edaSelect), learning (edaLearn), sampling (edaSample), replacement (edaReplace), local optimization (edaOptimize), termination (edaTerminate), and reporting (edaReport). The following pseudocode illustrates the interactions between all the generic functions. It is a simplified version of the implementation of the edaRun function.

 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
gen <- 0
fEvals <- 0
terminate <- FALSE

while (!terminate) {
  gen <- gen + 1

  if (gen == 1) {
    model <- NULL
    pop <- edaSeed(lower, upper)
    # Set popEval to the evaluation of each solution in pop.
    # Update fEvals.
    r <- edaOptimize(gen, pop, popEval, f, lower, upper)
    pop <- r$pop; popEval <- r$popEval
  } else {
    s <- edaSelect(gen, pop, popEval)
    selectedPop <- pop[s, ]; selectedEval <- popEval[s]
    model <- edaLearn(gen, model, selectedPop, selectedEval,
                      lower, upper)
    sampledPop <- edaSample(gen, model, lower, upper)
    # Set sampledEval to the evaluation of each solution
    # in sampledPop. Update fEvals.
    r <- edaOptimize(gen, sampledPop, sampledEval, f, lower, upper)
    sampledPop <- r$pop; sampledEval <- r$popEval
    r <- edaReplace(gen, pop, popEval, sampledPop, sampledEval)
    pop <- r$pop; popEval <- r$popEval
  }

  edaReport(gen, fEvals, model, pop, popEval)
  terminate <- edaTerminate(gen, fEvals, pop, popEval)
}

Value

An EDAResult instance.

References

Gonzalez-Fernandez Y, Soto M (2014). copulaedas: An R Package for Estimation of Distribution Algorithms Based on Copulas. Journal of Statistical Software, 58(9), 1-34. http://www.jstatsoft.org/v58/i09/.

See Also

EDA, EDAResult, edaIndepRuns.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
setMethod("edaReport", "EDA", edaReportSimple)
setMethod("edaTerminate", "EDA",
    edaTerminateCombined(edaTerminateMaxGen,
        edaTerminateEval))

DVEDA <- VEDA(vine = "DVine", copulas = c("normal"),
    indepTestSigLevel = 0.01, margin = "norm",
    popSize = 200, maxGens = 50, fEval = 0,
    fEvalTol = 1e-03)
DVEDA@name <- "D-vine Estimation of Distribution Algorithm"

result <- edaRun(DVEDA, fSphere, rep(-600, 5), rep(600, 5))

show(result)

yasserglez/copulaedas documentation built on June 9, 2021, 10:05 a.m.