Source Code Cross Referenced for IChromosome.java in  » Development » jgap » org » jgap » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » jgap » org.jgap 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of JGAP.
003:         *
004:         * JGAP offers a dual license model containing the LGPL as well as the MPL.
005:         *
006:         * For licensing information please see the file license.txt included with JGAP
007:         * or have a look at the top of class org.jgap.Chromosome which representatively
008:         * includes the JGAP license policy applicable for any file delivered with JGAP.
009:         */
010:        package org.jgap;
011:
012:        import java.io.*;
013:        import org.jgap.util.*;
014:
015:        /**
016:         * Interface for chromosomes.
017:         * Normally, you would start using BaseChromosome which implements this
018:         * interface to build your own chromosome classes.
019:         *
020:         * @author Klaus Meffert
021:         * @since 2.6
022:         */
023:        public interface IChromosome extends Comparable, ICloneable,
024:                Serializable {
025:            /** String containing the CVS revision. Read out via reflection!*/
026:            final static String CVS_REVISION = "$Revision: 1.13 $";
027:
028:            /**
029:             * Constants for toString()
030:             */
031:            public final static String S_FITNESS_VALUE = "Fitness value";
032:
033:            public final static String S_ALLELES = "Alleles";
034:
035:            public final static String S_APPLICATION_DATA = "Application data";
036:
037:            public final static String S_SIZE = "Size";
038:
039:            /**
040:             * Returns the Gene at the given index (locus) within the Chromosome. The
041:             * first gene is at index zero and the last gene is at the index equal to
042:             * the size of this Chromosome - 1.
043:             *
044:             * @param a_desiredLocus index of the gene value to be returned
045:             * @return Gene at the given index
046:             *
047:             * @author Neil Rotstan
048:             * @author Klaus Meffert
049:             * @since 2.6
050:             */
051:            Gene getGene(int a_desiredLocus);
052:
053:            /**
054:             * Retrieves the set of genes that make up this Chromosome. This method
055:             * exists primarily for the benefit of GeneticOperators that require the
056:             * ability to manipulate Chromosomes at a low level.
057:             *
058:             * @return an array of the Genes contained within this Chromosome
059:             *
060:             * @author Neil Rotstan
061:             * @author Klaus Meffert
062:             * @since 2.6
063:             */
064:            Gene[] getGenes();
065:
066:            /**
067:             * Sets the genes for the chromosome.
068:             * @param a_genes the genes to set for the chromosome
069:             *
070:             * @throws InvalidConfigurationException in case constraint checker is
071:             * provided
072:             *
073:             * @author Klaus Meffert
074:             * @since 2.6
075:             */
076:            void setGenes(Gene[] a_genes) throws InvalidConfigurationException;
077:
078:            /**
079:             * Returns the size of this Chromosome (the number of genes it contains).
080:             * A Chromosome's size is constant and will not change, until setGenes(...)
081:             * is used.
082:             *
083:             * @return number of genes contained within this Chromosome instance
084:             *
085:             * @author Klaus Meffert
086:             * @author Neil Rotstan
087:             * @since 2.6
088:             */
089:            int size();
090:
091:            /**
092:             * Sets the fitness value of this Chromosome. This method is for use
093:             * by bulk fitness functions and should not be invokved from anything
094:             * else (except test cases).
095:             *
096:             * @param a_newFitnessValue a positive integer representing the fitness
097:             * of this Chromosome
098:             *
099:             * @author Neil Rotstan
100:             * @since 2.6
101:             */
102:            void setFitnessValue(double a_newFitnessValue);
103:
104:            /**
105:             * Sets the fitness value of this Chromosome directly without any
106:             * constraint checks, conversions or checks. Only use if you know what
107:             * you do.
108:             *
109:             * @param a_newFitnessValue a positive integer representing the fitness
110:             * of this Chromosome
111:             *
112:             * @author Klaus Meffert
113:             * @since 2.6
114:             */
115:            void setFitnessValueDirectly(double a_newFitnessValue);
116:
117:            /**
118:             * Retrieves the fitness value of this Chromosome, as determined by the
119:             * active fitness function. If a bulk fitness function is in use and
120:             * has not yet assigned a fitness value to this Chromosome, then -1 is
121:             * returned.<p>
122:             * Attention: should not be called from toString() as the fitness value would
123:             * be computed if it was initial!
124:             *
125:             * @return a positive double value representing the fitness of this
126:             * Chromosome, or -1 if a bulk fitness function is in use and has not yet
127:             * assigned a fitness value to this Chromosome
128:             *
129:             * @author Neil Rotstan
130:             * @author Klaus Meffert
131:             * @since 2.6
132:             */
133:            double getFitnessValue();
134:
135:            /**
136:             * @return the lastly computed fitness value, or FitnessFunction.NO_FITNESS_VALUE
137:             * in case no value has been computed yet.
138:             *
139:             * @author Klaus Meffert
140:             * @since 2.6
141:             */
142:            double getFitnessValueDirectly();
143:
144:            /**
145:             * Sets whether this Chromosome has been selected by the natural selector
146:             * to continue to the next generation or manually (e.g. via an add-method).
147:             *
148:             * @param a_isSelected true if this Chromosome has been selected, false
149:             * otherwise
150:             *
151:             * @author Neil Rotstan
152:             * @author Klaus Meffert
153:             * @since 2.6
154:             */
155:            void setIsSelectedForNextGeneration(boolean a_isSelected);
156:
157:            /**
158:             * Retrieves whether this Chromosome has been selected by the natural
159:             * selector to continue to the next generation.
160:             *
161:             * @return true if this Chromosome has been selected, false otherwise
162:             *
163:             * @author Neil Rotstan
164:             * @author Klaus Meffert
165:             * @since 2.6
166:             */
167:            boolean isSelectedForNextGeneration();
168:
169:            /**
170:             * Sets the constraint checker to be used for this gene whenever method
171:             * setAllele(Object) is called.
172:             *
173:             * @param a_constraintChecker the constraint checker to be set
174:             * @throws InvalidConfigurationException
175:             *
176:             * @author Klaus Meffert
177:             * @since 2.6
178:             */
179:            void setConstraintChecker(IGeneConstraintChecker a_constraintChecker)
180:                    throws InvalidConfigurationException;
181:
182:            /**
183:             * This sets the application-specific data that is attached to this
184:             * Chromosome. Attaching application-specific data may be useful for
185:             * some applications when it comes time to evaluate this Chromosome
186:             * in the fitness function.
187:             *
188:             * @param a_newData the new application-specific data to attach to this
189:             * Chromosome. Should be an instance of IApplicationData
190:             *
191:             * @author Neil Rotstan
192:             * @author Klaus Meffert
193:             * @since 2.6
194:             */
195:            void setApplicationData(Object a_newData);
196:
197:            /**
198:             * Retrieves the application-specific data that is attached to this
199:             * Chromosome. Attaching application-specific data may be useful for
200:             * some applications when it comes time to evaluate this Chromosome
201:             * in the fitness function. JGAP ignores this data functionally.
202:             *
203:             * @return the application-specific data previously attached to this
204:             * Chromosome, or null if there is no data attached
205:             *
206:             * @author Neil Rotstan
207:             * @author Klaus Meffert
208:             * @since 2.6
209:             */
210:            Object getApplicationData();
211:
212:            /**
213:             * Invoked when this Chromosome is no longer needed and should perform
214:             * any necessary cleanup. Note that this method will attempt to release
215:             * this Chromosome instance to the active ChromosomePool, if any.
216:             *
217:             * @author Neil Rotstan
218:             * @author Klaus Meffert
219:             * @since 2.6
220:             */
221:            void cleanup();
222:
223:            /**
224:             * @return the configuration set
225:             *
226:             * @author Klaus Meffert
227:             * @since 3.0
228:             */
229:            Configuration getConfiguration();
230:
231:            /**
232:             * Increases the number of evolutionary rounds of chromosome in which it has
233:             * not been changed by one.
234:             *
235:             * @author Klaus Meffert
236:             * @since 3.2
237:             */
238:            void increaseAge();
239:
240:            /**
241:             * Reset age of chromosome because it has been changed.
242:             *
243:             * @author Klaus Meffert
244:             * @since 3.2
245:             */
246:            void resetAge();
247:
248:            /**
249:             * @return 0: Chromosome newly created in this generation. This means it
250:             * does not need being crossed over with another newly created one
251:             *
252:             * @author Klaus Meffert
253:             * @since 3.2
254:             */
255:            int getAge();
256:
257:            /**
258:             * Increase information of number of genetic operations performed on
259:             * chromosome in current evolution round.
260:             *
261:             * @author Klaus Meffert
262:             * @since 3.2
263:             */
264:            void increaseOperatedOn();
265:
266:            /**
267:             * Resets the information of how many genetic operators have been performed
268:             * on the chromosome in the current round of evolution.
269:             *
270:             * @author Klaus Meffert
271:             * @since 3.2
272:             *
273:             */
274:            void resetOperatedOn();
275:
276:            /**
277:             * @return number of genetic operations performed on chromosome in current
278:             * evolution round
279:             *
280:             * @author Klaus Meffert
281:             * @since 3.2
282:             */
283:            int operatedOn();
284:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.