The actual model
| 64 | public: |
| 65 | /// The actual model |
| 66 | Grocery(const Options& opt) |
| 67 | : Script(opt), abcd(*this,4,0,s) { |
| 68 | IntVar a(abcd[0]), b(abcd[1]), c(abcd[2]), d(abcd[3]); |
| 69 | |
| 70 | // The sum of all variables is s |
| 71 | rel(*this, a+b+c+d == s, opt.ipl()); |
| 72 | |
| 73 | // The product of all variables is s (corrected by scale factor) |
| 74 | rel(*this, (a*b)*(c*d) == p, opt.ipl()); |
| 75 | |
| 76 | // Break symmetries: order the variables |
| 77 | rel(*this, abcd, IRT_LQ); |
| 78 | |
| 79 | branch(*this, abcd, INT_VAR_NONE(), INT_VAL_SPLIT_MAX()); |
| 80 | } |
| 81 | |
| 82 | /// Constructor for cloning \a s |
| 83 | Grocery(Grocery& s) : Script(s) { |
nothing calls this directly
no test coverage detected