R/greedy_heuristic_optimization.R
greedy_heuristic_prioritization.Rd
Generate a prioritization for protected area establishment.
greedy_heuristic_prioritization(
site_data,
feature_data,
site_probability_columns,
site_management_cost_column,
feature_target_column,
total_budget,
site_management_locked_in_column = NULL,
site_management_locked_out_column = NULL
)
sf::sf()
object with site data.
base::data.frame()
object with feature data.
character
names of numeric
columns in the argument to site_data
that contain modeled
probabilities of occupancy for each feature in each site.
Each column should correspond to a different feature, and contain
probability data (values between zero and one). No missing (NA
)
values are permitted in these columns.
character
name of column in the
argument to site_data
that contains costs for managing each
site for conservation. This column should have numeric
values that
are equal to or greater than zero. No missing (NA
) values are
permitted in this column.
character
name of the column in the
argument to feature_data
that contains the \(target\)
values used to parametrize the conservation benefit of managing of each
feature.
This column should have numeric
values that
are equal to or greater than zero. No missing (NA
) values are
permitted in this column.
numeric
maximum expenditure permitted
for conducting surveys and managing sites for conservation.
character
name of the column
in the argument to site_data
that contains logical
(TRUE
/ FALSE
) values indicating which sites should
be locked in for (TRUE
) being managed for conservation or
(FALSE
) not. No missing (NA
) values are permitted in this
column. This is useful if some sites have already been earmarked for
conservation, or if some sites are already being managed for conservation.
Defaults to NULL
such that no sites are locked in.
character
name of the column
in the argument to site_data
that contains logical
(TRUE
/ FALSE
) values indicating which sites should
be locked out for (TRUE
) being managed for conservation or
(FALSE
) not. No missing (NA
) values are permitted in this
column. This is useful if some sites could potentially be surveyed
to improve model predictions even if they cannot be managed for
conservation. Defaults to NULL
such that no sites are locked out.
A list
containing the following elements:
logical
vector indicating if each site is selected for
protection or not.
numeric
value denoting the objective value for
the prioritization.
The prioritization is generated using a greedy heuristic algorithm. The objective function for this algorithm is calculated by: (i) estimating the probability that each species meets its target, and (ii) calculating the sum of these probabilities. Note that this function underpins the value of information calculations because it is used to assess a potential management decision given updated information on the presence of particular species in particular sites.
# set seeds for reproducibility
set.seed(123)
# load example site data
data(sim_sites)
print(sim_sites)
#> Simple feature collection with 6 features and 13 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 0.10513 ymin: 0.04556193 xmax: 0.9764926 ymax: 0.8637977
#> CRS: NA
#> # A tibble: 6 × 14
#> survey_cost management_cost f1 f2 f3 n1 n2 n3 e1 e2
#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 14 102 1 1 1 3 3 3 1.00 -0.848
#> 2 25 90 0 0 0 0 0 0 -1.44 1.27
#> 3 25 165 1 0.6 0 5 5 5 1.25 0.817
#> 4 17 104 0 0 0 0 0 0 -0.484 -0.292
#> 5 18 100 0 0 0 0 0 0 0.0135 0.380
#> 6 15 94 0 0 0 0 0 0 -0.347 -1.33
#> # ℹ 4 more variables: p1 <dbl>, p2 <dbl>, p3 <dbl>, geometry <POINT>
# load example feature data
data(sim_features)
print(sim_features)
#> # A tibble: 3 × 7
#> name survey survey_sensitivity survey_specificity model_sensitivity
#> <chr> <lgl> <dbl> <dbl> <dbl>
#> 1 f1 TRUE 0.954 0.886 0.718
#> 2 f2 TRUE 0.974 0.875 0.705
#> 3 f3 TRUE 0.956 0.823 0.768
#> # ℹ 2 more variables: model_specificity <dbl>, target <dbl>
# set total budget for managing sites for conservation
# (i.e. 50% of the cost of managing all sites)
total_budget <- sum(sim_sites$management_cost) * 0.5
# generate reserve selection prioritization
results <- greedy_heuristic_prioritization(
sim_sites, sim_features,
c("p1", "p2", "p3"),
"management_cost",
"target",
total_budget
)
#> Error in greedy_heuristic_prioritization(sim_sites, sim_features, c("p1", "p2", "p3"), "management_cost", "target", total_budget): could not find function "greedy_heuristic_prioritization"
# print results
print(results)
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 'print': object 'results' not found