terminateRelativeError | R Documentation |
terminateRelativeError()
returns TRUE
if the value of the current solution
is in the interval from (globalOptimum - (globalOptimum*eps)) to
(globalOptimum + (globalOptimum*eps)).
terminateRelativeError(solution, lF)
solution |
A named list with at least the following elements: $name, $fitness, $value, $numberOfSolutions, $genotype, $phenotype, $phenotypeValue. |
lF |
Local function configuration. It must contain
|
Useful for benchmark functions with known global optima.
Note that for a global optimum of 0
this function
fails.
Boolean.
Other Termination Condition:
terminateAbsoluteError()
,
terminateGEQ()
,
terminateLEQ()
,
terminatePAC()
,
terminateRelativeErrorZero()
,
terminatedFalse()
parm<-function(x){function() {return(x)}}
olst<-list(); olst$value<-10
penv<-list(); penv$globalOptimum<-parm(olst)
lF<-list(); lF$penv<-penv; lF$TerminationEps<-parm(1.2);lF$Max<-parm(1.0)
solution<-list(); solution$genotype<-list(); solution$genotype$fit<-8.0
terminateRelativeError(solution, lF)
solution<-list(); solution$genotype<-list(); solution$genotype$fit<-9.6
terminateRelativeError(solution, lF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.