# 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.02, 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 {
# create problem with pool portfolio
p3 <- p %>% add_pool_portfolio()
# solve problems and create solution portfolios
s <- list(solve(p1), solve(p2), solve(p3))
# plot solutions from cuts portfolio
plot(stack(s[[1]]), axes = FALSE, box = FALSE)
# plot solutions from shuffle portfolio
plot(stack(s[[2]]), axes = FALSE, box = FALSE)
# plot solutions from pool portfolio
plot(stack(s[[3]]), axes = FALSE, box = FALSE)
# }
Run the code above in your browser using DataLab