Summary method for class de-class.

# S4 method for de
summary(object, ...)

# S3 method for summary.de
print(x, digits = getOption("digits"), ...)

Arguments

object

an object of class de-class.

x

an object of class summary.de.

digits

number of significant digits.

...

further arguments passed to or from other methods.

Value

The summary function returns an object of class summary.de which can be printed by the corresponding print method. The function also returns invisibly a list with the information from the differential evolution search.

Author

Luca Scrucca

See also

Examples

f <- function(x) abs(x)+cos(x)
DE <- de(fitness = function(x) -f(x), 
         lower = -20, upper = 20, run = 50)
out <- summary(DE)
print(out)
#> ── Differential Evolution ────────────── 
#> 
#> DE settings: 
#> Type                  =  real-valued 
#> Population size       =  10 
#> Number of generations =  100 
#> Elitism               =  0 
#> Stepsize              =  0.8 
#> Crossover probability =  0.5 
#> Mutation probability  =  0 
#> Search domain = 
#>        x1
#> lower -20
#> upper  20
#> 
#> DE results: 
#> Iterations             = 93 
#> Fitness function value = -1 
#> Solution = 
#>      x1
#> [1,]  0
str(out)
#> List of 12
#>  $ type       : chr "real-valued"
#>  $ popSize    : num 10
#>  $ maxiter    : num 100
#>  $ elitism    : int 0
#>  $ stepsize   : num 0.8
#>  $ pcrossover : num 0.5
#>  $ pmutation  : num 0
#>  $ domain     : num [1:2, 1] -20 20
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : chr [1:2] "lower" "upper"
#>   .. ..$ : chr "x1"
#>  $ suggestions: NULL
#>  $ iter       : int 93
#>  $ fitness    : num -1
#>  $ solution   : num [1, 1] 0
#>   ..- attr(*, "dimnames")=List of 2
#>   .. ..$ : NULL
#>   .. ..$ : chr "x1"
#>  - attr(*, "class")= chr "summary.de"