add_restorable_constraint {restoptr} | R Documentation |
Add constraint to specify the available amount of surface for restoration
Description
Add constraint to a restoration problem (restopt_problem()
) object
to specify specify the available amount of surface for restoration
Usage
add_restorable_constraint(
problem,
min_restore,
max_restore,
min_proportion = 1,
unit = "ha"
)
Arguments
problem |
|
min_restore |
|
max_restore |
|
min_proportion |
|
unit |
|
Details
Given the restorable_habitat
input raster in restopt_problem,
this constraint ensures that the total amount of restorable habitat in
selected planning units is at least min_restore
and at most max_restore
.
The unit of min_restore
and max_restore
can be either in a surface unit handled
by the unit
package, or in number of cells from the original habitat input raster
("cells"). The min_proportion
parameter is a numeric between 0 and 1, and
correspond to the minimum proportion of habitat area that needs to be restored
in the planning unit to consider the planning unit as restored. This proportion
is relative to the area of a planning unit, which is computed automatically
from the input habitat raster. Note that planning unit area is considered
uniform, and the distortion is not corrected. It could be using the cellSize
function of the terra
package, but this function is currently pretty slow
for large rasters. If your problem is at regional scale, the distortion
should be negligible. However, at larger scales, the best is to use an
equal-area projected coordinate system.
Note that when a solution is found, the "maximum restorable habitat" is
displayed, this value does not correspond to the max_restore
parameter,
but to the total area that can be restored in the selected planning units.
The max_restore
parameter is actually an upper bound of the minimum habitat
that needs to be restored to reach the min_proportion
of habitat in every
selected planning units.
Value
An updated restoration problem (restopt_problem()
) object.
See Also
Other constraints:
add_available_areas_constraint()
,
add_compactness_constraint()
,
add_components_constraint()
,
add_connected_constraint()
,
add_locked_out_constraint()
,
add_min_iic_constraint()
,
add_min_mesh_constraint()
Examples
# load data
habitat_data <- rast(
system.file("extdata", "habitat_hi_res.tif", package = "restoptr")
)
# create problem
p <- restopt_problem(
existing_habitat = habitat_data,
aggregation_factor = 16,
habitat_threshold = 0.7
) %>%
add_restorable_constraint(
min_restore = 200,
max_restore = 300,
min_proportion = 0.7
) %>%
add_compactness_constraint(5, unit = "cells")
# print problem
print(p)
# plot preprocessed data
plot(rast(list(get_existing_habitat(p),
get_restorable_habitat(p),
get_locked_out_areas(p))), nc = 3)
# Solve problem
s <- solve(p)
# plot solution
plot(s)