ModelSolution
allows access to the solution of a gurobipy.Model
. It is a simple convenience function that will collect the decision variables and their values.
Consider the same script shown in the model section, which solves a simple knapsack problem. You may use the ModelSolution
to obtain the solution of the model. This convenience functionality is provided out of the box, but we recommend that you customize how the model is interpreted to parse the solution.
Run the script: