Compile a conservation planning problem into an (potentially mixed) integer linear programming problem.

compile(x, ...)

# S3 method for ConservationProblem
compile(x, compressed_formulation = NA,
...)

## Arguments

x ConservationProblem-class object. not used. logical should the conservation problem compiled into a compressed version of a planning problem? If TRUE then the problem is expressed using the compressed formulation. If FALSE then the problem is expressed using the expanded formulation. If NA, then the compressed is used unless one of the constraints requires the expanded formulation. This argument defaults to NA.

## Value

OptimizationProblem-class object.

## Details

This function might be useful for those interested in understanding how their conservation planning problem is expressed as a mathematical problem. However, if the problem just needs to be solved, then the solve function should just be used.

Please note that in nearly all cases, the default argument to formulation should be used. The only situation where manually setting the argument to formulation is desirable is during testing. Manually setting the argument to formulation will at best have no effect on the problem. At worst, it may result in an error, a misspecified problem, or unnecessarily long solve times.

## Examples

# build minimal conservation problem
p <- problem(sim_pu_raster, sim_features) %>%