| 641 | }; |
| 642 | |
| 643 | Gecode::TupleSet randomTupleSet(int n, int min, int max, double prob, Gecode::Support::RandomGenerator& rand) { |
| 644 | using namespace Gecode; |
| 645 | TupleSet t(n); |
| 646 | CpltAssignment ass(n, IntSet(min, max)); |
| 647 | while (ass.has_more()) { |
| 648 | if (rand(100) <= prob*100) { |
| 649 | IntArgs tuple(n); |
| 650 | for (int i = n; i--; ) tuple[i] = ass[i]; |
| 651 | t.add(tuple); |
| 652 | } |
| 653 | ass.next(rand); |
| 654 | } |
| 655 | t.finalize(); |
| 656 | return t; |
| 657 | } |
| 658 | |
| 659 | /// Help class to create and register tests |
| 660 | class Create { |