An objective is used to specify the overall goal of a conservation planning problem. All conservation planning problems involve minimizing #' or maximizing some kind of objective. For instance, the planner may require a solution that conserves enough habitat for each species while minimizing the overall cost of the reserve network. Alternatively, the planner may require a solution that maximizes the number of conserved species while ensuring that the cost of the reserve network does not exceed the budget.

Details

Please note that failing to specify an objective before attempting to solve a problem will return an error.

The following objectives can be added to a conservation planning problem:

add_min_set_objective

Minimize the cost of the solution whilst ensuring that all targets are met. This objective is similar to that used in Marxan.

add_max_cover_objective

Represent at least one instance of as many features as possible within a given budget.

add_max_features_objective

Fulfill as many targets as possible while ensuring that the cost of the solution does not exceed a budget.

add_max_phylo_objective

Maximize the phylogenetic diversity of the features represented in the solution subject to a budget.

add_max_utility_objective

Secure as much of the features as possible without exceeding a budget.

See also

Examples

# load data data(sim_pu_raster, sim_features, sim_phylogeny) # create base problem p <- problem(sim_pu_raster, sim_features) %>% add_relative_targets(0.1) # create problem with added minimum set objective p1 <- p %>% add_min_set_objective() # create problem with added maximum coverage objective # note that this objective does not use targets p2 <- p %>% add_max_cover_objective(500) # create problem with added maximum feature representation objective p3 <- p %>% add_max_features_objective(1500) # create problem with added maximum phylogenetic representation objective p4 <- p %>% add_max_phylo_objective(1900, sim_phylogeny) # create problem with added maximum utility objective # note that this objective does not use targets p5 <- p %>% add_max_utility_objective(5000)
# solve problems s <- stack(solve(p1), solve(p2), solve(p3), solve(p4), solve(p5))
#> Optimize a model with 5 rows, 90 columns and 450 nonzeros #> Variable types: 0 continuous, 90 integer (90 binary) #> Coefficient statistics: #> Matrix range [2e-01, 9e-01] #> Objective range [2e+02, 2e+02] #> Bounds range [1e+00, 1e+00] #> RHS range [3e+00, 8e+00] #> Found heuristic solution: objective 2337.9617505 #> Presolve time: 0.00s #> Presolved: 5 rows, 90 columns, 450 nonzeros #> Variable types: 0 continuous, 90 integer (90 binary) #> Presolved: 5 rows, 90 columns, 450 nonzeros #> #> #> Root relaxation: objective 1.931582e+03, 12 iterations, 0.00 seconds #> #> Nodes | Current Node | Objective Bounds | Work #> Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time #> #> 0 0 1931.58191 0 4 2337.96175 1931.58191 17.4% - 0s #> H 0 0 1985.6818841 1931.58191 2.72% - 0s #> #> Explored 1 nodes (12 simplex iterations) in 0.00 seconds #> Thread count was 1 (of 4 available processors) #> #> Solution count 2: 1985.68 2337.96 #> #> Optimal solution found (tolerance 1.00e-01) #> Best objective 1.985681884076e+03, best bound 1.931581908865e+03, gap 2.7245%
#> Warning: ignoring targets since the specified objective function doesn't use targets
#> Optimize a model with 6 rows, 95 columns and 545 nonzeros #> Variable types: 0 continuous, 95 integer (95 binary) #> Coefficient statistics: #> Matrix range [2e-01, 2e+02] #> Objective range [1e-04, 1e+00] #> Bounds range [1e+00, 1e+00] #> RHS range [5e+02, 5e+02] #> Found heuristic solution: objective -0.0000000 #> Presolve removed 1 rows and 1 columns #> Presolve time: 0.00s #> Presolved: 5 rows, 94 columns, 454 nonzeros #> Variable types: 0 continuous, 94 integer (94 binary) #> Presolved: 5 rows, 94 columns, 454 nonzeros #> #> #> Root relaxation: objective 3.999782e+00, 4 iterations, 0.00 seconds #> #> Nodes | Current Node | Objective Bounds | Work #> Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time #> #> 0 0 3.99978 0 2 -0.00000 3.99978 - - 0s #> H 0 0 2.9997849 3.99978 33.3% - 0s #> H 0 0 3.9997816 3.99978 0.00% - 0s #> #> Explored 1 nodes (4 simplex iterations) in 0.00 seconds #> Thread count was 1 (of 4 available processors) #> #> Solution count 3: 3.99978 2.99978 -0 #> #> Optimal solution found (tolerance 1.00e-01) #> Best objective 3.999781560479e+00, best bound 3.999782101660e+00, gap 0.0000% #> Optimize a model with 6 rows, 95 columns and 545 nonzeros #> Variable types: 0 continuous, 95 integer (95 binary) #> Coefficient statistics: #> Matrix range [2e-01, 2e+02] #> Objective range [1e-04, 1e+00] #> Bounds range [1e+00, 1e+00] #> RHS range [2e+03, 2e+03] #> Found heuristic solution: objective -0.0000000 #> Presolve removed 6 rows and 95 columns #> Presolve time: 0.00s #> Presolve: All rows and columns removed #> #> Explored 0 nodes (0 simplex iterations) in 0.00 seconds #> Thread count was 1 (of 4 available processors) #> #> Solution count 1: -0 #> #> Optimal solution found (tolerance 1.00e-01) #> Best objective -0.000000000000e+00, best bound -0.000000000000e+00, gap 0.0000% #> Optimize a model with 14 rows, 103 columns and 567 nonzeros #> Variable types: 0 continuous, 103 integer (103 binary) #> Coefficient statistics: #> Matrix range [2e-01, 2e+02] #> Objective range [5e-06, 9e-01] #> Bounds range [1e+00, 1e+00] #> RHS range [2e+03, 2e+03] #> Found heuristic solution: objective -0.0000000 #> Presolve removed 5 rows and 5 columns #> Presolve time: 0.00s #> Presolved: 9 rows, 98 columns, 557 nonzeros #> Variable types: 0 continuous, 98 integer (98 binary) #> Presolved: 9 rows, 98 columns, 557 nonzeros #> #> #> Root relaxation: objective 4.337104e+00, 26 iterations, 0.00 seconds #> #> Nodes | Current Node | Objective Bounds | Work #> Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time #> #> 0 0 4.33710 0 5 -0.00000 4.33710 - - 0s #> 0 0 4.21288 0 6 -0.00000 4.21288 - - 0s #> H 0 0 2.1552851 4.21288 95.5% - 0s #> 0 0 4.20947 0 7 2.15529 4.20947 95.3% - 0s #> 0 0 4.20920 0 8 2.15529 4.20920 95.3% - 0s #> 0 0 4.20824 0 8 2.15529 4.20824 95.3% - 0s #> 0 0 4.20672 0 8 2.15529 4.20672 95.2% - 0s #> 0 0 4.20663 0 9 2.15529 4.20663 95.2% - 0s #> 0 2 4.15328 0 9 2.15529 4.15328 92.7% - 0s #> H 6 3 2.7445309 3.44216 25.4% 5.0 0s #> H 6 3 2.7445310 3.44216 25.4% 5.0 0s #> #> Cutting planes: #> Cover: 1 #> MIR: 3 #> #> Explored 9 nodes (113 simplex iterations) in 0.03 seconds #> Thread count was 1 (of 4 available processors) #> #> Solution count 4: 2.74453 2.74453 2.15529 -0 #> #> Optimal solution found (tolerance 1.00e-01) #> Best objective 2.744531030426e+00, best bound 2.744531030426e+00, gap 0.0000%
#> Warning: ignoring targets since the specified objective function doesn't use targets
#> Optimize a model with 6 rows, 95 columns and 545 nonzeros #> Variable types: 5 continuous, 90 integer (90 binary) #> Coefficient statistics: #> Matrix range [2e-01, 2e+02] #> Objective range [1e-04, 1e+00] #> Bounds range [1e+00, 7e+01] #> RHS range [5e+03, 5e+03] #> Found heuristic solution: objective -0.0000000 #> Presolve removed 5 rows and 5 columns #> Presolve time: 0.00s #> Presolved: 1 rows, 90 columns, 90 nonzeros #> Variable types: 0 continuous, 90 integer (90 binary) #> Presolved: 1 rows, 90 columns, 90 nonzeros #> #> #> Root relaxation: objective 7.435117e+01, 1 iterations, 0.00 seconds #> #> Nodes | Current Node | Objective Bounds | Work #> Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time #> #> 0 0 74.35117 0 1 -0.00000 74.35117 - - 0s #> H 0 0 74.2352258 74.35117 0.16% - 0s #> #> Explored 1 nodes (1 simplex iterations) in 0.00 seconds #> Thread count was 1 (of 4 available processors) #> #> Solution count 2: 74.2352 -0 #> #> Optimal solution found (tolerance 1.00e-01) #> Best objective 7.423522579251e+01, best bound 7.435116589289e+01, gap 0.1562%
# plot solutions plot(s, axes = FALSE, box = FALSE, main = c("minimum set", "maximum coverage", "maximum representation", "phylogenetic representation", "maximum utility"))