You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdowns/en/releases/unreleased.md
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,52 @@ problem
44
44
45
45
+++
46
46
47
-
### Bugfix 1
47
+
### Bugfixes in random instance data generation
48
+
49
+
We fixed the following two bugs in random instance data generation:
50
+
51
+
#### Placeholders that depend on `NamedExpr` were not handled correctly
52
+
53
+
We fixed a bug where placeholders whose shape (length) or key set depends on `NamedExpr` were not handled correctly.
54
+
For example, consider the following problem:
55
+
56
+
```{code-cell} ipython3
57
+
import jijmodeling as jm
58
+
59
+
60
+
@jm.Problem.define("My Problem")
61
+
def problem(problem: jm.DecoratedProblem):
62
+
a = problem.Float(ndim=1)
63
+
N = problem.NamedExpr(a.len_at(0))
64
+
b = problem.Natural(shape=(N, None))
65
+
M = problem.NamedExpr(b.len_at(1))
66
+
problem += jm.sum(a[i] * b[i, j] for i in N for j in M)
67
+
68
+
69
+
problem
70
+
```
71
+
72
+
In previous versions, calling `generate_random_dataset()` on this `problem` raised an exception. Starting with this release, the data is generated correctly.
73
+
74
+
```{code-cell} ipython3
75
+
problem.generate_random_dataset(seed=17)
76
+
```
77
+
78
+
#### Fixed a bug where generation failed when unused placeholders were present
79
+
80
+
Data generation failed when there were unused placeholders not included in `used_placeholder()`.
81
+
For example, in the following code, `N` is defined but never used, and previous versions raised a runtime exception.
82
+
83
+
```{code-cell} ipython3
84
+
import jijmodeling as jm
85
+
86
+
problem = jm.Problem("My Problem")
87
+
N = problem.Natural("N")
88
+
89
+
problem.generate_random_dataset(seed=17)
90
+
```
91
+
92
+
Starting with this release, data is generated successfully in cases like the example above.
0 commit comments