Add settings to a restoration problem (restopt_problem()) object
to customize the optimization procedure.
Usage
add_settings(
  problem,
  precision = 4,
  time_limit = 0,
  nb_solutions = 1,
  optimality_gap = 0,
  solution_name_prefix = "Solution "
)Arguments
- problem
- restopt_problem()Restoration problem object.
- precision
- integerPrecision for calculations. Defaults to 4.
- time_limit
- integerMaximum permitted run time for optimization (seconds). Defaults to 0.
- nb_solutions
- integerNumber of desired solutions. Defaults to 1.
- optimality_gap
- numericOptimality gap (between 0 and 1). For example, an argument of 0.1 means that solutions should be within 10% of optimality. Defaults to 0, such that optimal solutions are returned.
- solution_name_prefix
- characterPrefix for the name of solutions. Defaults to "Solution "
Value
An updated restoration problem (restopt_problem()) object.
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
  ) %>%
  add_settings(time_limit = 1, precision = 4, nb_solutions = 2)
# print problem
print(p)
} # }
