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

GetObjVal can't be called, even though the model has solutions #847

Open
Joao-Dionisio opened this issue May 5, 2024 · 0 comments
Open

Comments

@Joao-Dionisio
Copy link
Collaborator

getObjVal, getVal are too strict in the stage checks. For example, the following code raises an error:

from pyscipopt import Model

m = Model()

x = m.addVar()
m.setObjective(x)

m.setParam("limits/solutions", 1)
m.optimize()

print("Stage: ", m.getStage())

print(m.getNSols())
print(m.getObjVal()) # crashes here, even though the model does have solutions

getObjVal is a PySCIPOpt-only function, but the SCIP functions it calls don't need the strict requirements that getObjVal has.

The fix is in PR#815, but I'm having some trouble with it.

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

No branches or pull requests

1 participant