measurementsResultFunctions: Cost functions by plume-wise summary of values at locations

Description Usage Arguments Value Author(s) Examples

Description

singleDetection is average total dose of non-detected plumes.

multipleDetection is the average fraction of possible additional detections: given a plume can be detected in 10 locations and the given sensors detect it in 3, then the cost would be 7/10; this is averaged over all plumes.

earlyDetection is the average time between the plume entering the area and its detection.

Usage

1
2
3
singleDetection(simulations, locations, plot = FALSE)
multipleDetection(simulations, locations, plot = FALSE)
earlyDetection(simulations, locations, plot = FALSE)  

Arguments

simulations

Simulations object, must contain the required data, see details.

locations

indices of locations, sensor positions

plot

if a map is generated (takes time), only implemented yet for singleDetection, else it is automatically set to FALSE

Value

"cost": global cost "costPlumes": plume-wise intermediate result, not to be interpreted as plume-specific cost

Author(s)

Kristina B. Helle, kristina.helle@uni-muenster.de

Examples

 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
# load data
demo(radioactivePlumes_addProperties)

# define 'min' function without warning for empty sets
min_ = function(x, na.rm = TRUE){
  if (length(x) == 0){ 
    out = Inf
  } else {
    out = min(x, na.rm = na.rm)
  } 
  return(out)
} 

# preprocess data to provide required input  
### earliest possible detection of plume inside the area
radioactivePlumes@plumes$earliestDetection = 
  summaryPlumes(radioactivePlumes, fun = min_, kinds = "time", na.rm = TRUE)[[2]]
  
# sample locations (sensors)
sampleLocations1 = sample.int(nLocations(radioactivePlumes), 10)

# compute cost
singleDetection1 = singleDetection(
  simulations = radioactivePlumes,
  locations = sampleLocations1)
  
multipleDetection1 = multipleDetection(
  simulations = radioactivePlumes,
  locations = sampleLocations1)
  
earlyDetection1 = earlyDetection(
  simulations = radioactivePlumes,
  locations = sampleLocations1)

KristinaHelle/sensors4plumes documentation built on May 7, 2019, 12:31 p.m.