Changelog
Source:NEWS.md
windfarmGA 5.0.0
CRAN release: 2026-09-14
Breaking release: layouts are n unique grid-cell IDs, not a 0/1 string.
Breaking
- Genome is
ncell IDs. The loop isselection→set_crossover→swap_mutation→get_grids→fitness.trimtonis not in the loop.selection()returns an ID matrix; pipe it intoset_crossover(), not the old binarycrossover(). - Public API is snake_case:
area,wind,rotor,mutation_rate,selection_mode,crs.plotitis nowplot. Unused loop argscrossPart1andtrimForceare gone. Invalidselection_modeerrors (no interactive prompt). - Defaults that change a run:
selection_mode = "VAR", mutation2/n(was often0.8),n_elite = 3. Session options (inject, immigrants, seasons, local search) also change search behaviour. - Legacy
crossover(),mutation()andtrimton()still accept 0/1 chromosomes. New exports:set_crossover(),swap_mutation(). -
plot_fitness_evolution()is gone (it only calledplot_parkfitness()).
New
- Results have class
windfarmGA(print/plot).ga_options()lists or setsoptions(windfarmGA.*). -
explore_result(): Shiny map of a generation, wind rose, downwind wake cones, optional terrain layers + turbine popups. Click a new fitness max to jump the slider. - Fitness is (E (/100)^w) (
windfarmGA.fitness_efficiency_weight, default 1). Log hub-height profile (power law viawindfarmGA.wind_profile = "power"). Optional manufacturer curve (ga_options(power_curve = …),read_power_curve(),plot_power_curve()).Cpdefault 0.45; optional cut-in / rated / cut-out. - Elitism archives the best layout (no fitness × 10). Elite children, neighbour local search, fitness cache, immigrants, spatial crossover. Early stop only after
stall_generationsidle gens (no new layout, cell, or best). - Terrain: pass a DEM (
terrain = dem) to skip the download. Per-cell height / (z_0) / (k) / air density are computed once and stored asterrainModelforplot_resultandrandom_search. -
random_search()jitters turbines inside their cells (runs). Terrain is reused fromresult; passweibull_srcagain (not stored).plot_random_search()draws both panels on the same grid. - Wake search and circle overlap run in C++. Turbines exactly upwind (
alpha = 0) are kept (old triangle test dropped them). - Wind helpers:
wind_from_uv(),wind_from_series(). GitHub-only extras inexperimental/(ERA5/GWA, noise, rayshader, mapgl) are not in the CRAN tarball.plot_mapgl_from_result()reusesterrain_tiles//terrain.mbtiles, draws wake cones colored byAbschGesamt(0% green → max red) and the rayshader OBJ (wind_turbine_v1.obj). Three.js is r149 UMD from localhost. TileJSON Terrarium encoding;maxzoomis the highest tile folder. Basemaps:satellite,topo, Carto. Port 8000 leftover servers are freed (rebuild = TRUEremakes the tiles). - Plots wait for Enter between pages when interactive.
plot_generation()shows every layout in a generation.plot_viewshed()projects lon/lat DEMs first. -
genetic_algorithm(on_generation = ...)callsfunction(generation, iteration, energy, efficiency, fitness)after each generation so a Shiny app can show progress without forking the GA.wake_cones()is the public name for the downwind search-cone polygons (plot_leaflet, MapGL). Internal geometry iswake_cone_polys().
Fixes
- Weibull speed no longer becomes all-NA after masking (fitness crash).
- Power-curve energy is the park sum, not the first turbine.
-
clc_legend.csvis in the tarball again (.Rbuildignorehad dropped every CSV). -
crossoverparent fitness is(a + b) / 2.isSpatialuses the given CRS, not hardcoded 3035. -
plot_windrose()works with ggplot2 4.x (S7). If ggplot2 4 meets an oldsystemfonts, updatesystemfonts. - Parallel clusters always stop via
on.exit. -
plot_result(terrain = dem)no longer errors on a SpatRaster. Weibull file paths get a CRS before crop. PROJ < 6 branches are gone. -
with_mocked_bindings()intest_coverage_branches.Rwraps the ggplot2-missing checks incode = { … }(testthat requires named bindings).random_search()test usesruns, not the removedn. -
resultrectis the first 50 generations of the old 200-iteration run, saved withxz(~90 KB). A new 50-gen GA is larger becauseallCoordsnow stores a bigger population. -
plot_cell_heatmap()/ga_result_grid()no longer assume a missing CRS is lon/lat. Meter coordinates get the result projection (same asplot_leaflet()). The 4326 round-trip broke the grid on macOS. - Roxygen: unused
@inheritParamsontrimton()andturbine_influences()removed (params were already documented). - Rd help is ASCII-only (
≈,×, em-dash broke the CRAN PDF manual). README no longer links to the archived check-results page (404). - Parallel:
n_clusteris capped at 2 under_R_CHECK_LIMIT_CORES_(R errors onmakeCluster(detectCores() - 1)). Terrain tests no longer need a localg100_06.tif. -
random_search_single(turbine = …)skips the interactive prompt. User-input tests no longer write to a fakestdin. -
stopCluster()is wrapped intry()so a dead worker does not fail the run. Live parallel GA tests skip undercovr. Time sequential vs PSOCK locally withsource("experimental/bench_parallel.R"); bench_parallel(). Windows starts PSOCK workers sequentially;fitness()loads windfarmGA/terra/sf on the workers. The bench catches dropped connections (often at 6–8 workers on this small site). README notes ~4 workers as the useful default on the demo site. -
calculate_energy()uses its public arguments (layout,area,wind, …) instead of internal aliases. Unusedmaxt0in the GA first-generation fuzzy block is gone. -
windata_format()column matching used a brokensapply(grepl, …)(--run-donttestexample). Frames that already havews/wdskip the matcher (soprobabno longer triggers it).
windfarmGA 4.0.0
CRAN release: 2025-01-18
- Depends on R 4.1.0
- Removed package dependencies
rgdalandrgeos - Replaced dependency
rasterwithterra - Moved dependencies
foreach,parallel,doParallel,elevatrto Suggests - 3D-circle intersection calculation. Especially relevant if the terrain model is activated.
- Fix
grid_areaandhexa_areafunctions for sf-1.0 and s2 - Removed most visibility functions in favor of
terra::viewshed - Removed the function
windfarmGA, as it was redundant and just difficult to test. - Changed most
cat()andprint()calls withmessage() - Reset old
parsettings
windfarmGA 3.0.0
CRAN release: 2021-05-05
- The dependencies
sp,spatstatwere removed and replaced bysf. All spatial outputs are now Simple Features. A Shapefile Polygon can still be passed as input togenetic_algorithm/windfarmGA, but more underlying functions now require the Polygon to be of type Simple Feature. - The functions
grid_area&hexa_areaare now calculated withsf::st_make_grid. - The new dependency
elevatrhas been added because it provides elevation data with a higher resolution compared toraster::getData. - Several
dependenciesthat are not essential for the algorithm were moved toSuggests. - Bugfix for the calculation of the visibility analysis. #17
- The
viewshedparameterh1can now also be a numeric vector with different height offsets. #18 - The
grid_areaargumentresolchanged tosize. - The arguments for
get_dist_angleshave changed to match the arguments ofturbine_influences.
windfarmGA 2.3.0
CRAN release: 2020-10-20
-
Due to the changes in the PROJ 6 library and its handling of coordinate reference systems, some adjustments were necessary. Attempts were made to ensure backward compatibility. However, warnings like the following are now increasingly displayed:
windfarmGA 2.2.3
CRAN release: 2019-12-16
Fix tests for R 3.4.0, as class(matrix) is of length 2.
-
Expose more options which can be set with
options(windfarmGA.cT = 0.75):Options = Default value Description windfarmGA.cT = 0.88 Wind Turbine Thrust coefficient windfarmGA.air_rh = 1.225 Air Density Value windfarmGA.k = 0.075 Wake expansion coefficient. It is assumed to be 0.075 for onshore windfarms and 0.05 for offshore windfarms windfarmGA.max_angle = 20 Maximum angle (in degrees) to search for potentially influencing turbines windfarmGA.max_distance = 100000 Maximum distance (in meters) to search for potentially influencing turbines windfarmGA.max_population = 300 Maximum number of individuals per generation windfarmGA.max_selection = 100 Maximum number of selected individuals
windfarmGA 2.2.2
CRAN release: 2019-08-27
Pkgdown
- A pkgdown documentation site is now available.
Renaming Functions
-
Almost all functions have been renamed to have a consistent appearance and a clearer meaning. The old functions still exist, but are deprecated now.
Renaming Overview
Old names New names StartGA init_population selection1 selection crossover1 crossover VekWinkelCalc get_dist_angles calculateEn calculate_energy getRects get_grids BaroHoehe barometric_height GridFilter grid_area HexaTex hexa_area InfluPoints turbine_influences genAlgo genetic_algorithm RandomSearch random_search RandomSearchTurb random_search_single RandomSearchPlot plot_random_search leafPlot plot_leaflet heatmapGA plot_heatmap plotbeorwor plot_development plotCloud plot_cloud plotEvolution plot_evolution plotfitnessevolution plot_fitness_evolution plotparkfitness plot_parkfitness plotResult plot_result PlotWindfarmGA plot_windfarmGA plotWindrose plot_windrose
Bugfixes / Other Changes
The legend of
plot_leafletnow works correctly.Some general linting / spell checking / performance optimization was done.
The Weibull Raster (for Austria) are now in a separate Github-repository, instead of being stored in the package as .rda file. I guess this never worked except on my computer.
The Corine Land Cover .tif file is also stored in that repository, as the EEA webpage did restrict downloads sometimes, which resulted in an error.
The
plot_farm_3dfunction has temporarily been removed from the package.Most functions that required user-input previously used
readlinewhich is now changed toreadLinesas it allows to read from a file instead. This can be set viaoptions(windfarmGA.connection = file()).A whole lot of tests were written.
windfarmGA 2.2.1
CRAN release: 2019-02-18
Performance Tuning / Restructuring
- Switch to matrices instead of data.frames and a lot of restructuring and performance optimization of the whole algorithm.
Viewshed Analysis
- New set of functions, to analyze the visual impact of a wind farm.
-
cansee, -
viewTo, -
rasterprofile, -
viewshed, -
plot_viewshed, -
interpol_view, -
getISO3, getDEM
-
Other Changes
The function
genAlgo/windfarmGAand 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 terrain to TRUE and it will attempt to download the land cover raster from the European Environment Agency website.plot_farm_3dExperimental rayshader function
windfarmGA 1.2.1
CRAN release: 2018-03-25
Randomization
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
RandomSearchTurb is used to randomize a single turbine
RandomSearchPlot is used to plot the output of those functions, comparing them with the original result.
windfarmGA 1.2
CRAN release: 2018-03-11
parallel Processing
## Runs the same optimization, but with parallel processing and 3 cores.
result_par <- genAlgo(area = area, grid_method ="h", n=12, Rotor=30,
fcr=5,iteration=10, wind = data.in,crossPart1 = "EQU",
selection_mode="FIX",mutation_rate=0.8, proportionality = 1,
surface_roughness = 0.3, terrain = FALSE,
elitism=TRUE, n_elite = 7, trimForce = TRUE,
reference_height = 50,rotor_height = 100,
parallel = TRUE, n_cluster = 3)
PlotWindfarmGA(result = result_par, grid_method = "h", area = area)windfarmGA 1.1.0
Optimization with Hexagonal Grid Cells
result_hex <- genAlgo(area = area, grid_method ="h", n=12, Rotor=30,
fcr=5,iteration=10, wind = data.in,crossPart1 = "EQU",
selection_mode="FIX",mutation_rate=0.8, proportionality = 1,
surface_roughness = 0.3, terrain = FALSE,
elitism=TRUE, n_elite = 7, trimForce = TRUE,
reference_height = 50,rotor_height = 100)
PlotWindfarmGA(result = result_hex, grid_method = "h", area = area)