After generating a solution to a conservation planning problem(), it can be useful to evaluate how well it performs. These functions can be used to evaluate a solution according to various different summary statistics.

## Details

The following functions can be used to summarize the performance of a solution to a conservation planning problem():

eval_n_summary()

Calculate the number of planning units selected within a solution.

eval_cost_summary()

Calculate the total cost of a solution.

eval_feature_representation_summary()

Calculate how well features are represented by a solution. This function can be used for all problems.

eval_target_coverage_summary()

Calculate how well feature representation targets are met by a solution. This function can only be used with problems contain targets.

eval_boundary_summary()

Calculate the exposed boundary length (perimeter) associated with a solution.

eval_connectivity_summary()

Calculate the connectivity held within a solution.

Other overviews: constraints, decisions, importance, objectives, penalties, portfolios, solvers, targets

## Examples

# load data
data(sim_pu_raster, sim_features)

# create a minimal problem
p <- problem(sim_pu_raster, sim_features) %>%

# \dontrun{
# solve problem
s <- solve(p)

# evaluate number of selected planning units in solution
eval_n_summary(p, s)
#> # A tibble: 1 × 2
#>   summary  cost
#>   <chr>   <dbl>
#> 1 overall    10

# evaluate solution cost
eval_cost_summary(p, s)
#> # A tibble: 1 × 2
#>   summary  cost
#>   <chr>   <dbl>
#> 1 overall 1987.

# evaluate feature representation by solution
eval_feature_representation_summary(p, s)
#> # A tibble: 5 × 5
#>   summary feature total_amount absolute_held relative_held
#>   <chr>   <chr>          <dbl>         <dbl>         <dbl>
#> 1 overall layer.1         83.3          8.91         0.107
#> 2 overall layer.2         31.2          3.13         0.100
#> 3 overall layer.3         72.0          7.34         0.102
#> 4 overall layer.4         42.7          4.35         0.102
#> 5 overall layer.5         56.7          6.01         0.106

# evaluate target coverage by solution
eval_target_coverage_summary(p, s)
#> # A tibble: 5 × 9
#>   feature met   total_amount absolute_target absolute_held absolute_shortfall
#>   <chr>   <lgl>        <dbl>           <dbl>         <dbl>              <dbl>
#> 1 layer.1 TRUE          83.3            8.33          8.91                  0
#> 2 layer.2 TRUE          31.2            3.12          3.13                  0
#> 3 layer.3 TRUE          72.0            7.20          7.34                  0
#> 4 layer.4 TRUE          42.7            4.27          4.35                  0
#> 5 layer.5 TRUE          56.7            5.67          6.01                  0
#> # … with 3 more variables: relative_target <dbl>, relative_held <dbl>,
#> #   relative_shortfall <dbl>

# evaluate exposed boundary (perimeter) length by solution
eval_boundary_summary(p, s)
#> # A tibble: 1 × 2
#>   summary boundary
#>   <chr>      <dbl>
#> 1 overall     2.25

# create a connectivity matrix to describe pair-wise connectivity
# values between combinations of planning units,

# for brevity, we will do this using the cost data
# cost valuers have high connectivity between them
cm <- connectivity_matrix(sim_pu_raster, sim_pu_raster)

# evaluate connectivity of solution
eval_connectivity_summary(p, s, data = cm)
#> # A tibble: 1 × 2
#>   summary connectivity
#>   <chr>          <dbl>
#> 1 overall         198.

# }