diff --git a/notebooks/message.ipynb b/notebooks/message.ipynb index 62f4702b..79b0f2ab 100644 --- a/notebooks/message.ipynb +++ b/notebooks/message.ipynb @@ -290,9 +290,9 @@ "metadata": {}, "outputs": [], "source": [ - "import ommx_python_mip_adapter as adapter\n", + "from ommx_python_mip_adapter as OMMXPythonMIPAdapter\n", "\n", - "result = adapter.solve(instance)" + "solution = OMMXPythonMIPAdapter.solve(instance)" ] }, { @@ -300,18 +300,7 @@ "id": "08b012b1-9d24-46d1-9933-a0cb95138bd8", "metadata": {}, "source": [ - "The returned `result` is an `ommx.v1.Result` object containing the solution if the problem was solved successfully:" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "255a31d8-033b-4fd4-9f15-287d17d2cdc8", - "metadata": {}, - "outputs": [], - "source": [ - "assert result.HasField(\"solution\") \n", - "solution = result.solution" + "The returned `solution` is a `ommx.v1.Solution` object containing the solution if the problem was solved successfully. In the case the problem is infeasible or unbounded, an exception will occur." ] }, { @@ -395,8 +384,8 @@ } ], "source": [ - "assert len(solution.evaluated_constraints) == 1 \n", - "print(solution.evaluated_constraints[0].evaluated_value)" + "assert len(solution.raw.evaluated_constraints) == 1 \n", + "print(solution.raw.evaluated_constraints[0].evaluated_value)" ] } ], @@ -416,7 +405,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.12.2" } }, "nbformat": 4,