KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > grid > evolutionDistributed > MyGAWorker


1 /*
2  * This file is part of JGAP.
3  *
4  * JGAP offers a dual license model containing the LGPL as well as the MPL.
5  *
6  * For licencing information please see the file license.txt included with JGAP
7  * or have a look at the top of class org.jgap.Chromosome which representatively
8  * includes the JGAP license policy applicable for any file delivered with JGAP.
9  */

10 package examples.grid.evolutionDistributed;
11
12 import org.homedns.dade.jcgrid.*;
13 import org.jgap.*;
14 import org.jgap.distr.grid.*;
15
16 /**
17  * Receives work, computes a solution and returns the solution to the requester.
18  * This is done by solely using the JGAP standard mechanism of the super class,
19  * JGAPWorker. You could do differently, see other examples provided with JGAP.
20  *
21  * @author Klaus Meffert
22  * @since 3.2
23  */

24 public class MyGAWorker
25     extends JGAPWorker {
26   /** String containing the CVS revision. Read out via reflection!*/
27   private final static String JavaDoc CVS_REVISION = "$Revision: 1.1 $";
28
29   /**
30    * Executes the evolution and returns the result.
31    *
32    * @param a_work WorkRequest
33    * @param a_workDir String
34    * @return WorkResult
35    * @throws Exception
36    *
37    * @author Klaus Meffert
38    * @since 3.2
39    */

40   public WorkResult doWork(WorkRequest a_work, String JavaDoc a_workDir)
41       throws Exception JavaDoc {
42    // Doing the evolution as always just means:
43
// -----------------------------------------
44
return super.doWork(a_work, a_workDir);
45   }
46
47 }
48
Popular Tags