Skip to content

Release JijModeling 1.12.1 #25

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 29 additions & 28 deletions docs/en/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@
format: jb-book
root: introduction
parts:
- caption: Switch Language
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/ja/
title: 日本語
- caption: Quick Start
chapters:
- file: quickstart/scip
- file: quickstart/openjij
- caption: Tutorial
chapters:
- file: tutorials/creating_models
- file: tutorials/types_and_bounds
- file: tutorials/expressions
- file: tutorials/constraint_and_penalty
- caption: Reference
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
title: "jijmodeling API Reference"
- file: references/tips
- file: references/cheat_sheet
- caption: Release Note
chapters:
- file: releases/jijmodeling-1.12.0
- file: releases/jijmodeling-1.11.0
- file: releases/jijmodeling-1.10.1
- file: releases/jijmodeling-1.10.0
- file: releases/jijmodeling-1.9.0
- file: releases/jijmodeling-1.8.0
- caption: Switch Language
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/ja/
title: 日本語
- caption: Quick Start
chapters:
- file: quickstart/scip
- file: quickstart/openjij
- caption: Tutorial
chapters:
- file: tutorials/creating_models
- file: tutorials/types_and_bounds
- file: tutorials/expressions
- file: tutorials/constraint_and_penalty
- caption: Reference
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
title: jijmodeling API Reference
- file: references/tips
- file: references/cheat_sheet
- caption: Release Note
chapters:
- file: releases/jijmodeling-1.12.1
- file: releases/jijmodeling-1.12.0
- file: releases/jijmodeling-1.11.0
- file: releases/jijmodeling-1.10.1
- file: releases/jijmodeling-1.10.0
- file: releases/jijmodeling-1.9.0
- file: releases/jijmodeling-1.8.0
2 changes: 1 addition & 1 deletion docs/en/releases/jijmodeling-1.10.0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"\n",
"## Feature Enhancements\n",
"\n",
"### `Interpreter` 1-hot Constraint Detection\n",
"### 1-hot Constraint Detection in `Interpreter`\n",
"\n",
"The `Interpreter` now identifies 1-hot constraints during constraint evaluation in the following form:\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/en/releases/jijmodeling-1.11.0.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"\n",
"## Improvements in Hint Detection\n",
"\n",
"- You can now `hints` optional argument to `eval_problem`, which specifies the list of constraint types to be detected. This should be useful when you use specific solvers that supports only a subset of constraint types are supported.\n",
"- You can now pass `hints` optional argument to `eval_problem`, which specifies the list of constraint types to be detected. This should be useful when you use specific solvers that supports only a subset of constraint types are supported.\n",
" + `hints = None` (default): Detects the default set of constraint types (currently, `OneHot` only).\n",
" + `hints = []`: Disables hint detection entirely.\n",
"- Now hint detection mechanism can take into account some algebraic congruence (though not complete).\n",
Expand All @@ -30,7 +30,7 @@
" \\sum_i 2 x_i + 1 = 3\n",
" $$\n",
"- Now `jm.eval_problem()` can derive additional constraints for duplicated variables. For example, if you have $\\sum_{i < 3} x_i = 1$ with $x_1 = x_2$, then it outputs new constraint $x_1 = 0$.\n",
"- `jm.eval_problem()` can now raise an exception when infeasible constraint is detected, e.g. $\\sum_{i < 0} x_i = 1$.\n",
"- `jm.eval_problem()` now raises an exception when infeasible constraint is detected, e.g. $\\sum_{i < 0} x_i = 1$.\n",
"\n",
"## Other Improvements\n",
"\n",
Expand Down
150 changes: 150 additions & 0 deletions docs/en/releases/jijmodeling-1.12.1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"vscode": {
"languageId": "plaintext"
}
},
"source": [
"# JijModeling X.XX.X Release Notes\n",
"\n",
"## Feature Enhancements"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Human Readable Errors in Interpreters\n",
"\n",
"Now [`Interpreter`](https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html#Interpreter) fails with more human-readable error message. For example:"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/latex": [
"$$\\begin{array}{cccc}\\text{Problem:} & \\text{shift\\_optimization} & & \\\\& & \\min \\quad \\displaystyle \\sum_{d = 0}^{D - 1} \\sum_{t = 0}^{T - 1} \\sum_{i = 0}^{N - 1} x_{d, t, i} & \\\\\\text{{s.t.}} & & & \\\\ & \\text{night\\_shift} & \\displaystyle R_{d + 1, i} \\leq x_{d, T - 1, i} & \\forall d \\in \\left\\{0,\\ldots,D - 1\\right\\} \\forall i \\in \\left\\{0,\\ldots,N - 1\\right\\} \\\\\\text{{where}} & & & \\\\& x & 3\\text{-dim binary variable}\\\\\\end{array}$$"
],
"text/plain": [
"<jijmodeling.Problem at 0x105472000>"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import jijmodeling as jm\n",
"\n",
"D = jm.Placeholder(\"D\", dtype=jm.DataType.INTEGER)\n",
"T = jm.Placeholder(\"T\", dtype=jm.DataType.INTEGER)\n",
"N = jm.Placeholder(\"N\", dtype=jm.DataType.INTEGER)\n",
"H = jm.Placeholder(\"H\", shape=(D, T, N))\n",
"R = jm.Placeholder(\"R\", shape=(D, N))\n",
"\n",
"x = jm.BinaryVar(\"x\", shape=(D, T, N))\n",
"d = jm.Element(\"d\", belong_to=(0, D))\n",
"t = jm.Element(\"t\", belong_to=(0, T))\n",
"i = jm.Element(\"i\", belong_to=(0, N))\n",
"\n",
"problem = jm.Problem(name=\"shift_optimization\")\n",
"problem += jm.Constraint(\"night_shift\", R[d+1, i] <= x[d, T-1, i], forall=[d, i])\n",
"problem += jm.sum([d, t, i], x[d, t, i])\n",
"\n",
"problem"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Traceback (most recent last):\n",
" while evaluating Problem `shift_optimization',\n",
" while evaluating constraint: `night_shift',\n",
" while evaluating expression `R[d + 1, i] - x[d, T - 1, i]',\n",
" while evaluating expression `R[d + 1, i]',\n",
"\n",
"IndexError: Index [7, 0] is out of range for shape [7, 5]\n"
]
}
],
"source": [
"num_days = 7\n",
"num_times = 3\n",
"num_people = 5\n",
"\n",
"data = problem.generate_random_dataset(\n",
" options={\n",
" \"D\": {\"value\": num_days},\n",
" \"T\": {\"value\": num_times},\n",
" \n",
" \"N\": {\"value\": num_people},\n",
" }\n",
")\n",
"interp = jm.Interpreter(data)\n",
"\n",
"try:\n",
" interp.eval_problem(problem)\n",
"except Exception as e:\n",
" print(e)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Bugfixes"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Bugfix 1"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Other Changes\n",
"\n",
"- Change 1"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.20"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
57 changes: 29 additions & 28 deletions docs/ja/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,32 @@
format: jb-book
root: introduction
parts:
- caption: Switch Language
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/en/
title: English
- caption: "クイックスタート"
chapters:
- file: quickstart/scip
- file: quickstart/openjij
- caption: "チュートリアル"
chapters:
- file: tutorials/creating_models
- file: tutorials/types_and_bounds
- file: tutorials/expressions
- file: tutorials/constraint_and_penalty
- caption: "リファレンス"
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
title: "jijmodeling API Reference"
- file: references/tips
- file: references/cheat_sheet
- caption: "リリースノート"
chapters:
- file: releases/jijmodeling-1.12.0
- file: releases/jijmodeling-1.11.0
- file: releases/jijmodeling-1.10.1
- file: releases/jijmodeling-1.10.0
- file: releases/jijmodeling-1.9.0
- file: releases/jijmodeling-1.8.0
- caption: Switch Language
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/en/
title: English
- caption: クイックスタート
chapters:
- file: quickstart/scip
- file: quickstart/openjij
- caption: チュートリアル
chapters:
- file: tutorials/creating_models
- file: tutorials/types_and_bounds
- file: tutorials/expressions
- file: tutorials/constraint_and_penalty
- caption: リファレンス
chapters:
- url: https://jij-inc.github.io/JijModeling-Tutorials/apis/jijmodeling.html
title: jijmodeling API Reference
- file: references/tips
- file: references/cheat_sheet
- caption: リリースノート
chapters:
- file: releases/jijmodeling-1.12.1
- file: releases/jijmodeling-1.12.0
- file: releases/jijmodeling-1.11.0
- file: releases/jijmodeling-1.10.1
- file: releases/jijmodeling-1.10.0
- file: releases/jijmodeling-1.9.0
- file: releases/jijmodeling-1.8.0
Loading
Loading