# NOT RUN {
# the function is to be used inside of optimiseSD
# change parameters
optimSD_ssa1 = replaceDefault(
optimiseSD_ssa, newDefaults = list(
start_acc_vG = 0.1,
aimCost = 0,
verbatim = TRUE,
maxIterations = 3000,
maxStableIterations = 500,
maxIterationsJumpBack = 200
),
type = "optimisationFun.optimiseSD")[[1]]
# load data
demo(radioactivePlumes_addProperties)
# define possible, fix, and initial sensors
I = nLocations(radioactivePlumes)
set.seed(22347287)
locDel3 = sample.int(I, 5)
locKeep3 = sample(setdiff(1:I, locDel3), 10)
locAll3 = c(sample(setdiff(1:I,
c(locDel3, locKeep3)), 10), locDel3)
costInitial1 = multipleDetection(simulations = radioactivePlumes,
locations = c(locKeep3, locDel3))
# run optimisation
# }
# NOT RUN {
## takes some time
SDssa = optimiseSD(
simulations = radioactivePlumes,
costFun = multipleDetection,
locationsAll = setdiff(1:nLocations(radioactivePlumes), c(locKeep3, locAll3)),
locationsFix = locKeep3,
locationsInitial = locDel3,
aimCost = 0.05 * costInitial1[[1]],
aimNumber = length(locDel3) + length(locKeep3),
optimisationFun = optimSD_ssa1
)
# }
# NOT RUN {
## this result is also in data(SDssa)
# visualise
data(SDssa)
## cost curve
optimisationCurve(optSD = SDssa, type = "ssa")
## designs
singleDet = replaceDefault(singleDetection,
newDefaults = list(plot = TRUE), type = "costFun.optimiseSD")[[1]]
plotSD(radioactivePlumes,
SD = SDssa[[1]],
locationsFix = locKeep3,
locationsInitial = locDel3,
locationsAll = setdiff(1:nLocations(radioactivePlumes), c(locKeep3, locAll3)),
costMap = singleDet
)
# }
Run the code above in your browser using DataLab