The Doctor Rostering Problem - Asser Fahrenholz
The Doctor Rostering Problem - Asser Fahrenholz The Doctor Rostering Problem - Asser Fahrenholz
Chapter 4. Solving the DRP 27 Figure 4.6: The implementation of the schedule tests of the heuristics which should provide an indication of the performance of the heuristics. 4.4 Heuristic implementations In this section, I will briefly cover the implementation of the heuristics described in this chapter, but before doing so, it is necessary to describe the data structure of the implementation. 4.4.1 The data structure The language chosen to implement the heuristics is Java. It contains specific JDK 1.6 implementations, meaning that the runtime environment required to run the program is Java JRE 1.6, which can be downloaded from Sun.com. The fact that one goal of this project was to deliver a program allowing the end user to produce schedules and that I had no previous experience with other environments than Java, made this decision easy. The approach chosen to design the program is one where user friendliness is prioritised. It was accepted from the beginning that neither I nor the end user would appreciate a low level language implementation, such as one in C, containing no graphical user interface. The implementation is done in an object oriented approach, meaning that every schedule, shift and day is instantiated as objects. This approach is chosen due to simplicity when modeling the problem. A downside to this is that the amount of object allocations can rise quickly when testing several problem instances. The schedule is modeled as a list (a Vector) of days and days are modeled as a list (an ArrayList) of shifts. Due to constraint H4, all days contains four shifts, while certain days contains five or six. The implementation is pictured in figure 4.6.
Chapter 4. Solving the DRP 28 This model, where only a variable for each day and shift is available, is different from what is done in an optimal solver, i.e. GAMS. The difference lies in the approach of solving the problem. In my implementation, each shift object is assigned a doctor object, is chosen. In the GAMS model, a binary variable for every day, shift and doctor exists. The schedule, being the main object of the implementation also contains the methods for selecting the best doctor for a given shift or day. These two methods are included in appendix A.5. In the following sections, I describe the implementation of the construction heuristic and the metaheuristics chosen in this project. It is important to note that the implemen- tations share several methods and therefore are extending the same basic class. This allows the classes to take advantage of Javas extend, allowing the heuristics to inherit methods that they share from so called parent classes. This is depicted in figure 4.7. 4.4.2 A partial enumeration Figure 4.7: Heuristics inheritance In the construction heuristic, the option of enumerating the assignments of a whole day of shifts, as opposed to only assigning one shift at a time, is available. The enumeration algorithm produces all permutations of size k chosen from N elements and is adopted from Sedgewick and Wayne [21] (which no longer seems to be available as of the time of writing). Sedgewick and Wayne [21] originally created the class for use with characters only. I adopted it into a version permuting a list of doctor objects instead. This permutation class can be found in appendix A.5.2.
- Page 1 and 2: TECHNICAL UNIVERSITY OF DENMARK The
- Page 3 and 4: TECHNICAL UNIVERSITY OF DENMARK Abs
- Page 5 and 6: Acknowledgements Foremost, I would
- Page 7 and 8: Contents vi 4.3.1 A construction he
- Page 9 and 10: List of Figures 4.1 The transformat
- Page 11 and 12: List of Algorithms 4.1 Adaptive gre
- Page 13 and 14: Chapter 1. Introduction and problem
- Page 15 and 16: Chapter 2. The Doctor Rostering Pro
- Page 17 and 18: Chapter 2. The Doctor Rostering Pro
- Page 19 and 20: Chapter 3 A mathematical model for
- Page 21 and 22: Chapter 3. The model and design 10
- Page 23 and 24: Chapter 3. The model and design 12
- Page 25 and 26: Chapter 3. The model and design 14
- Page 27 and 28: Chapter 4. Solving the DRP 16 it in
- Page 29 and 30: Chapter 4. Solving the DRP 18 4.3.1
- Page 31 and 32: Chapter 4. Solving the DRP 20 Given
- Page 33 and 34: Chapter 4. Solving the DRP 22 Since
- Page 35 and 36: Chapter 4. Solving the DRP 24 1. Co
- Page 37: Chapter 4. Solving the DRP 26 decre
- Page 41 and 42: Chapter 4. Solving the DRP 30 Simul
- Page 43 and 44: Chapter 5. Optimal solution 32 The
- Page 45 and 46: Chapter 6 The DRP Program Through t
- Page 47 and 48: Chapter 6. The DRP Program 36 Figur
- Page 49 and 50: Chapter 6. The DRP Program 38 of th
- Page 51 and 52: Chapter 6. The DRP Program 40 Figur
- Page 53 and 54: Chapter 7 Metaheuristic tests This
- Page 55 and 56: Chapter 7. Tests, results and discu
- Page 57 and 58: Chapter 7. Tests, results and discu
- Page 59 and 60: Chapter 7. Tests, results and discu
- Page 61 and 62: Chapter 7. Tests, results and discu
- Page 63 and 64: Chapter 7. Tests, results and discu
- Page 65 and 66: Chapter 8. Future considerations 54
- Page 67 and 68: Chapter 8. Future considerations 56
- Page 69 and 70: Chapter 9. Conclusion 58 The three
- Page 71 and 72: Appendix A. Implementation 60 27 //
- Page 73 and 74: 2 Appendix A. Implementation 62 3 i
- Page 75 and 76: Appendix A. Implementation 64 A.3 G
- Page 77 and 78: Appendix A. Implementation 66 97 wh
- Page 79 and 80: Appendix A. Implementation 68 27 su
- Page 81 and 82: Appendix A. Implementation 70 119 P
- Page 83 and 84: Appendix A. Implementation 72 64 br
- Page 85 and 86: Appendix A. Implementation 74 28 Ch
- Page 87 and 88: Appendix B GAMS Model This chapter
Chapter 4. Solving the DRP 28<br />
This model, where only a variable for each day and shift is available, is different from<br />
what is done in an optimal solver, i.e. GAMS. <strong>The</strong> difference lies in the approach of<br />
solving the problem. In my implementation, each shift object is assigned a doctor object,<br />
is chosen. In the GAMS model, a binary variable for every day, shift and doctor exists.<br />
<strong>The</strong> schedule, being the main object of the implementation also contains the methods<br />
for selecting the best doctor for a given shift or day. <strong>The</strong>se two methods are included in<br />
appendix A.5.<br />
In the following sections, I describe the implementation of the construction heuristic and<br />
the metaheuristics chosen in this project. It is important to note that the implemen-<br />
tations share several methods and therefore are extending the same basic class. This<br />
allows the classes to take advantage of Javas extend, allowing the heuristics to inherit<br />
methods that they share from so called parent classes. This is depicted in figure 4.7.<br />
4.4.2 A partial enumeration<br />
Figure 4.7: Heuristics inheritance<br />
In the construction heuristic, the option of enumerating the assignments of a whole day<br />
of shifts, as opposed to only assigning one shift at a time, is available. <strong>The</strong> enumeration<br />
algorithm produces all permutations of size k chosen from N elements and is adopted<br />
from Sedgewick and Wayne [21] (which no longer seems to be available as of the time of<br />
writing). Sedgewick and Wayne [21] originally created the class for use with characters<br />
only. I adopted it into a version permuting a list of doctor objects instead. This<br />
permutation class can be found in appendix A.5.2.