1 10 package examples.grid.fitnessDistributed; 11 12 import org.jgap.*; 13 import org.jgap.distr.grid.*; 14 import org.apache.log4j.*; 15 16 23 public class MyClientFeedback 24 implements IClientFeedback { 25 26 private final static String CVS_REVISION = "$Revision: 1.4 $"; 27 28 private final static String className = MyClientFeedback.class.getName(); 29 30 private static Logger log = Logger.getLogger(className); 31 32 public MyClientFeedback() { 33 } 34 35 public void error(String msg, Exception ex) { 36 log.error("Error catched on client side: " + msg, ex); 37 } 38 39 public void sendingFragmentRequest(JGAPRequest req) { 40 log.warn("Sending work request " + req.getRID()); 41 } 42 43 public void receivedFragmentResult(JGAPRequest req, JGAPResult res, 44 int idx) { 45 log.warn("Receiving work (index " + idx + "). First solution: " + 46 res.getPopulation().getChromosome(0)); 47 } 48 49 public void beginWork() { 50 log.warn("Client starts sending work requests"); 51 } 52 53 public void endWork() { 54 log.warn("Your request was processed completely"); 55 } 56 57 public void info(String a_msg) { 58 log.warn(a_msg); 59 } 60 61 public void setProgressMaximum(int max) { 62 } 63 64 public void setProgressMinimum(int min) { 65 } 66 67 public void setProgressValue(int val) { 68 } 69 70 public void setRenderingTime(MyRequest req, long dt) { 71 } 72 73 public void completeFrame(int idx) { 74 log.warn("Client notified that unit " + idx + " is finished."); 75 } 76 } 77 | Popular Tags |