tests/spec/unit/on_restart/last_val_float.mzn
raw| 1 | /*** |
| 2 | !Test |
| 3 | solvers: [gecode] |
| 4 | options: |
| 5 | restart: "constant" |
| 6 | restart-base: 100 |
| 7 | expected: !Result |
| 8 | status: OPTIMAL_SOLUTION |
| 9 | solution: !Solution |
| 10 | x: 4 |
| 11 | y: 0.85 |
| 12 | ***/ |
| 13 | include "experimental/on_restart.mzn"; |
| 14 | var -1..4: x; |
| 15 | var -10.0..10.0: y; |
| 16 | |
| 17 | predicate foo() = |
| 18 | if status() = START then y = 0.1 else y = last_val(y) + 0.25 endif; |
| 19 | |
| 20 | solve ::on_restart("foo") ::int_search([x], input_order, indomain_min) maximize abs(x); |