KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgap > gp > IGPProgram


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.gp;
11
12 import java.io.*;
13 import org.jgap.gp.impl.*;
14 import org.jgap.util.*;
15
16 /**
17  * Interface for GP programs.
18  *
19  * @author Klaus Meffert
20  * @since 3.0
21  */

22 public interface IGPProgram
23     extends Serializable, Comparable JavaDoc, ICloneable {
24   /**
25    * Executes the given chromosome as an integer function.
26    *
27    * @param a_chromosomeNum the index of the chromosome to execute
28    * @param a_args the arguments to use
29    * @return the integer return value
30    *
31    * @author Klaus Meffert
32    * @since 3.0
33    */

34   int execute_int(int a_chromosomeNum, Object JavaDoc[] a_args);
35
36   /**
37    * Executes the given chromosome as a float function.
38    *
39    * @param a_chromosomeNum the index of the chromosome to execute
40    * @param a_args the arguments to use
41    * @return the floar return value
42    *
43    * @author Klaus Meffert
44    * @since 3.0
45    */

46   float execute_float(int a_chromosomeNum, Object JavaDoc[] a_args);
47
48   /**
49    * Executes the given chromosome as a double function.
50    *
51    * @param a_chromosomeNum the index of the chromosome to execute
52    * @param a_args the arguments to use
53    * @return the double return value
54    *
55    * @author Klaus Meffert
56    * @since 3.0
57    */

58   double execute_double(int a_chromosomeNum, Object JavaDoc[] a_args);
59
60   /**
61    * Executes the given chromosome as an object function.
62    *
63    * @param a_chromosomeNum the index of the chromosome to execute
64    * @param a_args the arguments to use
65    * @return the object return value
66    *
67    * @author Klaus Meffert
68    * @since 3.0
69    */

70   Object JavaDoc execute_object(int a_chromosomeNum, Object JavaDoc[] a_args);
71
72   /**
73    * Executes the given chromosome as an object function.
74    *
75    * @param a_chromosomeNum the index of the chromosome to execute
76    * @param a_args the arguments to use
77    *
78    * @author Klaus Meffert
79    * @since 3.0
80    */

81   void execute_void(int a_chromosomeNum, Object JavaDoc[] a_args);
82
83   /**
84    * @return the number of chromosomes in the program
85    *
86    * @author Klaus Meffert
87    * @since 3.0
88    */

89   int size();
90
91   /**
92    * @param a_index the chromosome to get
93    * @return the ProgramChromosome with the given index
94    *
95    * @author Klaus Meffert
96    * @since 3.0
97    */

98   ProgramChromosome getChromosome(int a_index);
99
100   /**
101    * @return fitness value of this program
102    *
103    * @author Klaus Meffert
104    * @since 3.0
105    */

106   double getFitnessValue();
107
108   /**
109    * Builds a String that represents the normalized output of the GPProgram.
110    * @param a_startNode the node to start with
111    * @return output in normalized notion
112    *
113    * @author Klaus Meffert
114    * @since 3.0
115    */

116   String JavaDoc toStringNorm(int a_startNode);
117
118   /**
119    * Sets the given chromosome at the given index.
120    *
121    * @param a_index sic
122    * @param a_chrom sic
123    *
124    * @author Klaus Meffert
125    * @since 3.0
126    */

127   void setChromosome(int a_index, ProgramChromosome a_chrom);
128
129   /**
130    * Searches for a chromosome that has the given class and returns its index.
131    *
132    * @param a_chromosomeNum the index of the chromosome to start the search with
133    * @param a_class the class to find
134    * @return the index of the first chromosome found that is of a_class, or -1
135    *
136    * @author Klaus Meffert
137    * @since 3.0
138    */

139   int getCommandOfClass(int a_chromosomeNum, Class JavaDoc a_class);
140
141   void setFitnessValue(double a_fitness);
142
143   void setTypes(Class JavaDoc[] a_types);
144
145   Class JavaDoc[] getTypes();
146
147   void setArgTypes(Class JavaDoc[][] a_argTypes);
148
149   Class JavaDoc[][] getArgTypes();
150
151   void setNodeSets(CommandGene[][] a_nodeSets);
152
153   CommandGene[][] getNodeSets();
154
155   void setMaxDepths(int[] a_maxDepths);
156
157   int[] getMaxDepths();
158
159   void setMinDepths(int[] a_minDepths);
160
161   int[] getMinDepths();
162
163   void setMaxNodes(int a_maxNodes);
164
165   int getMaxNodes();
166
167   GPConfiguration getGPConfiguration();
168
169   /**
170    * Sets the application data object.
171    *
172    * @param a_data the object to set
173    *
174    * @author Klaus Meffert
175    * @since 3.01
176    */

177   void setApplicationData(Object JavaDoc a_data);
178
179   /**
180    * @return the application data object set
181    *
182    * @author Klaus Meffert
183    * @since 3.01
184    */

185   Object JavaDoc getApplicationData();
186 }
187
Popular Tags