Add a semi-continuous decision to a conservation planning problem(). This is a relaxed decision where a part of a planning unit can be prioritized, as opposed to the entire planning unit, which is the default function (see add_binary_decisions()). This decision is similar to the add_proportion_decisions() function except that it has an upper bound parameter. By default, the decision can range from prioritizing none (0%) to all (100%) of a planning unit. However, an upper bound can be specified to ensure that at most only a fraction (e.g. 80%) of a planning unit can be preserved. This type of decision may be useful when it is not practical to conserve entire planning units.

add_semicontinuous_decisions(x, upper_limit)

## Arguments

x problem() (i.e. ConservationProblem) object. numeric value specifying the maximum proportion of a planning unit that can be reserved (e.g. set to 0.8 for 80%).

## Value

Object (i.e. ConservationProblem) with the decisions added to it.

## Details

Conservation planning problems involve making decisions on planning units. These decisions are then associated with actions (e.g. turning a planning unit into a protected area). If no decision is explicitly added to a problem, then the binary decision class will be used by default. Only a single decision should be added to a ConservationProblem object. Note that if multiple decisions are added to a problem object, then the last one to be added will be used.

## Examples

# set seed for reproducibility
set.seed(500)

data(sim_pu_raster, sim_features, sim_pu_zones_stack, sim_features_zones)

# create minimal problem with semi-continuous decisions
p1 <- problem(sim_pu_raster, sim_features) %>%
# \dontrun{
# solve problem
s1 <- solve(p1)#> Gurobi Optimizer version 9.0.2 build v9.0.2rc0 (linux64)
#> Optimize a model with 5 rows, 90 columns and 450 nonzeros
#> Model fingerprint: 0xa17b0799
#> Coefficient statistics:
#>   Matrix range     [2e-01, 9e-01]
#>   Objective range  [2e+02, 2e+02]
#>   Bounds range     [5e-01, 5e-01]
#>   RHS range        [3e+00, 8e+00]
#> Presolve time: 0.00s
#> Presolved: 5 rows, 90 columns, 450 nonzeros
#>
#> Iteration    Objective       Primal Inf.    Dual Inf.      Time
#>        0    0.0000000e+00   3.170407e+01   0.000000e+00      0s
#>       12    1.9495280e+03   0.000000e+00   0.000000e+00      0s
#>
#> Solved in 12 iterations and 0.00 seconds
#> Optimal objective  1.949528006e+03
# plot solutions
plot(s1, main = "solution")# }
# build multi-zone conservation problem with semi-continuous decisions
p2 <- problem(sim_pu_zones_stack, sim_features_zones) %>%
add_relative_targets(matrix(runif(15, 0.1, 0.2), nrow = 5,
ncol = 3)) %>%
# \dontrun{
# solve the problem
s2 <- solve(p2)#> Gurobi Optimizer version 9.0.2 build v9.0.2rc0 (linux64)
#> Optimize a model with 105 rows, 270 columns and 1620 nonzeros
#> Model fingerprint: 0x2dbebcf2
#> Coefficient statistics:
#>   Matrix range     [2e-01, 1e+00]
#>   Objective range  [2e+02, 2e+02]
#>   Bounds range     [5e-01, 5e-01]
#>   RHS range        [1e+00, 2e+01]
#> Presolve removed 4 rows and 0 columns
#> Presolve time: 0.00s
#> Presolved: 101 rows, 270 columns, 1260 nonzeros
#>
#> Iteration    Objective       Primal Inf.    Dual Inf.      Time
#>        0    0.0000000e+00   1.224911e+02   0.000000e+00      0s
#>       65    1.1040649e+04   0.000000e+00   0.000000e+00      0s
#>
#> Solved in 65 iterations and 0.00 seconds
#> Optimal objective  1.104064912e+04
# print solution
print(s2)#> class      : RasterStack
#> dimensions : 10, 10, 100, 3  (nrow, ncol, ncell, nlayers)
#> resolution : 0.1, 0.1  (x, y)
#> extent     : 0, 1, 0, 1  (xmin, xmax, ymin, ymax)
#> crs        : NA
#> names      : layer.1.1, layer.1.2, layer.1.3
#> min values :         0,         0,         0
#> max values :       0.5,       0.5,       0.5
#>
# plot solution
# panels show the proportion of each planning unit allocated to each zone
plot(s2, axes = FALSE, box = FALSE)# }