The Doctor Rostering Problem - Asser Fahrenholz
The Doctor Rostering Problem - Asser Fahrenholz
The Doctor Rostering Problem - Asser Fahrenholz
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Appendix A. Implementation 73<br />
33 }<br />
34 return res ;<br />
35 }<br />
36 return null ;<br />
37 }<br />
38<br />
39 public ArrayList < ArrayList < <strong>Doctor</strong> >> choose2 ( ArrayList < <strong>Doctor</strong> > b, int k) {<br />
40 res = new ArrayList < ArrayList < <strong>Doctor</strong> > >();<br />
41<br />
42 return enumerate2 (b, b. size () , k);<br />
43 }<br />
44<br />
45 private void swap2 ( ArrayList < <strong>Doctor</strong> > b, int i, int j) {<br />
46 <strong>Doctor</strong> temp = b. get (i);<br />
47 b. set (i, b. get (j));<br />
48 b. set (j, temp );<br />
49 }<br />
50<br />
51 public ArrayList < ArrayList < <strong>Doctor</strong> >> getRes () {<br />
52 return res ;<br />
53 }<br />
54 }<br />
A.5.3 Day assignments<br />
1 /* *<br />
2 * Returns the best doctor for a given shift on a given day .<br />
3 *<br />
4 * @param dayInt<br />
5 * the day<br />
6 * @param RCLsize<br />
7 * the size the RCL<br />
8 * @param minimizing<br />
9 * @return <strong>The</strong> best doctor for the shift<br />
10 */<br />
11 public Change getBestChange (<br />
12 int dayInt , RCLParameter RCLsize , boolean minimizing , Rules rules ) {<br />
13<br />
14 if ( rules != null ) {<br />
15 this . myRules = rules ;<br />
16 }<br />
17<br />
18 Vector >> bestChange = new Vector > >();<br />
20 Permutation t = new Permutation ();<br />
21<br />
22 ArrayList < <strong>Doctor</strong> > doc = new ArrayList < <strong>Doctor</strong> >() ;<br />
23 doc . addAll ( docs );<br />
24<br />
25 t. choose2 (doc , this . get ( dayInt ). getAllMiddayShifts (). size ());<br />
26<br />
27 ArrayList < ArrayList < <strong>Doctor</strong> >> set = t. getRes ();