Genetic Algorithm for Wind Farm Layout Optimization

The genetic algorithm is designed to optimize wind farms of any shape. It requires a predefined amount of turbines, a unified rotor radius and an average wind speed value for each incoming wind direction. A terrain effect model can be included that downloads an 'SRTM' elevation model and loads a Corine Land Cover raster to approximate surface roughness.


Updates 2.2.1

Performance Tuning / Restructuring

Switch to matrices instead of data.frames and a lot of restructuring and performance optimization of the whole algorithm.

The function genAlgo/windfarmGA and the plotting functions now accept SimpleFeature Polygons or coordinates in table format with long, lat or x, y column names. The terrain effect model can now be activated only by setting topograp to TRUE and it will attempt to download the land cover raster from the European Environment Agency website.

  • viewshed A new set of functions, to analyze the visual impact of a wind farm.
    The new functions for visual assessment are cansee, viewTo, rasterprofile, viewshed, plot_viewshed, interpol_view, getISO3, getDEM
  • plot_farm_3d Experimental rayshader function

Updates 1.2.1


The output of genAlgo or windfarmGA can be further randomized/optimized with the following functions:

  • RandomSearch
  • RandomSearchTurb

RandomSearch is used to randomize all turbines of the layout whereas RandomSearchTurb is used to randomize a single turbine

RandomSearchPlot is used to plot the outputs of those functions, compared with the original result.

load(file = system.file("extdata/resultrect.rda", package = "windfarmGA"))
load(file = system.file("extdata/polygon.rda", package = "windfarmGA"))
Res = RandomSearchTurb(result = resultrect, Polygon1 = polygon, n=10)
RandomSearchPlot(resultRS = Res, result = resultrect, Polygon1 = polygon, best=2)

Updates 1.2

Parallel Processing

## Runs the same optimization, but with parallel processing and 3 cores. 
result_par <- genAlgo(Polygon1 = Polygon1, GridMethod ="h", n=12, Rotor=30,
                 fcrR=5,iteration=10, vdirspe =,crossPart1 = "EQU",
                 selstate="FIX",mutr=0.8, Proportionality = 1,
                 SurfaceRoughness = 0.3, topograp = FALSE,
                 elitism=TRUE, nelit = 7, trimForce = TRUE,
                 referenceHeight = 50,RotorHeight = 100,
                 Parallel = TRUE, numCluster = 3)
PlotWindfarmGA(result = result_par, GridMethod = "h", Polygon1 = Polygon1)

Updates 1.1

Optimization with Hexagonal Grid Cells

result_hex <- genAlgo(Polygon1 = Polygon1, GridMethod ="h", n=12, Rotor=30,
                  fcrR=5,iteration=10, vdirspe =,crossPart1 = "EQU",
                  selstate="FIX",mutr=0.8, Proportionality = 1,
                  SurfaceRoughness = 0.3, topograp = FALSE,
                  elitism=TRUE, nelit = 7, trimForce = TRUE,
                  referenceHeight = 50,RotorHeight = 100)
PlotWindfarmGA(result = result_hex, GridMethod = "h", Polygon1 = Polygon1)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


3.0.0 by Sebastian Gatscha, 2 months ago

Report a bug at

Browse source code at

Authors: Sebastian Gatscha [aut, cre]

Documentation:   PDF Manual  

MIT + file LICENSE license

Imports Rcpp, raster, sf, elevatr, RColorBrewer, calibrate, grDevices, graphics, foreach, parallel, doParallel, magrittr, methods, stats, utils

Suggests testthat, rgdal, rgeos, stars, leaflet, ggplot2, gstat, rworldmap

Linking to Rcpp

See at CRAN