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