# NOT RUN {
# create basic problem
p1 <- problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.2) %>%
add_default_solver()
# create problem with low boundary penalties
p2 <- p1 %>% add_boundary_penalties(5, 1)
# create problem with high boundary penalties but outer edges receive
# half the penalty as inner edges
p3 <- p1 %>% add_boundary_penalties(50, 0.5)
# }
# NOT RUN {
# solve problems
s <- stack(solve(p1), solve(p2), solve(p3))
# plot solutions
plot(s, main = c("basic solution", "small penalties", "high penalties"),
axes = FALSE, box = FALSE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab