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 67<br />
141 e. printStackTrace ();<br />
142 }<br />
143<br />
144 getBestSchedule (). setRCL ( this . RCLsize );<br />
145 getBestSchedule (). setConstructorID ( this . hashCode ());<br />
146 getBestSchedule (). setDoS ( this . dos );<br />
147<br />
148 return null ;<br />
149 }<br />
150<br />
151 public void printGRASPStatsToConsole () {<br />
152 Pair < Integer , Pair < HashMap < Shift , HashSet >>, HashMap<br />
< Shift , HashSet >>>> workingSol = working .<br />
getSolutionValue ( false , null );<br />
153 System . out . println (" -------------- GRASP STATS : --------------");<br />
154 System . out . println (" Working value : " + workingSol . getE () + "||" +<br />
workingSol . getV (). getE (). size ());<br />
155 System . out . println (" -------------- --------------");<br />
156 }<br />
157 }<br />
A.4 Simulated Annealing metaheuristic<br />
1 package heuristic . meta ;<br />
2<br />
3 import basic . Rules ;<br />
4 import changes . RotationInt ;<br />
5 import ds. <strong>Doctor</strong> ;<br />
6 import ds. Pair ;<br />
7 import ds. Schedule ;<br />
8 import ds. Shift ;<br />
9 import heuristic . Metaheuristic ;<br />
10 import java . beans . ExceptionListener ;<br />
11 import java . util . HashMap ;<br />
12 import java . util . HashSet ;<br />
13 import org . jfree . data .xy. XYDataItem ;<br />
14 import org . jfree . data .xy. XYSeries ;<br />
15 import org . jfree . data .xy. XYSeriesCollection ;<br />
16<br />
17 public class Simulated_annealing extends Metaheuristic implements<br />
18<br />
ExceptionListener {<br />
19 private double temp ;<br />
20 private double alpha = 0.999;<br />
21 private double temp_end ;<br />
22 private boolean minimize ;<br />
23 private XYDataItem tempPoint ;<br />
24 private XYSeries tempSeries ;<br />
25<br />
26 public Simulated_annealing ( double timeToRun , int maxRotation , Rules myRules ,<br />
RotationInt rotationInt , Schedule s, Type t, int rounds , boolean diagram ,<br />
boolean minimize ) {