Description Usage Arguments Value Author(s) Examples
View source: R/optimiseSD_manual.R
Given a costMap
function and a set of sensors it computes the cost map and plots it. Then the user can interactively add or delete sensors and plot the resulting cost and cost map..
1 2 3 4 5 6 7 | optimiseSD_manual(simulations, costFun,
locationsAll = 1:nLocations(simulations), locationsFix = integer(0),
locationsInitial = integer(0),
aimCost = NA, aimNumber = NA,
nameSave = NA, plot = TRUE, verbatim = FALSE,
costMap = NA, maxIterations = 10,
valuesPlot = integer(0), colors = grey.colors)
|
Some arguments are the same for all optimisation algorithms, they are marked by a *
, for detail see optimiseSD
. Others are directly forwarded to rbga.bin
, they are marked by **
simulations |
|
costFun |
|
locationsAll |
|
locationsFix |
|
locationsInitial |
|
aimCost |
|
aimNumber |
|
nameSave |
|
plot |
|
verbatim |
ignored |
costMap |
A function to return a list of |
maxIterations |
maximal number of iterations to add or delete sensors |
valuesPlot |
names of values in the data associated with the locations of |
colors |
color ramp for plotting - a function like |
A list, the first two entries are common to all optimisation algorithms, they are marked with *
, see optimiseSD
for details.
SD |
|
evaluation |
|
report |
a list of |
Kristina B. Helle, kristina.helle@uni-muenster.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # prepare data and functions
data(radioactivePlumes)
meanFun = function(x){mean(x, na.rm = TRUE)}
spatialSpreadMinDist = replaceDefault(
spatialSpread,
newDefaults = list(
weightByArea = TRUE,
fun = minimalDistance,
fun_R = meanFun),
type = "costFun.optimiseSD"
)[[1]]
radioactivePlumes@locations@data$p1 = getValues(
subset(radioactivePlumes, plumes = 1, kinds = 1)@values)
optimSD_man_minDist = replaceDefault(
optimiseSD_manual,
newDefaults = list(
costMap = spatialSpreadMinDist
)
)[["fun"]]
## Not run:
## interactive optimisation
# inside optimiseSD
optSD_manual1 = optimiseSD(simulations = radioactivePlumes,
costFun = spatialSpreadMinDist,
optimisationFun = optimSD_man_minDist,
locationsFix = seq(1, 2001, 300),
locationsInitial = seq(1, 2001, 70),
locationsAll = setdiff(1:2001, seq(1,2001, 30)))
# directly using optimiseSD_manual
optSD_manual2 = optimiseSD_manual(simulations = radioactivePlumes,
costFun = spatialSpreadMinDist,
costMap = spatialSpreadMinDist,
locationsFix = seq(1, 2001, 300),
locationsInitial = seq(1, 2001, 70),
locationsAll = setdiff(1:2001, seq(1,2001, 30)))
## End(Not run)
## the result of such a manual optimisation is in data(SDmanual)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.