Generated on Tue Feb 11 2025 17:33:26 for Gecode by doxygen 1.12.0
radiotherapy.cpp
Go to the documentation of this file.
1/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2/*
3 * Main authors:
4 * Guido Tack <tack@gecode.org>
5 *
6 * Contributing authors:
7 * Mikael Lagerkvist <lagerkvist@gecode.org>
8 *
9 * Copyright:
10 * Guido Tack, 2009
11 * Mikael Lagerkvist, 2009
12 *
13 * This file is part of Gecode, the generic constraint
14 * development environment:
15 * http://www.gecode.org
16 *
17 * Permission is hereby granted, free of charge, to any person obtaining
18 * a copy of this software and associated documentation files (the
19 * "Software"), to deal in the Software without restriction, including
20 * without limitation the rights to use, copy, modify, merge, publish,
21 * distribute, sublicense, and/or sell copies of the Software, and to
22 * permit persons to whom the Software is furnished to do so, subject to
23 * the following conditions:
24 *
25 * The above copyright notice and this permission notice shall be
26 * included in all copies or substantial portions of the Software.
27 *
28 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 *
36 */
37
38#include <gecode/driver.hh>
39#include <gecode/int.hh>
40#include <gecode/minimodel.hh>
41
42using namespace Gecode;
43
46private:
48 int incr_sum(int row) {
49 int sum = intensity[row*n];
50 for (int i=1; i<n; i++)
51 sum += std::max(intensity[row*n+i]-intensity[row*n+i-1],0);
52 return sum;
53 }
54public:
55 const int m;
56 const int n;
57 const int* intensity;
58
59 int btMin;
60 int btMax;
61 int intsSum;
62
64 RadiotherapyData(int m0, int n0, const int* intensity0)
65 : m(m0), n(n0), intensity(intensity0) {
66 btMax = 0;
67 intsSum = 0;
68 for (int i=0; i<m*n; i++) {
69 btMax = std::max(btMax, intensity[i]);
70 intsSum += intensity[i];
71 }
72
73 btMin = 0;
74 for (int i=0; i<m; i++)
75 btMin = std::max(btMin, incr_sum(i));
76 }
77};
78
79namespace {
80 extern RadiotherapyData rds[];
81 extern const unsigned int rds_n;
82}
83
99private:
101 const RadiotherapyData rd;
102
104 IntVar beamtime;
106 IntVar K;
108 IntVarArray N;
110 IntVarArray q;
111
113 IntVar _cost;
114
115public:
118 : IntMinimizeScript(opt), rd(rds[opt.size()]) {
119
120 // Initialize variables
121 beamtime = IntVar(*this, rd.btMin, rd.intsSum);
122 K = IntVar(*this, 0, rd.m*rd.n);
123 N = IntVarArray(*this, rd.btMax, 0, rd.m*rd.n);
124 q = IntVarArray(*this, rd.m*rd.n*rd.btMax, 0, rd.m*rd.n);
125
126 IntArgs coeffs(rd.btMax);
127 for (int i=0; i<rd.btMax; i++)
128 coeffs[i] = i+1;
129 linear(*this, coeffs, N, IRT_EQ, beamtime);
130 linear(*this, N, IRT_EQ, K);
131
132 for (int i=0; i<rd.m; i++) {
133 for (int j=0; j<rd.n; j++) {
134 IntVarArgs qs(rd.btMax);
135 for (int b=0; b<rd.btMax; b++)
136 qs[b] = q[i*rd.n*rd.btMax+j*rd.btMax+b];
137 linear(*this, coeffs, qs, IRT_EQ, rd.intensity[i*rd.n+j], IPL_DOM);
138 }
139 }
140
141 for (int i=0; i<rd.m; i++) {
142 for (int b=0; b<rd.btMax; b++) {
143 IntVarArgs qs(rd.n);
144 for (int j=0; j<rd.n; j++)
145 qs[j] = q[i*rd.n*rd.btMax+j*rd.btMax+b];
146 incr_sum(N[b], qs, rd.m*rd.n);
147 }
148 }
149
150 _cost = IntVar(*this, 0, (rd.m*rd.n+1)*(rd.intsSum+1));
151 rel(*this, _cost == beamtime*(rd.m*rd.n+1)+K);
152
153 // First branch over beamtime and N
154 IntVarArgs ba({beamtime});
155 branch(*this, ba, INT_VAR_NONE(), INT_VAL_MIN());
156 branch(*this, N, INT_VAR_NONE(), INT_VAL_SPLIT_MIN());
157
158 // Then perform a nested search over q
159 NestedSearch::post(*this);
160
161 }
162
164 void incr_sum(IntVar& x, IntVarArgs& y, int mn) {
165 IntVarArgs s(*this, y.size()-1, 0, mn);
166 IntVarArgs t(y.size());
167 t[0] = y[0];
168 for (int i=1; i<y.size(); i++) {
169 rel(*this, s[i-1] >= y[i]-y[i-1]);
170 t[i] = s[i-1];
171 }
172 linear(*this, t, IRT_LQ, x);
173 }
174
177 : IntMinimizeScript(s), rd(s.rd) {
178 beamtime.update(*this, s.beamtime);
179 N.update(*this, s.N);
180 K.update(*this, s.K);
181 _cost.update(*this, s._cost);
182 q.update(*this, s.q);
183 }
184
186 virtual Space*
187 copy(void) {
188 return new Radiotherapy(*this);
189 }
190
192 virtual IntVar
193 cost(void) const { return _cost; }
194
196 virtual void
197 print(std::ostream& os) const {
198 os << std::endl
199 << "B / K = " << beamtime << " / " << K << ",\nN = " << N << std::endl;
200 }
201
203 class NestedSearch : public Brancher {
204 private:
206 bool done;
208 struct Idx {
209 int idx;
210 int weight;
212 bool operator<(const Idx& rhs) const { return weight > rhs.weight; }
213 };
215 SharedArray<Idx> index;
217 class Choice : public Gecode::Choice {
218 public:
220 bool fail;
222 Choice(const Brancher& b, bool fail0)
223 : Gecode::Choice(b,1), fail(fail0) {}
225 virtual void archive(Archive& e) const {
227 e.put(fail);
228 }
229 };
231 NestedSearch(Space& home) : Brancher(home), done(false) {
232 Radiotherapy& rt = static_cast<Radiotherapy&>(home);
233 // Set up ordering of rows. As a heuristic, pre-order the rows
234 // with the potentially cheapest ones first.
235 index.init(rt.rd.m+1);
236 for (int i = rt.rd.m; i--; ) {
237 index[i].idx = i;
238 index[i].weight = 0;
239 for (int j = rt.rd.n; j--; )
240 index[i].weight += rt.rd.intensity[i*rt.rd.n + j] == 0;
241 }
242 Support::quicksort(&(index[0]), rt.rd.m);
243 for (int i = rt.rd.m; i--; )
244 index[i].weight = 0;
245 index[rt.rd.m].idx = 10;
246 // A shared object must be disposed properly
247 home.notice(*this, AP_DISPOSE);
248 }
251 : Brancher(home, b), done(b.done), index(b.index) {
252 }
253 public:
254 virtual bool status(const Space&) const {
255 return !done;
256 }
257
259 IntVarArgs ri(row->rd.n*row->rd.btMax);
260 for (int j=0; j<row->rd.n; j++) {
261 for (int b=0; b<row->rd.btMax; b++) {
262 ri[j*row->rd.btMax+b] =
263 row->q[i*row->rd.n*row->rd.btMax+j*row->rd.btMax+b];
264 }
265 }
266 return ri;
267 }
269 virtual Gecode::Choice* choice(Space& home) {
270 done = true;
271 Radiotherapy& rt = static_cast<Radiotherapy&>(home);
272
273 std::cout << "*";
274
275 // Perform nested search for each row
276 bool fail = false;
277 for (int i=0; i<rt.rd.m; i++) {
278 // Create fresh clone for row i
279 Radiotherapy* row = static_cast<Radiotherapy*>(rt.clone());
280
281 // Branch over row i
282 branch(*row, getRow(row, index[i].idx),
284 Search::Options o; o.clone = false;
285 if (Radiotherapy* newSol = dfs(row, o) ) {
286 // Found a solution for row i, so try to find one for i+1
287 delete newSol;
288 std::cerr << index[i].idx;
289 } else {
290 // Found no solution for row i, so back to search the N variables
291 fail = true;
292 index[i].weight += 1;
293 if (i && index[i] < index[i-1])
294 std::swap(index[i], index[i-1]);
295 break;
296 }
297 }
298
299 return new Choice(*this, fail);
300 }
302 virtual Choice* choice(const Space&, Archive& e) {
303 bool fail; e >> fail;
304 return new Choice(*this, fail);
305 }
307 virtual ExecStatus commit(Space&, const Gecode::Choice& _c, unsigned int) {
308 return static_cast<const Choice&>(_c).fail ? ES_FAILED : ES_OK;
309 }
311 virtual void print(const Space&, const Gecode::Choice& _c,
312 unsigned int,
313 std::ostream& o) const {
314 const Choice& c = static_cast<const Choice&>(_c);
315 o << (c.fail ? "fail" : "ok");
316 }
318 virtual Actor* copy(Space& home) {
319 return new (home) NestedSearch(home, *this);
320 }
322 static void post(Home home) {
323 (void) new (home) NestedSearch(home);
324 }
326 size_t dispose(Space& home) {
327 home.ignore(*this,AP_DISPOSE);
328 // Periodic scaling of weights
329 if (!--index[index.size()-1].idx) {
330 index[index.size()-1].idx = 10;
331 for (int i = index.size()-1; i--; )
332 index[i].weight *= 0.9;
333 }
334 (void) Brancher::dispose(home);
335 (void) index.~SharedArray<Idx>();
336 return sizeof(*this);
337 }
338 };
339
340};
341
345int
346main(int argc, char* argv[]) {
347 SizeOptions opt("Radiotherapy");
348 opt.solutions(0);
349 opt.size(0);
350 opt.parse(argc,argv);
351
352 if (opt.size() >= rds_n) {
353 std::cerr << "Error: size must be between 0 and "
354 << rds_n-1 << std::endl;
355 return 1;
356 }
357
359 return 0;
360}
361
362namespace {
368
369 // Small instance
370 static const int intensity0[] = {
371 7, 2, 14, 8, 9,
372 13, 4, 1, 2, 9,
373 5, 12, 2, 11, 9,
374 10, 2, 4, 9, 7,
375 10, 2, 8, 11, 1
376 };
377 RadiotherapyData rd0(5,5,intensity0);
378
379 // Larger instance
380 static const int intensity1[] = {
381 6, 10, 6, 8, 10, 0, 4, 10, 0, 6, 2, 8, 0, 2, 0 ,
382 1, 8, 3, 1, 0, 8, 0, 3, 6, 10, 9, 8, 9, 6, 9 ,
383 8, 5, 6, 7, 7, 0, 6, 8, 2, 7, 5, 2, 0, 9, 2 ,
384 9, 2, 10, 5, 7, 1, 3, 7, 5, 1, 8, 2, 3, 10, 4 ,
385 8, 7, 4, 1, 6, 3, 0, 1, 2, 6, 4, 4, 0, 5, 0 ,
386 9, 0, 7, 4, 9, 7, 4, 1, 4, 1, 1, 9, 2, 9, 9 ,
387 3, 6, 10, 0, 6, 6, 10, 10, 7, 0, 10, 2, 10, 2, 4 ,
388 8, 9, 5, 2, 6, 1, 9, 0, 4, 2, 4, 1, 5, 1, 4 ,
389 6, 10, 0, 0, 7, 0, 0, 5, 8, 5, 10, 3, 2, 2, 10 ,
390 4, 3, 0, 6, 10, 7, 2, 7, 2, 9, 2, 8, 9, 7, 9 ,
391 10, 2, 0, 5, 5, 1, 3, 7, 1, 6, 5, 4, 2, 8, 1 ,
392 3, 6, 4, 3, 7, 10, 6, 7, 7, 6, 5, 9, 10, 8, 3 ,
393 9, 9, 5, 2, 4, 2, 3, 3, 1, 2, 9, 2, 5, 6, 3 ,
394 7, 5, 2, 6, 4, 8, 1, 0, 2, 4, 7, 9, 3, 3, 0 ,
395 5, 3, 8, 7, 10, 6, 7, 7, 6, 10, 4, 4, 5, 8, 0
396 };
397 RadiotherapyData rd1(15,15,intensity1);
398
399 /*
400 * The following 25 clinical instances were provided by
401 * - James F. Dempsey, ViewRay, Inc.
402 * - H. Edwin Romeijn, Department of Industrial and Operations
403 * Engineering, The University of Michigan
404 * - J. Cole Smith, Department of Industrial and Systems
405 * Engineering, University of Florida
406 * - Z. Caner Taskin, Department of Industrial and Systems
407 * Engineering, University of Florida
408 * - Chunhua Men, Department of Industrial and Systems Engineering,
409 * University of Florida
410 * They are from the artiples
411 * - "Mixed-Integer Programming Techniques for Decomposing IMRT
412 * Fluence Maps Using Rectangular Apertures", Z. Caner Taskin,
413 * J. Cole Smith, H. Edwin Romeijn
414 * - "Optimal Multileaf Collimator Leaf Sequencing in IMRT Treatment
415 * Planning", Z. Caner Tasin, J. Cole Smith, H. Edwin Romeijn, James
416 * F. Dempsey
417 */
418 static const int case1_beam1_matrix[] = {
419 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
420 2, 1, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 0, 2,
421 3, 1, 0, 0, 0, 0, 0, 0, 18, 0, 0, 4, 6, 0,
422 2, 0, 0, 3, 11, 8, 15, 1, 11, 0, 0, 0, 10, 0,
423 0, 0, 0, 9, 11, 14, 6, 2, 7, 0, 0, 0, 7, 0,
424 0, 8, 2, 7, 10, 11, 7, 2, 0, 7, 0, 0, 0, 1,
425 0, 0, 4, 1, 6, 7, 0, 0, 0, 0, 0, 0, 0, 1,
426 0, 3, 1, 0, 4, 6, 0, 0, 0, 1, 0, 0, 0, 1,
427 0, 1, 5, 6, 8, 8, 5, 0, 2, 0, 0, 0, 7, 0,
428 0, 5, 2, 8, 10, 11, 5, 3, 7, 0, 2, 4, 11, 0,
429 0, 0, 0, 1, 12, 13, 9, 7, 11, 1, 2, 3, 6, 0,
430 0, 0, 0, 0, 0, 0, 0, 4, 20, 0, 0, 8, 5, 0,
431 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 0, 2,
432 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
433 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 1
434 };
435 RadiotherapyData case1_beam1(15, 14, case1_beam1_matrix);
436
437 static const int case1_beam2_matrix[] = {
438 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 4, 0, 2,
439 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 1,
440 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 1, 0, 0, 3,
441 0, 0, 0, 5, 5, 3, 0, 0, 3, 2, 8, 6, 0, 0, 3,
442 0, 0, 7, 11, 10, 11, 5, 8, 4, 11, 13, 20, 0, 0, 3,
443 0, 10, 10, 9, 7, 7, 7, 2, 9, 0, 0, 0, 9, 0, 2,
444 0, 4, 7, 7, 5, 6, 2, 0, 4, 0, 0, 0, 3, 0, 2,
445 0, 10, 2, 7, 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, 1,
446 0, 0, 5, 6, 3, 1, 0, 6, 8, 0, 0, 0, 0, 1, 2,
447 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
448 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
449 };
450 RadiotherapyData case1_beam2(11, 15, case1_beam2_matrix);
451
452 static const int case1_beam3_matrix[] = {
453 2, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1,
454 1, 2, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 1, 2, 2,
455 1, 3, 0, 0, 0, 0, 0, 0, 0, 6, 4, 1, 12, 0, 2,
456 2, 0, 0, 0, 0, 0, 0, 0, 0, 11, 6, 1, 9, 0, 2,
457 2, 0, 0, 0, 0, 0, 0, 0, 2, 11, 0, 0, 0, 2, 1,
458 0, 0, 0, 0, 0, 1, 0, 4, 0, 0, 0, 0, 0, 1, 1,
459 0, 3, 0, 2, 6, 7, 6, 6, 4, 0, 0, 0, 0, 0, 2,
460 0, 0, 10, 12, 11, 10, 13, 13, 12, 5, 0, 0, 0, 0, 2,
461 0, 0, 11, 12, 10, 10, 14, 15, 15, 5, 2, 7, 12, 0, 2,
462 0, 9, 5, 9, 7, 6, 12, 16, 13, 8, 5, 7, 7, 0, 2,
463 2, 0, 0, 0, 0, 0, 4, 20, 12, 8, 1, 6, 8, 0, 2,
464 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 7, 0, 2,
465 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
466 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 1,
467 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 1
468 };
469 RadiotherapyData case1_beam3(15, 15, case1_beam3_matrix);
470
471 static const int case1_beam4_matrix[] = {
472 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 2,
473 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
474 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
475 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 13, 0, 4, 0, 2,
476 0, 6, 5, 5, 8, 9, 11, 20, 8, 9, 18, 10, 7, 0, 2,
477 0, 3, 10, 9, 12, 11, 15, 15, 11, 11, 16, 15, 3, 0, 3,
478 0, 5, 7, 12, 14, 11, 15, 15, 13, 10, 15, 10, 5, 0, 3,
479 0, 5, 1, 9, 11, 9, 13, 9, 12, 6, 3, 0, 0, 0, 2,
480 0, 0, 0, 0, 4, 2, 4, 0, 7, 0, 0, 0, 0, 0, 2,
481 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
482 2, 0, 0, 1, 7, 4, 0, 0, 0, 10, 10, 4, 0, 1, 1,
483 2, 2, 0, 0, 0, 0, 0, 4, 0, 14, 14, 9, 0, 0, 1,
484 2, 2, 0, 0, 0, 0, 0, 0, 0, 12, 16, 5, 1, 0, 2,
485 2, 2, 0, 0, 0, 0, 0, 0, 1, 10, 12, 6, 3, 0, 2,
486 1, 3, 0, 0, 0, 0, 0, 0, 2, 12, 15, 3, 0, 1, 2
487 };
488 RadiotherapyData case1_beam4(15, 15, case1_beam4_matrix);
489
490 static const int case1_beam5_matrix[] = {
491 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
492 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2,
493 0, 0, 6, 4, 3, 1, 0, 0, 7, 0, 0, 0, 0, 3, 2,
494 0, 13, 6, 1, 1, 1, 5, 0, 2, 0, 0, 0, 0, 1, 2,
495 0, 2, 12, 5, 4, 2, 2, 0, 1, 20, 11, 11, 5, 0, 2,
496 0, 9, 12, 7, 3, 2, 7, 3, 5, 14, 12, 13, 11, 0, 2,
497 0, 5, 11, 13, 6, 6, 5, 5, 5, 15, 11, 13, 12, 0, 2,
498 0, 0, 0, 1, 4, 5, 0, 0, 0, 7, 9, 9, 8, 0, 2,
499 4, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 4, 5, 0, 2,
500 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
501 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 9, 0, 3
502 };
503 RadiotherapyData case1_beam5(11, 15, case1_beam5_matrix);
504
505 static const int case2_beam1_matrix[] = {
506 1, 1, 1, 4, 1, 0, 1, 5, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2,
507 1, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
508 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 2, 7, 2, 1,
509 1, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 12, 12, 5, 8, 5, 3, 0,
510 2, 1, 3, 0, 0, 0, 0, 0, 4, 20, 10, 1, 0, 8, 7, 8, 6, 7, 2, 1,
511 1, 3, 1, 0, 3, 1, 13, 18, 14, 10, 5, 0, 3, 7, 7, 7, 6, 7, 2, 0,
512 2, 0, 0, 0, 3, 1, 9, 8, 8, 6, 2, 3, 4, 5, 11, 10, 9, 10, 3, 0,
513 2, 0, 0, 0, 1, 1, 7, 8, 5, 4, 1, 1, 0, 4, 3, 1, 0, 0, 0, 2,
514 2, 0, 0, 1, 0, 0, 4, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
515 2, 0, 0, 4, 2, 0, 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
516 3, 0, 5, 6, 3, 1, 2, 5, 3, 1, 3, 0, 1, 0, 4, 5, 5, 9, 0, 1,
517 1, 0, 2, 8, 3, 2, 3, 6, 5, 3, 4, 6, 4, 5, 10, 11, 8, 10, 4, 0,
518 0, 0, 0, 8, 5, 4, 5, 8, 5, 7, 6, 5, 3, 5, 8, 7, 7, 10, 2, 0,
519 3, 0, 9, 11, 5, 5, 6, 11, 7, 6, 6, 6, 4, 6, 8, 7, 7, 9, 2, 0,
520 2, 0, 11, 11, 5, 6, 7, 9, 9, 6, 8, 5, 4, 6, 10, 6, 7, 7, 2, 0,
521 2, 0, 6, 11, 4, 3, 1, 0, 0, 0, 0, 4, 7, 6, 2, 0, 0, 3, 0, 2,
522 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
523 1, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 2
524 };
525 RadiotherapyData case2_beam1(18, 20, case2_beam1_matrix);
526
527 static const int case2_beam2_matrix[] = {
528 2, 3, 2, 1, 5, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 3,
529 3, 3, 3, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
530 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 3, 2,
531 3, 3, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 8, 5, 1,
532 2, 3, 1, 0, 0, 0, 0, 1, 0, 0, 5, 6, 5, 5, 1, 2, 6, 2, 1,
533 2, 2, 2, 0, 0, 0, 0, 8, 0, 4, 2, 5, 2, 7, 5, 1, 4, 2, 1,
534 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 3, 4, 7, 4, 0,
535 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 6, 7, 5, 7, 8, 7, 0,
536 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 7, 10, 7, 2, 3, 5, 12, 6, 0,
537 4, 0, 0, 0, 0, 6, 5, 6, 4, 8, 10, 12, 9, 7, 1, 6, 6, 6, 0,
538 0, 0, 0, 18, 18, 3, 3, 4, 6, 9, 12, 12, 7, 5, 0, 0, 0, 0, 2,
539 0, 0, 0, 20, 11, 0, 1, 4, 5, 10, 10, 8, 6, 1, 6, 3, 4, 1, 3,
540 0, 0, 0, 16, 11, 0, 3, 2, 7, 11, 10, 13, 7, 2, 2, 0, 0, 0, 2,
541 3, 0, 0, 14, 10, 1, 5, 2, 8, 15, 9, 9, 13, 5, 0, 0, 0, 0, 3,
542 2, 0, 0, 16, 9, 5, 5, 4, 7, 18, 0, 0, 0, 0, 0, 0, 0, 1, 2,
543 2, 0, 0, 15, 10, 7, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
544 2, 0, 0, 0, 18, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2
545 };
546 RadiotherapyData case2_beam2(17, 19, case2_beam2_matrix);
547
548 static const int case2_beam3_matrix[] = {
549 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
550 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
551 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 4, 3, 2, 6, 2, 2,
552 1, 0, 0, 0, 0, 0, 0, 4, 2, 10, 11, 12, 7, 7, 4, 0, 4, 1,
553 2, 0, 0, 0, 0, 0, 0, 4, 6, 9, 10, 12, 6, 5, 4, 4, 3, 2,
554 2, 0, 0, 0, 0, 14, 0, 7, 2, 9, 8, 8, 3, 6, 4, 4, 2, 2,
555 3, 0, 0, 0, 10, 11, 0, 0, 1, 7, 4, 2, 2, 0, 0, 0, 2, 2,
556 0, 0, 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
557 0, 0, 0, 0, 4, 1, 1, 0, 2, 2, 0, 0, 2, 0, 3, 0, 1, 2,
558 0, 0, 0, 0, 5, 5, 7, 7, 8, 9, 5, 8, 1, 1, 0, 0, 0, 3,
559 0, 0, 8, 0, 10, 10, 12, 15, 16, 10, 7, 6, 0, 3, 0, 0, 0, 3,
560 0, 0, 20, 4, 12, 12, 11, 19, 17, 17, 11, 9, 12, 12, 11, 13, 3, 1,
561 0, 0, 0, 11, 8, 10, 11, 15, 18, 12, 5, 3, 6, 8, 11, 12, 9, 0,
562 1, 0, 0, 6, 10, 1, 3, 17, 17, 13, 5, 1, 4, 16, 8, 15, 3, 1,
563 2, 0, 0, 8, 0, 0, 0, 0, 0, 11, 6, 0, 6, 0, 0, 0, 0, 3,
564 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
565 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
566 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2
567 };
568 RadiotherapyData case2_beam3(18, 18, case2_beam3_matrix);
569
570 static const int case2_beam4_matrix[] = {
571 3, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 2, 2,
572 0, 0, 5, 2, 2, 0, 7, 3, 3, 0, 0, 0, 0, 0, 0, 3, 1, 2,
573 0, 0, 0, 4, 3, 0, 8, 11, 9, 4, 0, 2, 0, 0, 0, 0, 4, 1,
574 0, 0, 9, 5, 5, 2, 12, 13, 10, 7, 3, 1, 4, 0, 0, 0, 0, 3,
575 0, 16, 9, 4, 10, 7, 15, 16, 8, 5, 6, 4, 7, 10, 0, 11, 0, 2,
576 0, 0, 12, 6, 12, 12, 18, 18, 14, 9, 7, 7, 8, 12, 13, 12, 10, 0,
577 0, 0, 0, 8, 13, 15, 18, 20, 12, 13, 12, 12, 12, 13, 11, 10, 8, 0,
578 0, 0, 0, 3, 5, 14, 17, 16, 11, 8, 4, 10, 12, 11, 14, 9, 1, 3,
579 0, 0, 0, 0, 0, 3, 14, 8, 5, 4, 5, 9, 4, 0, 0, 0, 0, 3,
580 4, 3, 0, 0, 1, 0, 8, 3, 3, 0, 0, 0, 0, 0, 2, 0, 0, 3,
581 1, 7, 0, 0, 1, 2, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
582 3, 4, 5, 0, 0, 0, 0, 0, 0, 0, 5, 1, 4, 1, 4, 0, 0, 2,
583 2, 5, 4, 0, 0, 0, 0, 0, 0, 0, 8, 10, 7, 0, 6, 1, 4, 1,
584 2, 4, 4, 0, 0, 0, 0, 0, 0, 4, 5, 5, 6, 1, 6, 6, 2, 2,
585 2, 4, 3, 2, 0, 0, 0, 0, 4, 3, 12, 2, 1, 7, 3, 4, 2, 2,
586 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 3, 7, 3, 12, 5, 5, 1,
587 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 2, 2,
588 3, 3, 5, 0, 3, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 3
589 };
590 RadiotherapyData case2_beam4(18, 18, case2_beam4_matrix);
591
592 static const int case2_beam5_matrix[] = {
593 0, 0, 0, 15, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2,
594 0, 0, 2, 10, 16, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2,
595 0, 0, 6, 9, 15, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 3,
596 2, 4, 9, 12, 15, 3, 4, 0, 3, 0, 2, 17, 13, 0, 0, 0, 2, 3,
597 0, 5, 12, 14, 17, 5, 2, 0, 0, 8, 17, 16, 13, 4, 0, 0, 0, 3,
598 0, 6, 13, 16, 17, 5, 2, 2, 4, 5, 12, 10, 10, 13, 6, 0, 0, 3,
599 0, 0, 20, 17, 18, 8, 4, 5, 6, 10, 14, 13, 11, 2, 1, 4, 0, 3,
600 0, 0, 0, 14, 18, 11, 8, 9, 9, 10, 13, 12, 8, 8, 5, 6, 5, 0,
601 0, 0, 0, 2, 11, 10, 6, 3, 1, 6, 10, 11, 5, 8, 9, 8, 9, 0,
602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 7, 3, 10, 4, 5, 3, 1,
603 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 6, 2, 2, 2, 2, 1,
604 0, 0, 0, 0, 0, 0, 1, 0, 3, 3, 4, 3, 4, 1, 0, 0, 2, 0,
605 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 0, 0, 0, 0, 4, 1, 2,
606 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 0, 0, 0, 0, 8, 3, 1,
607 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 1, 0, 2,
608 1, 3, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3,
609 1, 2, 1, 4, 8, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
610 };
611 RadiotherapyData case2_beam5(17, 18, case2_beam5_matrix);
612
613 static const int case3_beam1_matrix[] = {
614 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
615 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 13, 8, 8, 1, 0, 0, 0,
616 1, 2, 0, 0, 0, 0, 0, 0, 11, 9, 5, 5, 4, 5, 0, 2, 0,
617 1, 0, 0, 0, 0, 0, 8, 13, 9, 6, 4, 4, 4, 8, 0, 2, 0,
618 0, 2, 17, 10, 13, 14, 10, 8, 7, 6, 4, 4, 5, 8, 0, 2, 0,
619 0, 12, 20, 9, 14, 15, 7, 2, 5, 5, 5, 3, 4, 9, 0, 1, 1,
620 0, 17, 13, 10, 15, 16, 5, 1, 5, 7, 5, 6, 4, 8, 0, 2, 1,
621 1, 0, 15, 9, 15, 20, 6, 1, 4, 7, 7, 6, 5, 9, 7, 1, 1,
622 0, 0, 2, 7, 16, 9, 5, 0, 3, 7, 5, 5, 4, 7, 4, 5, 0,
623 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 4, 4, 2, 6, 5, 4, 0,
624 0, 0, 0, 0, 0, 0, 0, 0, 1, 6, 3, 3, 3, 6, 5, 4, 0,
625 0, 0, 0, 5, 7, 5, 8, 0, 2, 7, 5, 4, 5, 7, 4, 5, 0,
626 0, 4, 9, 8, 16, 19, 5, 1, 3, 7, 6, 5, 6, 9, 6, 1, 1,
627 0, 13, 12, 8, 14, 14, 4, 2, 0, 8, 4, 5, 5, 8, 2, 0, 2,
628 0, 20, 11, 7, 14, 15, 3, 0, 0, 6, 3, 3, 5, 9, 0, 1, 1,
629 0, 6, 17, 4, 14, 14, 6, 1, 1, 5, 2, 3, 5, 7, 0, 1, 0,
630 0, 0, 0, 11, 6, 13, 7, 2, 2, 5, 2, 4, 3, 6, 0, 2, 0,
631 1, 0, 0, 0, 6, 0, 8, 2, 3, 5, 3, 7, 4, 7, 0, 0, 0,
632 0, 0, 0, 0, 0, 0, 6, 0, 4, 4, 7, 10, 4, 0, 0, 0, 0,
633 0, 0, 0, 0, 0, 0, 0, 0, 2, 8, 5, 0, 10, 0, 1, 0, 0,
634 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 1, 0, 0,
635 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0
636 };
637 RadiotherapyData case3_beam1(22, 17, case3_beam1_matrix);
638
639 static const int case3_beam2_matrix[] = {
640 0, 0, 1, 1, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
641 0, 0, 8, 0, 1, 4, 5, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0,
642 2, 0, 0, 0, 3, 2, 2, 1, 1, 0, 0, 1, 4, 7, 11, 9, 0, 0, 0,
643 2, 0, 0, 0, 3, 2, 2, 0, 2, 4, 1, 4, 7, 11, 10, 20, 1, 0, 0,
644 3, 0, 2, 0, 2, 2, 2, 1, 7, 8, 5, 9, 13, 16, 13, 14, 12, 0, 0,
645 2, 0, 1, 0, 3, 2, 4, 5, 15, 16, 12, 11, 15, 17, 15, 14, 9, 0, 3,
646 2, 0, 11, 0, 6, 3, 0, 5, 17, 16, 10, 10, 13, 17, 13, 14, 7, 1, 3,
647 2, 0, 5, 0, 8, 1, 0, 2, 16, 16, 9, 8, 10, 14, 12, 13, 12, 0, 3,
648 0, 0, 0, 2, 8, 1, 0, 7, 15, 17, 7, 8, 10, 12, 9, 12, 5, 1, 0,
649 0, 0, 0, 0, 5, 0, 2, 7, 15, 13, 5, 4, 9, 7, 4, 0, 0, 2, 0,
650 0, 0, 0, 0, 4, 0, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
651 0, 0, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
654 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
655 };
656 RadiotherapyData case3_beam2(15, 19, case3_beam2_matrix);
657
658 static const int case3_beam3_matrix[] = {
659 0, 0, 0, 0, 0, 0, 0, 0, 15, 8, 10, 0, 0, 0, 0, 0, 0,
660 0, 0, 0, 0, 0, 0, 0, 15, 10, 7, 10, 7, 18, 0, 0, 0, 0,
661 0, 3, 5, 5, 3, 0, 7, 8, 12, 9, 12, 11, 20, 0, 0, 0, 0,
662 0, 0, 0, 4, 5, 2, 6, 5, 12, 9, 12, 12, 14, 3, 0, 1, 0,
663 0, 0, 0, 7, 2, 4, 7, 9, 11, 9, 10, 10, 7, 5, 0, 0, 0,
664 0, 0, 1, 7, 1, 2, 7, 8, 10, 4, 5, 1, 0, 0, 0, 0, 0,
665 0, 0, 0, 3, 0, 3, 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
666 0, 7, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0,
667 3, 2, 4, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 7, 10, 8, 0,
668 0, 0, 4, 4, 0, 0, 0, 9, 6, 7, 7, 10, 6, 13, 8, 10, 0,
669 0, 6, 12, 12, 0, 0, 0, 15, 9, 11, 15, 16, 15, 17, 4, 17, 0,
670 0, 5, 14, 12, 5, 0, 9, 18, 15, 18, 19, 18, 16, 17, 6, 14, 0,
671 0, 14, 7, 13, 3, 2, 16, 17, 13, 17, 17, 16, 17, 12, 8, 12, 0,
672 0, 4, 14, 8, 5, 1, 10, 12, 7, 19, 17, 18, 15, 13, 0, 0, 3,
673 0, 0, 6, 10, 0, 0, 0, 4, 5, 16, 17, 16, 13, 15, 2, 0, 3,
674 0, 0, 0, 0, 0, 0, 0, 0, 5, 17, 15, 16, 12, 15, 2, 2, 0,
675 1, 0, 0, 0, 0, 0, 2, 2, 0, 7, 15, 9, 11, 13, 7, 1, 0,
676 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 15, 0, 3, 0,
677 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 1, 2, 0,
678 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0
679 };
680 RadiotherapyData case3_beam3(20, 17, case3_beam3_matrix);
681
682 static const int case3_beam4_matrix[] = {
683 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0,
684 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 3, 0,
685 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 12, 0, 3, 0,
686 2, 0, 0, 0, 0, 0, 2, 0, 10, 9, 20, 0, 0, 15, 0, 3, 0,
687 0, 0, 0, 14, 0, 0, 0, 3, 7, 11, 16, 16, 6, 16, 2, 2, 0,
688 0, 0, 10, 9, 5, 0, 0, 16, 7, 10, 17, 16, 13, 11, 12, 0, 0,
689 0, 9, 10, 10, 5, 2, 11, 9, 9, 12, 16, 18, 12, 13, 3, 0, 3,
690 0, 5, 11, 10, 6, 4, 10, 15, 10, 13, 17, 18, 16, 5, 11, 0, 2,
691 0, 1, 13, 11, 7, 2, 19, 12, 14, 12, 16, 18, 16, 12, 7, 11, 0,
692 0, 0, 14, 6, 7, 0, 0, 11, 13, 13, 17, 16, 16, 11, 7, 11, 0,
693 0, 0, 5, 0, 0, 0, 0, 7, 4, 8, 11, 12, 12, 10, 7, 9, 0,
694 2, 0, 0, 0, 0, 0, 0, 1, 2, 2, 5, 5, 7, 7, 8, 1, 1,
695 3, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 6, 5, 11, 0, 2,
696 0, 6, 3, 2, 2, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0,
697 0, 0, 0, 0, 4, 4, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0,
698 0, 0, 0, 0, 4, 6, 2, 9, 12, 6, 5, 5, 5, 0, 0, 0, 1,
699 0, 0, 0, 4, 2, 4, 0, 7, 10, 8, 10, 10, 5, 0, 0, 1, 0,
700 1, 0, 0, 3, 0, 0, 0, 0, 6, 5, 11, 9, 11, 0, 0, 0, 0,
701 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 10, 13, 13, 0, 0, 0, 0
702 };
703 RadiotherapyData case3_beam4(19, 17, case3_beam4_matrix);
704
705 static const int case3_beam5_matrix[] = {
706 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
707 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
708 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
709 0, 0, 7, 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0,
710 0, 0, 0, 0, 0, 0, 1, 15, 0, 0, 0, 0, 4, 5, 0, 0, 0, 3, 0,
711 0, 0, 0, 0, 1, 0, 0, 13, 2, 0, 5, 9, 9, 9, 1, 7, 0, 3, 0,
712 1, 0, 1, 2, 5, 0, 0, 3, 5, 0, 8, 10, 9, 12, 10, 17, 4, 2, 0,
713 3, 0, 0, 0, 5, 1, 0, 8, 9, 2, 10, 13, 12, 14, 12, 14, 10, 1, 3,
714 3, 0, 0, 0, 3, 2, 2, 11, 11, 8, 14, 15, 16, 17, 15, 15, 5, 2, 3,
715 3, 0, 2, 2, 2, 1, 3, 9, 8, 7, 7, 15, 13, 19, 18, 13, 15, 1, 0,
716 3, 0, 0, 2, 0, 2, 2, 6, 1, 3, 1, 7, 9, 12, 11, 19, 0, 0, 0,
717 3, 0, 0, 4, 0, 2, 3, 2, 1, 1, 0, 3, 4, 7, 20, 0, 0, 0, 0,
718 3, 0, 16, 0, 3, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
719 4, 0, 16, 3, 4, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
720 0, 1, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
721 };
722 RadiotherapyData case3_beam5(15, 19, case3_beam5_matrix);
723
724 static const int case4_beam1_matrix[] = {
725 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
726 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 5, 8, 10, 0, 0, 0, 0, 2,
727 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 2, 9, 2, 0, 2, 1, 2,
728 0, 0, 0, 0, 0, 0, 0, 10, 17, 12, 0, 7, 5, 0, 0, 1, 6, 7, 4, 4, 3, 1,
729 2, 0, 0, 0, 20, 0, 0, 0, 0, 0, 2, 1, 3, 1, 1, 1, 6, 7, 6, 4, 0, 1,
730 2, 1, 0, 8, 6, 0, 0, 0, 0, 0, 0, 2, 3, 2, 2, 1, 6, 7, 7, 7, 0, 0,
731 2, 0, 11, 5, 2, 4, 6, 0, 0, 3, 4, 2, 6, 1, 2, 1, 8, 5, 8, 8, 2, 0,
732 1, 0, 1, 1, 0, 0, 2, 4, 7, 2, 0, 1, 3, 1, 5, 0, 11, 4, 7, 9, 2, 0,
733 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 6, 1, 10, 3, 7, 8, 3, 0,
734 1, 0, 0, 0, 0, 0, 3, 5, 8, 0, 1, 1, 2, 1, 7, 1, 11, 3, 6, 8, 4, 0,
735 1, 0, 7, 4, 2, 6, 6, 0, 6, 3, 2, 4, 7, 6, 10, 2, 11, 3, 6, 7, 4, 0,
736 0, 8, 16, 13, 0, 0, 0, 0, 0, 0, 2, 3, 6, 6, 7, 3, 10, 3, 5, 7, 4, 0,
737 2, 0, 0, 0, 16, 0, 0, 0, 0, 0, 3, 2, 4, 7, 9, 4, 9, 3, 5, 6, 4, 0,
738 0, 0, 0, 0, 0, 0, 0, 12, 6, 8, 5, 4, 5, 8, 6, 3, 8, 3, 5, 6, 3, 0,
739 0, 0, 0, 0, 0, 0, 0, 14, 15, 10, 0, 3, 9, 8, 4, 2, 7, 3, 4, 5, 1, 0,
740 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 4, 2, 7, 2, 4, 5, 0, 2,
741 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 4, 1, 8, 2, 3, 2, 2, 2,
742 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 12, 5, 0, 0, 0, 0, 0, 2,
743 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 0, 0, 0
744 };
745 RadiotherapyData case4_beam1(19, 22, case4_beam1_matrix);
746
747 static const int case4_beam2_matrix[] = {
748 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0,
749 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 3, 2, 9, 17, 10, 11, 6, 0, 0, 5, 0,
750 0, 0, 0, 0, 0, 0, 7, 6, 0, 0, 0, 0, 1, 2, 7, 14, 16, 14, 16, 7, 5, 5, 0, 4,
751 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 5, 10, 16, 20, 12, 17, 8, 13, 13, 0, 4,
752 0, 3, 7, 2, 0, 5, 5, 0, 6, 2, 0, 0, 3, 12, 16, 17, 17, 10, 19, 9, 11, 13, 0, 4,
753 3, 0, 19, 9, 11, 10, 3, 2, 0, 7, 7, 13, 20, 14, 17, 15, 18, 7, 18, 11, 11, 15, 0, 4,
754 0, 3, 4, 9, 10, 9, 0, 2, 0, 2, 0, 13, 13, 13, 14, 14, 17, 4, 17, 11, 11, 16, 0, 4,
755 0, 1, 0, 0, 0, 6, 0, 0, 1, 1, 0, 5, 13, 9, 11, 9, 12, 5, 14, 11, 10, 18, 0, 4,
756 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 9, 8, 7, 12, 2, 13, 10, 11, 17, 0, 4,
757 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 10, 8, 2, 0, 4, 13, 8, 12, 19, 0, 4,
758 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 3, 0, 0, 0, 0, 5, 8, 15, 0, 2, 0,
759 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 5, 0,
760 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 3, 0, 0
761 };
762 RadiotherapyData case4_beam2(13, 24, case4_beam2_matrix);
763
764 static const int case4_beam3_matrix[] = {
765 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0,
766 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0,
767 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0,
768 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 5, 4, 3, 0, 0, 0, 0, 0, 0, 1, 0,
769 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 4, 4, 6, 3, 1, 0, 0, 5, 5, 0, 0, 1, 0,
770 1, 0, 0, 0, 11, 0, 9, 8, 5, 6, 3, 5, 6, 2, 0, 0, 1, 3, 4, 7, 0, 0, 0,
771 2, 2, 0, 0, 7, 11, 0, 6, 8, 5, 6, 2, 3, 0, 0, 0, 2, 1, 5, 3, 3, 0, 0,
772 1, 2, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 3, 1, 3, 2, 2, 0, 0,
773 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 7, 2, 0, 3, 1, 2, 0, 0,
774 1, 0, 6, 2, 4, 7, 3, 0, 0, 0, 3, 4, 6, 8, 6, 6, 4, 0, 2, 1, 3, 0, 2,
775 0, 7, 6, 7, 7, 13, 14, 9, 10, 6, 6, 8, 8, 9, 8, 6, 5, 0, 2, 0, 2, 0, 2,
776 0, 7, 8, 8, 8, 12, 12, 14, 10, 8, 7, 8, 7, 7, 7, 5, 6, 0, 1, 0, 2, 0, 2,
777 0, 0, 0, 1, 7, 20, 13, 8, 17, 11, 6, 6, 5, 6, 9, 7, 7, 0, 1, 0, 3, 0, 2,
778 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 6, 5, 6, 7, 8, 8, 0, 1, 1, 4, 0, 2,
779 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 8, 0, 3, 2, 4, 0, 2,
780 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 4, 5, 0, 0,
781 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0,
782 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0
783 };
784 RadiotherapyData case4_beam3(18, 23, case4_beam3_matrix);
785
786 static const int case4_beam4_matrix[] = {
787 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 7, 1, 2, 0, 0,
788 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 6, 0, 5, 0, 3, 1, 3, 1, 0,
789 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 7, 8, 10, 0, 2, 1, 4, 0, 0,
790 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 8, 9, 8, 1, 2, 1, 4, 0, 2,
791 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 7, 6, 4, 9, 9, 7, 0, 2, 2, 3, 0, 0,
792 0, 0, 0, 0, 3, 17, 8, 9, 15, 14, 6, 10, 5, 5, 7, 5, 5, 1, 2, 3, 3, 0, 2,
793 0, 0, 2, 7, 12, 20, 19, 16, 12, 12, 12, 9, 8, 8, 5, 2, 5, 0, 2, 3, 4, 0, 3,
794 0, 12, 10, 13, 9, 15, 15, 11, 11, 14, 8, 10, 10, 10, 5, 4, 3, 0, 2, 4, 4, 0, 0,
795 0, 2, 13, 4, 6, 12, 10, 6, 4, 7, 5, 6, 8, 8, 5, 4, 2, 0, 3, 3, 4, 0, 0,
796 1, 0, 4, 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 3, 1, 0, 3, 3, 2, 0, 0,
797 2, 1, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 0, 4, 4, 0, 0, 0,
798 2, 3, 0, 0, 13, 0, 2, 9, 0, 8, 7, 8, 2, 0, 0, 0, 4, 2, 6, 4, 4, 0, 0,
799 0, 0, 0, 0, 0, 0, 4, 7, 1, 3, 7, 9, 7, 4, 0, 0, 1, 7, 5, 5, 0, 1, 0,
800 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 9, 7, 8, 7, 1, 0, 0, 0, 0, 0, 0, 1, 0,
801 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 11, 2, 0, 0, 0, 0, 0, 0, 0, 0,
802 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 6, 0, 0, 0, 0, 0, 0, 0,
803 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 7, 0, 0, 0, 0, 0, 0, 0
804 };
805 RadiotherapyData case4_beam4(17, 23, case4_beam4_matrix);
806
807 static const int case4_beam5_matrix[] = {
808 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, 0, 0, 1, 4, 0, 0,
809 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
810 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 8, 6, 0, 0, 0, 6, 2, 10, 0, 3, 0, 0,
811 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 7, 9, 5, 6, 0, 12, 10, 7, 15, 0, 3, 0,
812 4, 0, 0, 0, 12, 0, 0, 0, 0, 9, 7, 10, 4, 4, 0, 8, 0, 15, 12, 10, 11, 0, 3, 0,
813 2, 0, 5, 12, 8, 0, 0, 9, 6, 14, 14, 8, 10, 8, 5, 5, 3, 18, 13, 12, 15, 0, 4, 0,
814 0, 19, 19, 15, 19, 1, 0, 17, 10, 14, 15, 13, 12, 9, 5, 8, 5, 20, 13, 13, 13, 0, 4, 1,
815 3, 3, 14, 0, 10, 0, 15, 8, 5, 9, 2, 5, 10, 11, 5, 9, 7, 20, 15, 11, 11, 0, 4, 0,
816 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 8, 14, 9, 18, 11, 10, 11, 0, 4, 0,
817 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 1, 0, 3, 4, 11, 12, 12, 13, 8, 11, 0, 4, 0,
818 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 4, 0, 2, 0, 2, 10, 9, 13, 6, 0, 0, 2, 3, 0,
819 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 4, 0, 0, 0, 0, 4, 0, 0
820 };
821 RadiotherapyData case4_beam5(12, 24, case4_beam5_matrix);
822
823 static const int case5_beam1_matrix[] = {
824 1, 2, 1, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
825 1, 2, 0, 0, 0, 0, 0, 0, 0, 4, 0, 11, 0, 0, 0, 1,
826 1, 2, 0, 0, 0, 0, 0, 0, 1, 9, 8, 1, 8, 4, 5, 0,
827 1, 2, 0, 0, 5, 0, 4, 4, 1, 7, 4, 5, 5, 5, 4, 0,
828 0, 1, 0, 8, 2, 2, 1, 1, 0, 0, 0, 0, 2, 5, 1, 1,
829 0, 0, 2, 2, 4, 4, 4, 2, 0, 0, 0, 0, 0, 6, 3, 1,
830 0, 1, 3, 2, 3, 5, 4, 1, 2, 2, 4, 2, 2, 6, 4, 1,
831 0, 0, 0, 0, 1, 0, 0, 1, 0, 2, 4, 2, 0, 0, 0, 1,
832 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 0, 0, 1,
833 0, 0, 1, 3, 3, 0, 2, 2, 1, 3, 6, 0, 0, 0, 0, 1,
834 0, 3, 2, 4, 7, 5, 2, 4, 4, 8, 0, 0, 2, 10, 3, 1,
835 0, 3, 3, 7, 9, 7, 4, 3, 0, 0, 0, 0, 0, 6, 4, 0,
836 2, 0, 1, 7, 0, 0, 0, 4, 0, 0, 0, 5, 0, 8, 3, 1,
837 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 6, 0, 2, 1, 1,
838 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2
839 };
840 RadiotherapyData case5_beam1(15, 16, case5_beam1_matrix);
841
842 static const int case5_beam2_matrix[] = {
843 2, 2, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 1, 2,
844 2, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
845 2, 3, 4, 0, 0, 0, 0, 5, 5, 5, 0, 0, 5, 0, 1, 0, 1,
846 2, 2, 4, 0, 0, 0, 0, 0, 2, 2, 3, 0, 3, 0, 1, 5, 0,
847 2, 2, 2, 0, 0, 0, 0, 0, 0, 8, 4, 0, 2, 2, 3, 8, 0,
848 3, 1, 1, 0, 0, 0, 3, 1, 2, 13, 14, 13, 4, 10, 2, 16, 0,
849 3, 2, 0, 0, 0, 0, 0, 0, 9, 19, 16, 6, 8, 18, 2, 9, 0,
850 3, 0, 0, 8, 8, 1, 6, 7, 6, 20, 8, 0, 0, 0, 0, 1, 2,
851 4, 2, 2, 17, 2, 0, 0, 0, 3, 13, 0, 1, 0, 1, 4, 0, 2,
852 2, 6, 0, 8, 0, 0, 3, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1,
853 0, 0, 5, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
854 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
855 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2
856 };
857 RadiotherapyData case5_beam2(13, 17, case5_beam2_matrix);
858
859 static const int case5_beam3_matrix[] = {
860 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
861 1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 4, 1,
862 1, 2, 0, 0, 0, 0, 0, 0, 0, 10, 11, 5, 10, 3, 4, 1,
863 1, 2, 1, 2, 0, 0, 0, 3, 0, 0, 11, 5, 4, 0, 2, 0,
864 2, 1, 0, 9, 0, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 1,
865 1, 3, 3, 0, 0, 4, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2,
866 3, 0, 0, 4, 8, 6, 2, 7, 6, 9, 0, 0, 0, 0, 0, 2,
867 0, 0, 0, 12, 13, 11, 9, 12, 10, 7, 9, 5, 3, 10, 4, 0,
868 0, 0, 10, 14, 13, 10, 12, 15, 9, 11, 12, 8, 7, 8, 9, 0,
869 2, 0, 7, 13, 12, 12, 11, 14, 10, 10, 10, 1, 6, 7, 8, 0,
870 0, 1, 0, 9, 19, 11, 18, 14, 8, 0, 0, 0, 0, 7, 0, 0,
871 0, 0, 0, 0, 8, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2,
872 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 2,
873 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 1, 2
874 };
875 RadiotherapyData case5_beam3(14, 16, case5_beam3_matrix);
876
877 static const int case5_beam4_matrix[] = {
878 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
879 0, 1, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
880 0, 0, 11, 5, 3, 3, 12, 10, 20, 1, 0, 4, 6, 2, 6, 0,
881 1, 0, 9, 7, 7, 10, 11, 8, 8, 18, 12, 8, 6, 4, 8, 0,
882 0, 0, 9, 10, 9, 10, 12, 7, 9, 7, 6, 9, 5, 5, 6, 0,
883 0, 0, 0, 6, 11, 7, 8, 7, 4, 10, 6, 9, 1, 0, 5, 1,
884 3, 1, 0, 0, 5, 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 2,
885 1, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
886 1, 2, 0, 0, 2, 0, 2, 0, 0, 3, 0, 1, 3, 0, 0, 1,
887 1, 2, 0, 0, 0, 0, 0, 0, 11, 1, 6, 6, 4, 0, 3, 0,
888 1, 2, 0, 0, 0, 0, 0, 2, 9, 6, 3, 8, 6, 0, 6, 1,
889 1, 1, 1, 0, 0, 0, 0, 0, 6, 2, 0, 4, 1, 1, 3, 1,
890 1, 1, 1, 0, 0, 0, 0, 0, 3, 0, 0, 6, 0, 1, 1, 1,
891 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 10, 1, 1, 0, 1
892 };
893 RadiotherapyData case5_beam4(14, 16, case5_beam4_matrix);
894
895 static const int case5_beam5_matrix[] = {
896 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 2,
897 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
898 0, 0, 7, 8, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
899 2, 0, 9, 12, 3, 0, 1, 0, 0, 10, 0, 0, 0, 0, 0, 0, 1,
900 3, 0, 10, 11, 11, 1, 9, 3, 5, 0, 6, 3, 14, 12, 0, 0, 3,
901 2, 0, 5, 7, 12, 5, 9, 10, 4, 0, 0, 5, 20, 2, 5, 0, 0,
902 1, 4, 0, 2, 4, 7, 3, 5, 9, 0, 0, 15, 15, 17, 4, 1, 0,
903 2, 4, 0, 0, 0, 0, 0, 0, 6, 0, 5, 12, 9, 14, 6, 8, 0,
904 2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 6, 3, 0,
905 2, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
906 2, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0,
907 2, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
908 };
909 RadiotherapyData case5_beam5(12, 17, case5_beam5_matrix);
911
913 RadiotherapyData rds[] = {rd0, rd1,
914 case1_beam1,
915 case1_beam2,
916 case1_beam3,
917 case1_beam4,
918 case1_beam5,
919 case2_beam1,
920 case2_beam2,
921 case2_beam3,
922 case2_beam4,
923 case2_beam5,
924 case3_beam1,
925 case3_beam2,
926 case3_beam3,
927 case3_beam4,
928 case3_beam5,
929 case4_beam1,
930 case4_beam2,
931 case4_beam3,
932 case4_beam4,
933 case4_beam5,
934 case5_beam1,
935 case5_beam2,
936 case5_beam3,
937 case5_beam4,
938 case5_beam5
939 };
941 const unsigned int rds_n = sizeof(rds) / sizeof(RadiotherapyData);
942}
943// STATISTICS: example-any
struct Gecode::@603::NNF::@65::@66 b
For binary nodes (and, or, eqv)
NodeType t
Type of node.
Base-class for both propagators and branchers.
Definition core.hpp:628
friend class Brancher
Definition core.hpp:633
Archive representation
Definition archive.hpp:42
void put(unsigned int i)
Add i to the contents.
Definition archive.hpp:174
Base-class for branchers.
Definition core.hpp:1442
friend class Choice
Definition core.hpp:1445
Choice for performing commit
Definition core.hpp:1412
virtual void archive(Archive &e) const
Archive into e.
Definition core.cpp:891
Parametric base-class for scripts.
Definition driver.hh:729
static void run(const Options &opt, Script *s=NULL)
Definition script.hpp:290
Home class for posting propagators
Definition core.hpp:856
Passing integer arguments.
Definition int.hh:628
Passing integer variables.
Definition int.hh:656
Integer variable array.
Definition int.hh:763
Integer variables.
Definition int.hh:371
Search engine options
Definition search.hh:746
bool clone
Whether engines create a clone when being initialized.
Definition search.hh:749
Shared array with arbitrary number of elements.
int size(void) const
Return number of elements.
void init(int n)
Initialize as array with n elements.
Options for scripts with additional size parameter
Definition driver.hh:675
Computation spaces.
Definition core.hpp:1742
void update(Space &home, VarArray< Var > &a)
Update array to be a clone of array a.
Definition array.hpp:1013
void update(Space &home, VarImpVar< VarImp > &y)
Update this variable to be a clone of variable y.
Definition var.hpp:116
Instance data for radio therapy problem.
const int n
Width of intensity matrix.
int btMax
Maximal beam time (computed from other parameters)
const int m
Height of intensity matrix.
RadiotherapyData(int m0, int n0, const int *intensity0)
Construct instance data.
const int * intensity
Intensity matrix.
int btMin
Minimal beam time (computed from other parameters)
int intsSum
Sum of all intensities.
Nested search on the q variables.
virtual ExecStatus commit(Space &, const Gecode::Choice &_c, unsigned int)
Perform commit for choice _c and alternative a.
virtual Gecode::Choice * choice(Space &home)
Return choice.
static void post(Home home)
Post brancher.
IntVarArgs getRow(Radiotherapy *row, int i)
virtual void print(const Space &, const Gecode::Choice &_c, unsigned int, std::ostream &o) const
Print explanation.
virtual Choice * choice(const Space &, Archive &e)
Return choice.
size_t dispose(Space &home)
Dispose member function.
virtual bool status(const Space &) const
Check status of brancher, return true if alternatives left.
virtual Actor * copy(Space &home)
Copy brancher.
Example: Radiotherapy
int main(int argc, char *argv[])
Main-function.
virtual void print(std::ostream &os) const
Print solution.
Radiotherapy(Radiotherapy &s)
Constructor for cloning s.
void incr_sum(IntVar &x, IntVarArgs &y, int mn)
Post incremental sum constraint.
virtual Space * copy(void)
Perform copying during cloning.
virtual IntVar cost(void) const
Cost to be minimized.
Radiotherapy(const SizeOptions &opt)
The actual problem.
void parse(int argc, char *argv[])
Parse commandline arguments.
Definition test.cpp:120
void ignore(Actor &a, ActorProperty p, bool duplicate=false)
Ignore actor property.
Definition core.hpp:4074
void notice(Actor &a, ActorProperty p, bool duplicate=false)
Notice actor property.
Definition core.hpp:4059
@ AP_DISPOSE
Actor must always be disposed.
Definition core.hpp:562
void branch(Home home, const FloatVarArgs &x, FloatVarBranch vars, FloatValBranch vals, FloatBranchFilter bf=nullptr, FloatVarValPrint vvp=nullptr)
Branch over x with variable selection vars and value selection vals.
Definition branch.cpp:39
void linear(Home home, const FloatVarArgs &x, FloatRelType frt, FloatVal c)
Post propagator for .
Definition linear.cpp:41
void rel(Home home, FloatVar x0, FloatRelType frt, FloatVar x1)
Post propagator for .
Definition rel.cpp:68
@ IRT_EQ
Equality ( )
Definition int.hh:926
@ IRT_LQ
Less or equal ( )
Definition int.hh:928
@ IPL_DOM
Domain propagation Options: basic versus advanced propagation.
Definition int.hh:979
void quicksort(Type *l, Type *r, Less &less)
Standard quick sort.
Definition sort.hpp:130
Gecode toplevel namespace
IntValBranch INT_VAL_SPLIT_MIN(void)
Select values not greater than mean of smallest and largest value.
Definition val.hpp:75
IntPropLevel ba(IntPropLevel ipl)
Extract basic or advanced from propagation level.
Definition ipl.hpp:43
IntVarBranch INT_VAR_NONE(void)
Select first unassigned variable.
Definition var.hpp:96
Post propagator for SetVar SetOpType SetVar y
Definition set.hh:767
LinIntExpr sum(const IntVarArgs &x)
Construct linear expression as sum of integer variables.
Definition int-expr.cpp:880
IntValBranch INT_VAL_MIN(void)
Select smallest value.
Definition val.hpp:55
T * dfs(T *s, const Search::Options &o=Search::Options::def)
Invoke depth-first search engine for subclass T of space s with options o.
Definition dfs.hpp:73
ExecStatus
Definition core.hpp:472
@ ES_OK
Execution is okay.
Definition core.hpp:476
@ ES_FAILED
Execution has resulted in failure.
Definition core.hpp:474
Post propagator for SetVar x
Definition set.hh:767