add_boundary_penalties: Add boundary penalties

Description Usage Arguments Value See Also Examples

Description

Add penalties to a conservation problem to favor solutions that clump selected planning units together into contiguous reserves.

Usage

1
add_boundary_penalties(x, penalty, edge_factor, boundary_data = NULL)

Arguments

x

ConservationProblem-class object.

penalty

numeric penalty for exposed edges. This is equivalent to the boundary length modifier (BLM) parameter in marxan.net.

edge_factor

numeric proportion to scale edges that do not have any neighboring planning units. For example, an edge factor of 0.5 is commonly used for planning units along the coast line.

boundary_data

matrix, Matrix, or data.frame object showing the shared boundary lengths between planning units. If boundary_data is a matrix then each row and column denote a planning unit and cell values represent their shared boundary. If boundary_data is data.frame then it must have the columns "id1", "id2", and "boundary", where each row shows the shared boundary between two planning units (as per the standard Marxan input format). This argument is required if the planning units in x are stored in a data.frame object. Otherwise, it is optional and the boundary data will be automatically calculated. Note that the boundary_data must be denote symmetric relationships between planning units. If assymetric relaionships are required, use the add_connectivity_penalties function.

Value

ConservationProblem-class object.

See Also

constraints, penalties.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# 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
# receive half the penalty as inner edges
p3 <- p1 %>% add_boundary_penalties(50, 1)


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

# plot solutions
plot(s, main = c("basic solution", "small penalties", "high penalties"))

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