1 31 package org.objectweb.proactive.examples.doctor; 32 33 public class Doctor { 34 35 int id; 36 RandomTime rand; 37 Office off; 38 long meanDur, sigmaDur; 39 40 41 public Doctor() { 42 } 43 44 45 public Doctor(Integer _id, Long _meanDur, Long _sigmaDur, Office _off, RandomTime _rand) { 46 id = _id.intValue(); 47 meanDur = _meanDur.longValue(); 48 sigmaDur = _sigmaDur.longValue(); 49 off = _off; 50 rand = _rand; 51 } 52 53 54 public void curePatient(int _pat) { 55 long temps = rand.gaussianTime(meanDur, sigmaDur); 56 57 try { 58 Thread.sleep(temps); 59 } catch (InterruptedException e) { 60 } 61 62 off.doctorCureFound(id, _pat, new Cure()); 63 } 64 } 65 | Popular Tags |