xegaReRun: Run an evolutionary or genetic algorithm with the same...

View source: R/xegaRerun.R

xegaReRunR Documentation

Run an evolutionary or genetic algorithm with the same configuration as in the previous run.

Description

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.

Usage

xegaReRun(solution, script = FALSE, fn = "xegaRunScript", ...)

Arguments

solution

The solution of a previous run of xegaRun().

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.

Details

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.

Value

A list of

  1. $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.

  2. $fit: Fitness vector if generations<=1 else: NULL.

  3. $solution: With fields $solution$name, $solution$fitness, $solution$value, $numberOfSolutions, $solution$genotype, $solution$phenotype, $solution$phenotypeValue,

  4. $evalFail: Number of failures of fitness evaluations.

  5. $GAconfig: The configuration of the GA used by xegaReRun().

  6. $GAenv: Attribute value list of GAconfig.

  7. $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.

See Also

Other Main Program: xegaRun()

Examples

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)


xega documentation built on Feb. 17, 2026, 5:07 p.m.

Related to xegaReRun in xega...