Debian Codegraph @

tests/spec/unit/on_restart/last_val_set.mzn

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