Learn R Programming

prioritizr (version 3.0.4)

portfolios: Solution portfolio methods

Description

Conservation planners often desire a portfolio of solutions to present to decision makers. This is because conservation planners often do not have access to "perfect" information, such as cost data that accurately reflects stakeholder preferences, and so having multiple near-optimal solutions can be a useful.

Arguments

Details

All methods for generating portfolios will return solutions that are within the specified optimality gap. Below are the portfolio methods that can be added to a ConservationProblem object.

add_default_portfolio

Generate a single solution.

add_cuts_portfolio

Generate a portfolio of solutions using Bender's cuts.

add_shuffle_portfolio

Generate a portfolio of solutions by randomly reordering the data prior to attempting to solve the problem.

See Also

constraints, decisions, objectives penalties, problem, solvers, targets.

Examples

Run this code
# NOT RUN {
# load data
data(sim_pu_raster, sim_features)

# create problem
p <- problem(sim_pu_raster, sim_features) %>%
     add_min_set_objective() %>%
     add_relative_targets(0.1) %>%
     add_binary_decisions() %>%
     add_default_solver(gap = 0.2, verbose = FALSE)

# create problem with cuts portfolio
p1 <- p %>% add_cuts_portfolio(4)

# create problem with shuffle portfolio
p2 <- p %>% add_shuffle_portfolio(4)
# }
# NOT RUN {
# solve problems and create portfolios of solutions within 20 % of optimality
# using different emthods
s <- list(solve(p1), solve(p2))

# plot solutions from cuts portfolio
plot(s[[1]], axes = FALSE, box = FALSE)

# plot solutions from cuts portfolio
plot(s[[2]], axes = FALSE, box = FALSE)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab