Skip to content
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

solve() fails with new highs version #281

Closed
jeffreyhanson opened this issue May 25, 2023 · 0 comments
Closed

solve() fails with new highs version #281

jeffreyhanson opened this issue May 25, 2023 · 0 comments
Assignees
Labels

Comments

@jeffreyhanson
Copy link
Contributor

The prioritizr package isn't compatible with the latest version of the highs package. When using the latest version of the highs package to solve a problem, we get an error about failed assertions. This is because the highs package now has more strict type checking of input values. See below for a reprex. I'll try and implement a bug fix ASAP.


# load packages
library(prioritizr)
library(highs)

# load data
sim_pu_raster <- get_sim_pu_raster()
sim_features <- get_sim_features()

# create problem
p <-
  problem(sim_pu_raster, sim_features) %>%
  add_min_set_objective() %>%
  add_relative_targets(0.1) %>%
  add_binary_decisions() %>%
  add_highs_solver(verbose = FALSE)

# try to solve problem
solve(p)
#> Error in (function (threads = 1L, time_limit = Inf, log_to_console = FALSE,  : 
#> Assertion on 'log_to_console' failed: Must be of type 'logical', not 'integer'.
#> Timing stopped at: 0.003 0 0.003
@jeffreyhanson jeffreyhanson self-assigned this May 25, 2023
@jeffreyhanson jeffreyhanson changed the title error with new highs version solve() fails with new highs version May 25, 2023
jeffreyhanson added a commit that referenced this issue May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant