Skip to content

Commit

Permalink
Update OMMX message notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Zengor committed Jan 31, 2025
1 parent d52e635 commit a7f342b
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions notebooks/message.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -290,28 +290,17 @@
"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)"
]
},
{
"cell_type": "markdown",
"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."
]
},
{
Expand Down Expand Up @@ -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)"
]
}
],
Expand All @@ -416,7 +405,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.2"
}
},
"nbformat": 4,
Expand Down

0 comments on commit a7f342b

Please sign in to comment.