this repo has no description
at develop 1.5 kB view raw
1%-----------------------------------------------------------------------------% 2% This file tests the global constraints in globals.mzn that involve 3% variables of type `var float'. 4%-----------------------------------------------------------------------------% 5 6include "globals.mzn"; 7 8% Variable naming scheme: all variables for a constraint get a common 9% prefix based on the constraint name, eg. "alldiff". 10 11%-----------------------------------------------------------------------------% 12% increasing 13%-----------------------------------------------------------------------------% 14 15 % test satisfaction 16array[1..3] of var float: inc_avf :: is_output = [1.0, 2.0, _]; 17 18constraint increasing(inc_avf); 19 20%-----------------------------------------------------------------------------% 21% minimum, maximum 22%-----------------------------------------------------------------------------% 23 24var 0.0..20.0: min_vf1 :: is_output; 25var 0.0..20.0: min_vf2 :: is_output; 26 27var 0.0..20.0: max_vf1 :: is_output; 28var 0.0..20.0: max_vf2 :: is_output; 29 30% XXX: min/2 for floats not yet handled 31constraint minimum(min_vf1, [5.5, 3.3, 8.8, 0.0, 4.4]); 32constraint minimum(0.0, [5.5, 3.3, 8.8, min_vf2, 4.4]); 33 34% XXX: max/2 for floats not yet handled 35constraint maximum(max_vf1, [5.5, 3.3, 8.8, 9.9, 4.4]); 36constraint maximum(9.9, [5.5, 3.3, 8.8, max_vf2, 4.4]); 37 38%-----------------------------------------------------------------------------% 39solve satisfy;