Skip to contents

Retrieve the optimization objective of a restopt problem.

Usage

get_objective(problem)

Arguments

problem

restopt_problem() Restoration problem object.

Value

RestoptObjectve The optimization objective of the restopt problem.

Examples

# \donttest{
#' # load data
habitat_data <- rast(
  system.file("extdata", "habitat_hi_res.tif", package = "restoptr")
)

# create problem
problem <- restopt_problem(
       existing_habitat = habitat_data,
       aggregation_factor = 4,
       habitat_threshold = 0.7
)

get_objective(problem)
#> $name
#> [1] "No optimization objective"
#> 
#> $post
#> function (jproblem, nb_solutions, precision, time_limit, optimality_gap, 
#>     verbose = FALSE, search_strategy = "") 
#> {
#>     rJava::.jcall(jproblem, "Ljava/util/List;", "findSolutions", 
#>         nb_solutions, time_limit, verbose, search_strategy)
#> }
#> <bytecode: 0x5ee6ea00ac08>
#> <environment: 0x5ee6ebe0ea78>
#> 
#> attr(,"class")
#> [1] "NoObjective"      "RestoptObjectve"  "RestoptComponent"
# }