1 31 package org.objectweb.proactive.examples.doctor; 32 33 public class Patient { 34 35 int id; 36 RandomTime rand; 37 Office off; 38 long meanWell, sigmaWell; 39 40 41 public Patient() { 42 } 43 44 45 public Patient(Integer _id, Long _meanWell, Long _sigmaWell, Office _off, RandomTime _rand) { 46 id = _id.intValue(); 47 meanWell = _meanWell.longValue(); 48 sigmaWell = _sigmaWell.longValue(); 49 off = _off; 50 rand = _rand; 51 } 52 53 54 public void init() { 55 isWell(); 56 } 57 58 59 public void isWell() { 60 long temps = rand.gaussianTime(meanWell, sigmaWell); 61 62 try { 63 Thread.sleep(temps); 64 } catch (InterruptedException e) { 65 } 66 67 off.patientSick(id); 68 } 69 70 71 public void hasDoctor(int _doc) { 72 } 73 74 75 public void receiveCure(Cure _cure) { 76 isWell(); 77 } 78 } 79 | Popular Tags |