KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > distr > grid > JGAPResult


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 org.jgap.distr.grid;
11
12 import org.homedns.dade.jcgrid.*;
13 import org.jgap.*;
14
15 /**
16  * Holds the result of a worker.
17  *
18  * @author Klaus Meffert
19  * @since 3.1
20  */

21 public class JGAPResult
22     extends WorkResult {
23   /** String containing the CVS revision. Read out via reflection!*/
24   private final static String JavaDoc CVS_REVISION = "$Revision: 1.2 $";
25
26   private IChromosome m_fittest;
27   private Population m_pop;
28
29   private long m_unitDone;
30
31   /**
32    *
33    * @param name String
34    * @param id int
35    * @param a_fittestChrom IChromosome
36    * @param a_unitdone long
37    * @deprecated use other constructor with Population parameter instead
38    */

39   public JGAPResult(String JavaDoc name, int id, IChromosome a_fittestChrom,
40                     long a_unitdone) {
41     super(name, id);
42     m_fittest = a_fittestChrom;
43     m_unitDone = a_unitdone;
44   }
45
46   /**
47    * Constructor: Takes a Population as result of a worker's computation.
48    *
49    * @param name arbritrary session name to distinct from other results
50    * @param id ID of the result, should be unique must need not
51    * @param a_chromosomes the result of a worker's computation
52    * @param a_unitdone number of units done
53    *
54    * @author Klaus Meffert
55    * @since 3.2
56    */

57   public JGAPResult(String JavaDoc name, int id, Population a_chromosomes,
58                     long a_unitdone) {
59     super(name, id);
60     m_fittest = null;
61     m_pop = a_chromosomes;
62     m_unitDone = a_unitdone;
63   }
64
65   /**
66    * @return IChromosome
67    * @deprecated use getPopulation instead
68    */

69   public IChromosome getFittest() {
70     return m_fittest;
71   }
72
73   /**
74    * @return the Population as a result from a worker's computation
75    *
76    * @author Klaus Meffert
77    * @since 3.2
78    */

79   public Population getPopulation() {
80     return m_pop;
81   }
82
83   public long getUnitDone() {
84     return m_unitDone;
85   }
86 }
87
Popular Tags