1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
bytecode-benchmarks/tests/distributions/distribution_test.mzn
Jip J. Dekker b5f0d64642 Squashed 'prototype/' content from commit 91f7db00
git-subtree-dir: prototype
git-subtree-split: 91f7db00d45e7f991b5587ee07f09977ae311ee7
2021-07-29 14:28:24 +10:00

18 lines
576 B
MiniZinc

% testing generating a random list of integers
int: n = 10;
array[1..n] of int: coeff1 = [ uniform(1,10) | i in 1..n];
array[1..n] of int: coeff2 = [ uniform(1,10) | i in 1..n];
array[1..n] of int: coeff3 = [ uniform(1,10) | i in 1..n];
array[1..n] of var 0..n: x;
constraint
trace("coeff1 = "++show(coeff1)++"\n") /\
trace("coeff2 = "++show(coeff2)++"\n") /\
trace("coeff3 = "++show(coeff3)++"\n");
constraint sum (i in 1..n) (coeff1[i]*x[i]) <= n*10;
constraint sum (i in 1..n) (coeff2[i]*x[i]) <= n*4;
constraint sum (i in 1..n) (coeff3[i]*x[i]) >= n*5;
solve satisfy;