Skip to contents

Plot the results of a genetic algorithm run with given inputs. Several plots try to show all relevant effects and outcomes of the algorithm. 6 plot methods are available that can be selected individually.

Usage

plot_windfarmGA(
  result,
  Polygon1,
  whichPl = "all",
  best = 1,
  plotEn = 1,
  weibullsrc
)

Arguments

result

The output of windfarmGA or genetic_algorithm

Polygon1

The considered area as SpatialPolygon, SimpleFeature Polygon or coordinates as matrix/data.frame

whichPl

Which plots should be shown: 1-6 are possible. The default is "all" which shows all available plots

best

A numeric value indicating how many of the best individuals should be plotted

plotEn

A numeric value that indicates if the best energy or efficiency output should be plotted. 1 plots the best energy solutions and 2 plots the best efficiency solutions

weibullsrc

A list of Weibull parameter rasters, where the first list item must be the shape parameter raster `k` and the second item must be the scale parameter raster `a` of the Weibull distribution. If no list is given, then rasters included in the package are used instead, which currently only cover Austria. This variable is only used if weibull = TRUE.

Examples

# \donttest{
library(sf)
Polygon1 <- sf::st_as_sf(sf::st_sfc(
  sf::st_polygon(list(cbind(
    c(4498482, 4498482, 4499991, 4499991, 4498482),
    c(2668272, 2669343, 2669343, 2668272, 2668272)))), 
  crs = 3035
))

## Plot the results of a hexagonal grid optimization
plot_windfarmGA(resulthex, Polygon1, whichPl = "all", best = 1, plotEn = 1)
#> [1] "plot_result: Plot the 'best' Individuals of the GA:"
#> N different optimal configurations: 7 
#> Amount duplicates: 3
#> Plot  1  Best  Energy  Solution:

#> Press [enter] to continue
#> [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"


#> [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"






#> Press [enter] to continue
#> [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"

#> Press [enter] to continue
#> [1] "plot_cloud: Plot all individual Values of the whole Evolution:"

#> Press [enter] to continue
#> [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
#> [inverse distance weighted interpolation]

#> NULL

## Plot the results of a rectangular grid optimization
plot_windfarmGA(resultrect, Polygon1, whichPl = "all", best = 1, plotEn = 1)
#> [1] "plot_result: Plot the 'best' Individuals of the GA:"
#> N different optimal configurations: 108 
#> Amount duplicates: 92
#> Plot  1  Best  Energy  Solution:

#> Press [enter] to continue
#> [1] "plot_evolution: Plot the Evolution of the Efficiency and Energy Values:"


#> [1] "plot_parkfitness: Plot the Influence of Population Size, Selection, Crossover, Mutation:"








#> Press [enter] to continue
#> [1] "plot_fitness_evolution: Plot the Changes in Fitness Values:"

#> Press [enter] to continue
#> [1] "plot_cloud: Plot all individual Values of the whole Evolution:"

#> Press [enter] to continue
#> [1] "plot_heatmap: Plot a Heatmap of all Grid Cells:"
#> [inverse distance weighted interpolation]

#> NULL
# }