The Doctor Rostering Problem - Asser Fahrenholz
The Doctor Rostering Problem - Asser Fahrenholz The Doctor Rostering Problem - Asser Fahrenholz
Appendix A. Implementation 69 73 if (( newLocalScore > bestScore && ! minimize ) || ( newLocalScore < bestScore && minimize )) { 74 setBestSchedule ( working ); 75 localImprovements ++; 76 acceptedSolutions ++; 77 } 78 } else { 79 if ( rand < ( Math . exp (( solutionValue_increase ) / temp ))) { 80 acceptedSolutions ++; 81 } else { 82 working . performChange (c, true ); 83 rejectedSolutions ++; 84 } 85 } 86 } else { 87 rejectedSolutions ++; 88 working . performChange (c, true ); 89 } 90 progress = ( super . type . compareTo ( Type . Rounds ) == 0) ? (100 * loopCounter / maxRounds ) : ( int ) (100 * ( System . currentTimeMillis () - startTime ) / getTimeToRun ()); 91 setProgress ( progress ); 92 firePropertyChange (" score ", null , bestScore ); 93 firePropertyChange (" violations ", null , bestVio ); 94 test = ( super . type . compareTo ( Type . Rounds ) == 0) ? ( loopCounter < maxRounds ) : ( System . currentTimeMillis () - startTime ) < getTimeToRun (); 95 temp = alpha * temp ; 96 point = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ? loopCounter : ( System . currentTimeMillis () - startTime ), bestVio ); 97 point2 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ? loopCounter : ( System . currentTimeMillis () - startTime ), bestScore ); 98 point3 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ? loopCounter : ( System . currentTimeMillis () - startTime ), newLocalVio ); 99 point4 = new XYDataItem ( super . type . compareTo ( Type . Rounds ) == 0 ? loopCounter : ( System . currentTimeMillis () - startTime ), newLocalScore ); 100 tempPoint = new XYDataItem ( loopCounter ++ , temp ); 101 series . add ( point ); 102 series2 . add ( point2 ); 103 series3 . add ( point3 ); 104 series4 . add ( point4 ); 105 tempSeries . add ( tempPoint ); 106 } 107 printSAStatsToConsole (); 108 printMetaStatsToConsole (); 109 getBestSchedule (). setOptimizer ( this ); 110 111 } catch ( Exception e) { 112 System . out . println (" Caught exception : " + e. getCause ()); 113 e. printStackTrace (); 114 } 115 return null ; 116 } 117 118 public void printSAStatsToConsole () {
Appendix A. Implementation 70 119 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap < Shift , HashSet >>>> workingSol = working . getSolutionValue ( false , null ); 120 System . out . println (" -------------- SA STATS : --------------"); 121 System . out . println (" Alpha : " + alpha ); 122 System . out . println (" Working value : " + workingSol . getE ()); 123 System . out . println (" Violations : " + workingSol . getV (). getE (). size ()); 124 System . out . println (" Initial value : " + initialScore ); 125 System . out . println (" Stopped due to: " + (( System . currentTimeMillis () - startTime ) > getTimeToRun () ? " Running time " 126 : ( loopCounter > maxRounds ? " Loops " : ( temp < temp_end ? " Temperature " 127 : " Not running time , temp nor rounds ")))); 128 System . out . println (" -------------- --------------"); 129 } 130 131 @Override 132 public void exceptionThrown ( Exception e) { 133 System . out . println (" Exception was caught .. I think ... Here it is:" + e. getCause ()); 134 e. printStackTrace (); 135 } 136 137 public XYSeries getTempSeries () { 138 return tempSeries ; 139 } 140 } A.5 Choosing the assignment A.5.1 Shift assignments 1 /* * 2 * Returns the best doctor for a given shift on a given day . 3 * 4 * @param day 5 * the day 6 * @param RCLsize 7 * the size of the RCL 8 * @param shift 9 * the shift 10 * @return The best doctor for the shift 11 */ 12 public Doctor getBestDoctor ( 13 Day day , Shift shift , RCLParameter RCLsize , boolean minimize , Rules 14 rules ) { 15 if ( rules != null ) { 16 this . myRules = rules ; 17 } 18
- 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 and 38: Chapter 4. Solving the DRP 26 decre
- Page 39 and 40: Chapter 4. Solving the DRP 28 This
- 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: Appendix A. Implementation 68 27 su
- 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
- Page 89 and 90: Appendix B. GAMS Model 78 46 c(day
- Page 91 and 92: Appendix B. GAMS Model 80 109 B1( f
- Page 93 and 94: Appendix B. GAMS Model 82 **** REPO
- Page 95 and 96: Appendix B. GAMS Model 84 B.3 The s
- Page 97 and 98: Appendix B. GAMS Model 86 B.3.3 The
- Page 99 and 100: Appendix C. Tests 88 C.1.1 Instance
- Page 101 and 102: Appendix C. Tests 90 C.1.2 Instance
- Page 103 and 104: Appendix C. Tests 92 C.1.4 Instance
- Page 105 and 106: Appendix C. Tests 94 JST PZH HP SDA
- Page 107 and 108: Appendix C. Tests 96 JST PZH HP SDA
- Page 109 and 110: Appendix C. Tests 98 C.1.8 Instance
- Page 111 and 112: Appendix C. Tests 100 Cons 12 Imps
- Page 113 and 114: Appendix C. Tests 102 Test 3 RCL 1
- Page 115 and 116: Appendix C. Tests 104 Test 7 RCL 1
- Page 117 and 118: Appendix C. Tests 106 Test 1 RCL 1
- Page 119 and 120: Appendix C. Tests 108 Test 5 RCL 1
- Page 121 and 122: Appendix C. Tests 110 Test 9 RCL 1
- Page 123 and 124: Appendix C. Tests 112 Test 3 RCL 1
- Page 125 and 126: Appendix C. Tests 114 Test 7 RCL 1
- Page 127 and 128: Appendix C. Tests 116 160 140 120 1
- Page 129 and 130: Bibliography 118 [10] Michael R. Ga
Appendix A. Implementation 70<br />
119 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap<br />
< Shift , HashSet >>>> workingSol = working .<br />
getSolutionValue ( false , null );<br />
120 System . out . println (" -------------- SA STATS : --------------");<br />
121 System . out . println (" Alpha : " + alpha );<br />
122 System . out . println (" Working value : " + workingSol . getE ());<br />
123 System . out . println (" Violations : " + workingSol . getV (). getE (). size ());<br />
124 System . out . println (" Initial value : " + initialScore );<br />
125 System . out . println (" Stopped due to: " + (( System . currentTimeMillis () -<br />
startTime ) > getTimeToRun () ? " Running time "<br />
126 : ( loopCounter > maxRounds ? " Loops " : ( temp < temp_end ? "<br />
Temperature "<br />
127 : " Not running time , temp nor rounds "))));<br />
128 System . out . println (" -------------- --------------");<br />
129 }<br />
130<br />
131 @Override<br />
132 public void exceptionThrown ( Exception e) {<br />
133 System . out . println (" Exception was caught .. I think ... Here it is:" + e.<br />
getCause ());<br />
134 e. printStackTrace ();<br />
135 }<br />
136<br />
137 public XYSeries getTempSeries () {<br />
138 return tempSeries ;<br />
139 }<br />
140 }<br />
A.5 Choosing the assignment<br />
A.5.1 Shift assignments<br />
1 /* *<br />
2 * Returns the best doctor for a given shift on a given day .<br />
3 *<br />
4 * @param day<br />
5 * the day<br />
6 * @param RCLsize<br />
7 * the size of the RCL<br />
8 * @param shift<br />
9 * the shift<br />
10 * @return <strong>The</strong> best doctor for the shift<br />
11 */<br />
12 public <strong>Doctor</strong> getBest<strong>Doctor</strong> (<br />
13 Day day , Shift shift , RCLParameter RCLsize , boolean minimize , Rules<br />
14<br />
rules ) {<br />
15 if ( rules != null ) {<br />
16 this . myRules = rules ;<br />
17 }<br />
18