| xegaReRun | R Documentation |
xegaReRun() runs a simple genetic algorithm with
the same configuration as in the run specified by the
list element $GAconfig of the solution of
a simple genetic algorithm. The problem environment and the
the grammar are extracted from the solution object.
If script==TRUE, the solution object and a R script
to rerun xega are written to the current directory.
xegaReRun(solution, script = FALSE, fn = "xegaRunScript", ...)
solution |
The solution of a
previous run of |
script |
Boolean. Default: FALSE. If TRUE, write an R script to repeat the xega run with the command in the solution object. |
fn |
Filename of R script. Default: xegaRunScript.R |
... |
List of named arguments of xega, you want to override. |
xegaReRun() does not capture the configuration for
parallel/distributed processing for the execution model
"FutureApply", because the user defines the configuration
before calling xegaRun().
If executionModel matches neither "Sequential" nor "MultiCore"
or !is.null(uParApply)==TRUE,
a warning is printed, and xegaReRun() attempts the execution, but may fail,
because the set up of the parallel environment has not been performed before xegaReRun.
A list of
$popStat: A matrix with
mean, min, Q1, median, Q3, max, var, mad
of population fitness as columns:
i-th row for i-th each generation.
$fit: Fitness vector if generations<=1 else: NULL.
$solution: With fields
$solution$name,
$solution$fitness,
$solution$value,
$numberOfSolutions,
$solution$genotype,
$solution$phenotype,
$solution$phenotypeValue,
$evalFail: Number of failures of fitness evaluations.
$GAconfig: The configuration of the GA used by xegaReRun().
$GAenv: Attribute value list of GAconfig.
$timer: An attribute value list with
the time used (in seconds) in the main blocks of the GA:
tUsed, tInit, tNext, tEval, tObserve, and tSummary.
Other Main Program:
xegaRun()
a<-xegaRun(Parabola2D, max=FALSE, algorithm="sga", generations=10, popsize=20, verbose=1)
b<-xegaReRun(a)
seqApply<-function(pop, EvalGene, lF) {lapply(pop, EvalGene, lF)}
c<-xegaRun(Parabola2D, max=FALSE, algorithm="sga", uParApply=seqApply)
b<-xegaReRun(c)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.