New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_semicontinuous_decisions with locked in and locked out contraints fails #59

Closed
jeffreyhanson opened this Issue Feb 8, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@jeffreyhanson
Copy link
Contributor

jeffreyhanson commented Feb 8, 2018

A problem containing semicontinuous decisions, locked in, and locked out constraints will incorrectly think that invalid data has been supplied. Below is a reproducible example:

# load package
library(prioritizr)

# load data
data(sim_pu_raster, sim_features)

# create problem
p <- problem(sim_pu_raster, sim_features) %>%
     add_min_set_objective() %>%
     add_relative_targets(0.1) %>%
     add_locked_in_constraints(sim_locked_in_raster) %>%
     add_locked_out_constraints(sim_locked_out_raster) %>%
     add_semicontinuous_decisions(0.3)

# solve problem
s <- solve(p)
#> Error in compile.ConservationProblem(a, ...) : 
#>   the following planning units have been locked in and locked out:
#> 15212226435052636880
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment