Actual model
| 68 | public: |
| 69 | /// Actual model |
| 70 | AllInterval(const SizeOptions& opt) : |
| 71 | Script(opt), |
| 72 | x(*this, opt.size(), 0, opt.size()-1), |
| 73 | d(*this, opt.size()-1, 1, opt.size()-1) { |
| 74 | const int n = x.size(); |
| 75 | |
| 76 | // Set up variables for distance |
| 77 | for (int i=0; i<n-1; i++) |
| 78 | rel(*this, d[i] == abs(x[i+1]-x[i]), opt.ipl()); |
| 79 | |
| 80 | distinct(*this, x, opt.ipl()); |
| 81 | distinct(*this, d, opt.ipl()); |
| 82 | |
| 83 | // Break mirror symmetry |
| 84 | rel(*this, x[0], IRT_LE, x[1]); |
| 85 | // Break symmetry of dual solution |
| 86 | rel(*this, d[0], IRT_GR, d[n-2]); |
| 87 | |
| 88 | branch(*this, x, INT_VAR_SIZE_MIN(), INT_VAL_SPLIT_MIN()); |
| 89 | } |
| 90 | /// Constructor for cloning \a e |
| 91 | AllInterval(AllInterval& s) |
| 92 | : Script(s) { |
nothing calls this directly
no test coverage detected