Skip to contents

Specify that a restoration problem (restopt_problem()) should satisfy the constraints without optimization objective.

Usage

set_no_objective(problem)

Arguments

problem

restopt_problem() Restoration problem object.

Value

An updated restoration problem (restopt_problem()) object.

Details

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.

Examples

if (FALSE) { # \dontrun{
# 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)
} # }