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

Allowing constant objective function #80

Merged
merged 12 commits into from
Jun 29, 2020
Merged

Allowing constant objective function #80

merged 12 commits into from
Jun 29, 2020

Conversation

kibaekkim
Copy link
Collaborator

No description provided.

@kibaekkim kibaekkim requested a review from blegat June 5, 2020 21:42
@kibaekkim kibaekkim changed the title fix #79 Allowing constant objective function Jun 5, 2020
@kibaekkim
Copy link
Collaborator Author

It is strange that Real <: AbstractJuMPScalar returns false. This could have been addressed in JuMP. But, this commit would resolve that.

@blegat
Copy link
Collaborator

blegat commented Jun 7, 2020

Real is not an AbstractJuMPScalar as it does not corresponds to any MOI scalar function.
We should rather do as in jump-dev/JuMP.jl#2247

@kibaekkim
Copy link
Collaborator Author

Real is not an AbstractJuMPScalar as it does not corresponds to any MOI scalar function.
We should rather do as in jump-dev/JuMP.jl#2247

@blegat Can you elaborate a bit more about your suggestion? Is this comment on b25afc9?
My fix was base on https://github.com/jump-dev/JuMP.jl/blob/release-0.21/src/objective.jl#L107-L114

@blegat
Copy link
Collaborator

blegat commented Jun 17, 2020

Add a method

function JuMP.set_objective_function(m::StructuredModel, f::Real)
    JuMP.set_objective_function(m, convert(AffExpr, f))
end

It should work once jump-dev/JuMP.jl#2247 is merged. We should do a patch release of JuMP including this PR soon so that won't block this PR for long

@kibaekkim
Copy link
Collaborator Author

@blegat can you check if the changes are compatible to the PR?

@kibaekkim kibaekkim linked an issue Jun 18, 2020 that may be closed by this pull request
src/StructJuMP.jl Outdated Show resolved Hide resolved
src/StructJuMP.jl Outdated Show resolved Hide resolved
@blegat
Copy link
Collaborator

blegat commented Jun 19, 2020

Add in Project.toml that we require at least JuMP v0.21.3

@kibaekkim kibaekkim linked an issue Jun 20, 2020 that may be closed by this pull request
@kibaekkim
Copy link
Collaborator Author

@blegat any other concerns or suggestions?

@kibaekkim kibaekkim merged commit 1976d8c into master Jun 29, 2020
@kibaekkim kibaekkim deleted the kibaekkim-patch-1 branch July 1, 2020 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

constant objective function Benders_pmap.jl broken
2 participants