View source: R/set_no_objective.R
set_no_objective | R Documentation |
Specify that a restoration problem (restopt_problem()
) should satisfy
the constraints without optimization objective.
set_no_objective(problem)
problem |
|
Using set_no_objective() in a restopt problem, the solver will return the first solution found satisfying the constraint, without any optimization objective. This "no objective" setting is set by default when creating a restopt problem.
An updated restoration problem (restopt_problem()
) object.
Other objectives:
set_max_iic_objective()
,
set_max_mesh_objective()
,
set_max_nb_pus_objective()
,
set_max_restore_objective()
,
set_min_nb_patches_objective()
,
set_min_nb_pus_objective()
,
set_min_restore_objective()
## Not run:
# 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
) %>% set_no_objective()
# print problem
print(p)
# Solve problem
s <- solve(p)
# plot solution
plot(s)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.