Debian Codegraph @

tests/spec/unit/optional/test-opt-float-1.mzn

raw
1 /***
2 !Test
3 solvers: [gecode, cbc, highs]
4 expected:
5 - !Result
6 status: SATISFIED
7 solution: !Solution
8 x: [!Approx 1.0, null]
9 - !Result
10 status: SATISFIED
11 solution: !Solution
12 x: [null, !Approx 1.0]
13 ***/
14
15 %-----------------------------------------------------------------------------%
16 % This file tests the opt float vars
17 %-----------------------------------------------------------------------------%
18
19 include "globals.mzn";
20
21 array[1..2] of var opt 1.0..2.0: x::add_to_output;
22
23
24 constraint sum(x)=1.0;
25
26 % This fails:
27 %constraint x[1]+x[2]=1.0;
28
29 %-----------------------------------------------------------------------------%
30 solve satisfy;