Skip to content

[QST] How do I get the values of the solution after calling .solve() #932

@araml

Description

@araml

I'm trying to understand the api and I found the following issue

The Problem class exposes the method getIncumbentSolution

def getIncumbentValues(self, solution, vars):

which takes a solution and the variables as an input, you can get the variables from the method

but there is no way to get a solution without using
def Solve(data_model, solver_settings=None):
directly which I think defeats the purpose of using the Problem class

A possible fix would be for Problem.solve()

def solve(self, settings=solver_settings.SolverSettings()):
to return the solution after populate_solution or save it in a member variable like self.solution

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions