Create and register test
| 561 | public: |
| 562 | /// Create and register test |
| 563 | TupleSetBool(double prob, bool p) |
| 564 | : Test("Extensional::TupleSet::" + str(p) + "::Bool", |
| 565 | 5,0,1,true), pos(p), t(5) { |
| 566 | using namespace Gecode; |
| 567 | |
| 568 | CpltAssignment ass(5, IntSet(0, 1)); |
| 569 | while (ass.has_more()) { |
| 570 | if (_rand(100) <= prob*100) { |
| 571 | IntArgs tuple(5); |
| 572 | for (int i = 5; i--; ) tuple[i] = ass[i]; |
| 573 | t.add(tuple); |
| 574 | } |
| 575 | ass.next(_rand); |
| 576 | } |
| 577 | t.finalize(); |
| 578 | } |
| 579 | /// %Test whether \a x is solution |
| 580 | virtual bool solution(const Assignment& x) const { |
| 581 | using namespace Gecode; |