Description Arguments Details Value Examples
Solve a ConservationProblem-class
or an
OptimizationProblem-class
.
a |
|
b |
|
... |
arguments passed to |
If a OptimizationProblem-class
is supplied, then the
solution is returned as a logical
showing the status of each
planning unit. If a ConservationProblem-class
is supplied,
then the solution is returned in the format of the cost data contained
inside it:
RasterLayer-class
the solution is returned as
a RasterLayer-class
object. Cell values denote
the decision.
Spatial-class
the solution is returned as a
SpatialPolygonsDataFrame
or
SpatialLinesDataFrame
with a "Solution" column
containing the decision values.
A RasterLayer-class
,
Spatial-class
, or a numeric
vector containing the
solution depending on the argument to a
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # build minimal conservation problem
p <- problem(sim_pu_raster, sim_features) %>%
add_min_set_objective() %>%
add_relative_targets(0.1) %>%
add_binary_decision()
# solve the problem
s <- solve(p)
# print the solution
print(s)
# plot solution
plot(s, main="solution")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.