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

Allow get to return non-nothing #2370

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Allow get to return non-nothing #2370

merged 1 commit into from
Dec 20, 2023

Conversation

blegat
Copy link
Member

@blegat blegat commented Dec 20, 2023

I looked at how to fix oxfordcontrol/COSMO.jl#185 and it starts being too hacky.
The time limit can be tweaked with two attributes, RawOptimizerAttribute("time_limit") or MOI.TimeLimitSec. Both attribute actually modify the same thing so they are kept in sync. Asking for get to return nothing is maybe a bit too much:

MOI.set(model, RawOptimizerAttribute("time_limit"), 0.0)
MOI.get(model MOI.TimeLimitSec()) # what should this return ?
MOI.set(model, MOI.TimeLimitSec(), nothing)
MOI.get(model MOI.TimeLimitSec()) # returns `nothing`
MOI.set(model, RawOptimizerAttribute("time_limit"), 0.0)
MOI.get(model MOI.TimeLimitSec()) # what should this return ?
MOI.set(model, RawOptimizerAttribute("time_limit"), 1.0)
MOI.get(model MOI.TimeLimitSec()) # what should this return ?

@odow
Copy link
Member

odow commented Dec 20, 2023

I'm okay with this. I've already added it to #2180.

@odow odow merged commit 61baf23 into master Dec 20, 2023
17 checks passed
@odow odow deleted the bl/time_limit_sec branch December 20, 2023 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants