# NOT RUN {
## Create a random rectangular shapefile
library(sp)
Polygon1 <- Polygon(rbind(c(4498482, 2668272), c(4498482, 2669343),
c(4499991, 2669343), c(4499991, 2668272)))
Polygon1 <- Polygons(list(Polygon1),1);
Polygon1 <- SpatialPolygons(list(Polygon1))
Projection <- "+init=epsg:3035"
proj4string(Polygon1) <- CRS(Projection)
## Create a uniform and unidirectional wind data.frame and plots the
## resulting wind rose
## Uniform wind speed and single wind direction
wind <- data.frame(ws = 12, wd = 0)
# windrosePlot <- plot_windrose(data = wind, spd = wind$ws,
# dir = wind$wd, dirres=10, spdmax=20)
## Calculate a Grid and an indexed data.frame with coordinates and
## grid cell IDs.
Grid1 <- grid_area(shape = Polygon1,resol = 200,prop = 1);
Grid <- Grid1[[1]]
AmountGrids <- nrow(Grid)
wind <- list(wind, probab = 100)
startsel <- init_population(Grid,10,20);
fit <- fitness(selection = startsel, referenceHeight = 100, RotorHeight=100,
SurfaceRoughness=0.3,Polygon = Polygon1, resol1 = 200,rot=20,
dirspeed = wind, srtm_crop="", topograp=FALSE, cclRaster="",
Parallel = FALSE)
# }
Run the code above in your browser using DataLab