This function optimises a sampling design to achieve minimal cost for a given cost function by applying a given optimisation function. It may take into account fix locations or constrain search to a subset of locations.
optimiseSD(simulations, costFun,
locationsAll = 1:nLocations(simulations), locationsFix = integer(0),
locationsInitial = integer(0),
aimCost = NA, aimNumber = NA,
optimisationFun,
nameSave = NA, plot = FALSE, verbatim = FALSE, ...)Simulations object
cost function, must have parameters simulations and locations (may be prepared by replaceDefault with type = "costFun.optimiseSD"); it must return cost as a single value or a list where this is the first entry
indices of the locations that are considered possible sensor locations, by default these are all locations
indices of locations with fix sensors -- to be considered when computing cost, by default this is empty
indices of locations where sensors are initially; by default this is empty; if not indicated aimNumber random locations may be used, depending on the
limit value of the costFun: the result has to fall below
if no locationsInitial given, it starts from this number of random locations
function that executes an optimisation algorithm; must have parameters simulations, costFun, locationsAll, locationsFix, locationsInitial, aimCost, aimNumber, nameSave (use type = "optimisationFun.optimiseSD" in replaceDefault). Output must be a list with SD (vector, matrix, or list of one or several SDs) and cost (belonging to the SD); it may return other values in report
character path and name (without suffix!) where to save intermediate results (sampling design of each iteration)
if iteration is plotted (currently disabled)
print intermediate results and keep sampling designs and cost of all iterations
further parameters, currently unused
A list
list, each entry is a matrix of the best (lowest cost) sampling designs found of a size - sampling designs in rows; including locationsFix
data.frame, each row belongs to the SD of one size, giving the number of sensors and the cost
list indicating which of the SD fulfil the given aimCost and aimNumber, can be empty if no aims given or aims not reached
algorithm-specific, e.g. all tested SDs etc., see there.
For examples see optimiseSD_genetic, optimiseSD_global, optimiseSD_greedy, optimiseSD_manual,optimiseSD_ssa.