Learn R Programming

windfarmGA (version 2.3.0)

plot_result: Plot the best results

Description

Plot the best solutions of the genetic algorithm. Depending on plotEn, either the best energy or efficiency solutions can be plotted. best indicates the amount of best solutions to plot.

Usage

plot_result(
  result,
  Polygon1,
  best = 3,
  plotEn = 1,
  topographie = FALSE,
  Grid,
  Projection,
  sourceCCLRoughness,
  sourceCCL,
  weibullsrc
)

Arguments

result

The output of windfarmGA or genetic_algorithm

Polygon1

The considered area as shapefile

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. If (plotEn==1) plots the best energy solutions and (plotEn==2) plots the best efficiency solutions

topographie

A logical value, indicating whether terrain effects should be considered and plotted or not

Grid

The grid as SpatialPolygons, which is obtained from grid_area and used for plotting

Projection

A desired Projection can be used instead of the default Lambert Azimuthal Equal Area Projection

sourceCCLRoughness

The source to the adapted Corine Land Cover legend as .csv file. Only required when terrain effect model is activated. As default a .csv file within this package (~/extdata/clc_legend.csv) is taken that was already adapted manually

sourceCCL

The source to the Corine Land Cover raster (.tif). Only required, when the terrain effect model is activated

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.

Value

Returns a data.frame of the best (energy/efficiency) individual during all iterations

See Also

Other Plotting Functions: interpol_view(), plot_cloud(), plot_development(), plot_evolution(), plot_fitness_evolution(), plot_heatmap(), plot_parkfitness(), plot_viewshed(), plot_windfarmGA(), plot_windrose(), random_search_single()

Examples

Run this code
# NOT RUN {
## Add some data examples from the package
load(file = system.file("extdata/resultrect.rda", package = "windfarmGA"))
load(file = system.file("extdata/resulthex.rda", package = "windfarmGA"))
load(file = system.file("extdata/polygon.rda", package = "windfarmGA"))

## Plot the results of a hexagonal grid optimization
Grid <- hexa_area(polygon, size = 75, FALSE)
plot_result(resulthex, polygon, best = 1, plotEn = 1, topographie = FALSE,
           Grid = Grid[[2]])

## Plot the results of a rectangular grid optimization
Grid <- grid_area(polygon, resol = 150, 1, FALSE)
plot_result(resultrect, polygon, best = 1, plotEn = 1, topographie = FALSE,
           Grid = Grid[[2]])
# }

Run the code above in your browser using DataLab