Closed lucidfrontier45 closed 1 year ago
If you want to add support for time limits, we should store an explicit time_limit: Option<f64>
and not a hashmap<String, Anything>
If you want to add support for time limits, we should store an explicit
time_limit: Option<f64>
and not a hashmap<String, Anything>
No, I don't want to just use time_limit
. I also want to use other options like presolve
, parallel
etc. There are 45 options in total. Writing specific setter for each of them sounds too redundant. That's why I wrote a generic setter in the current PR.
I think you should have specific setters and tests for each of them. And even for each combination of them where it's relevant. It's the only way to guarantee we will not panic at runtime.
@lovasoa
I re-wrote the PR to implement explicit setters for a few HiGHS options.
@lovasoa How about this PR? Is there anything I have to do to merge it?
I added an API to set HiGHS options to the
HighsProblem
struct. This solves #18 .Currently the API is not safe enough, we can still add invalid key and value type. For example
set_option("time_limit".to_string(), 10)
will panic whensolve
method is called. Perhaps I should add explicit APIs likeset_time_limit(value: f64)
. What do you think?