add_connected_constraints: Add connected constraints

Description Usage Arguments Value See Also Examples

Description

Add constraints to a conservation problem to ensure that all selected planning units are spatially connected to each other.

Usage

1

Arguments

x

ConservationProblem-class object.

...

arguments passed to connected_matrix.

Value

ConservationProblem-class object with the constraint added to it.

See Also

constraints for all the available constraints.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# create basic problem
p1 <- problem(sim_pu_raster, sim_features) %>%
  add_min_set_objective() %>%
  add_relative_targets(0.2)

# create problem with added connected constraints
p2 <- p1 %>% add_connected_constraints()


# solve problems
s <- stack(solve(p1), solve(p2))

# plot solutions
plot(s, main=c("basic solution", "connected solution"))

prioritizr/prioritizrutils documentation built on May 25, 2019, 12:20 p.m.