Java Doc for IntegerGene.java in  » Development » jgap » org » jgap » impl » 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.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jgap.BaseGene
      org.jgap.impl.NumberGene
         org.jgap.impl.IntegerGene

IntegerGene
public class IntegerGene extends NumberGene implements IPersistentRepresentation(Code)
A Gene implementation that supports an integer values for its allele. Upper and lower bounds may optionally be provided to restrict the range of legal values allowed by this Gene instance.
author:
   Neil Rotstan
author:
   Klaus Meffert
since:
   1.0


Field Summary
final protected static  longINTEGER_RANGE
     Represents the constant range of values supported by integers.

Constructor Summary
public  IntegerGene()
     Constructs a new IntegerGene with default settings.
public  IntegerGene(Configuration a_config)
     Constructs a new IntegerGene with default settings.
public  IntegerGene(Configuration a_config, int a_lowerBounds, int a_upperBounds)
     Constructs a new IntegerGene with the specified lower and upper bounds for values (alleles) of this Gene instance.

Method Summary
public  voidapplyMutation(int a_index, double a_percentage)
     See interface Gene for description.
protected  intcompareToNative(Object a_o1, Object a_o2)
     Compares to objects by first casting them into their expected type (e.g.
public  intgetLowerBounds()
    
public  StringgetPersistentRepresentation()
     Retrieves a string representation of this Gene that includes any information required to reconstruct it at a later time, such as its value and internal state.
public  intgetUpperBounds()
    
public  inthashCode()
     Modified hashCode() function to return different hashcodes for differently ordered genes in a chromosome.
public  intintValue()
     Retrieves the int value of this Gene, which may be more convenient in some cases than the more general getAllele() method.
protected  voidmapValueToWithinBounds()
     Maps the value of this IntegerGene to within the bounds specified by the m_upperBounds and m_lowerBounds instance variables.
protected  GenenewGeneInternal()
     Provides implementation-independent means for creating new Gene instances.
public  voidsetToRandomValue(RandomGenerator a_numberGenerator)
     Sets the value (allele) of this Gene to a random Integer value between the lower and upper bounds (if any) of this Gene.
Parameters:
  a_numberGenerator - the random number generator that should beused to create any random values.
public  voidsetValueFromPersistentRepresentation(String a_representation)
     Sets the value and internal state of this Gene from the string representation returned by a previous invocation of the getPersistentRepresentation() method.
public  StringtoString()
    

Field Detail
INTEGER_RANGE
final protected static long INTEGER_RANGE(Code)
Represents the constant range of values supported by integers.




Constructor Detail
IntegerGene
public IntegerGene() throws InvalidConfigurationException(Code)
Constructs a new IntegerGene with default settings. No bounds will be put into effect for values (alleles) of this Gene instance, other than the standard range of integer values.

Attention: The configuration used is the one set with the static method Genotype.setConfiguration.
throws:
  InvalidConfigurationException -
author:
   Neil Rostan
author:
   Klaus Meffert
since:
   1.0




IntegerGene
public IntegerGene(Configuration a_config) throws InvalidConfigurationException(Code)
Constructs a new IntegerGene with default settings. No bounds will be put into effect for values (alleles) of this Gene instance, other than the standard range of integer values.
Parameters:
  a_config - the configuration to use
throws:
  InvalidConfigurationException -
author:
   Klaus Meffert
since:
   3.0



IntegerGene
public IntegerGene(Configuration a_config, int a_lowerBounds, int a_upperBounds) throws InvalidConfigurationException(Code)
Constructs a new IntegerGene with the specified lower and upper bounds for values (alleles) of this Gene instance.
Parameters:
  a_config - the configuration to use
Parameters:
  a_lowerBounds - the lowest value that this Gene may possess,inclusive
Parameters:
  a_upperBounds - the highest value that this Gene may possess,inclusive
throws:
  InvalidConfigurationException -
author:
   Klaus Meffert
since:
   2.0




Method Detail
applyMutation
public void applyMutation(int a_index, double a_percentage)(Code)
See interface Gene for description.
Parameters:
  a_index - ignored (because there is only 1 atomic element)
Parameters:
  a_percentage - percentage of mutation (greater than -1 and smallerthan 1)
author:
   Klaus Meffert
since:
   1.1



compareToNative
protected int compareToNative(Object a_o1, Object a_o2)(Code)
Compares to objects by first casting them into their expected type (e.g. Integer for IntegerGene) and then calling the compareTo-method of the casted type.
Parameters:
  a_o1 - first object to be compared, always is not null
Parameters:
  a_o2 - second object to be compared, always is not null a negative integer, zero, or a positive integer as this objectis less than, equal to, or greater than the object provided for comparison
author:
   Neil Rostan
since:
   1.0



getLowerBounds
public int getLowerBounds()(Code)
the lower bounds of the integer gene
author:
   Klaus Meffert
since:
   2.6



getPersistentRepresentation
public String getPersistentRepresentation()(Code)
Retrieves a string representation of this Gene that includes any information required to reconstruct it at a later time, such as its value and internal state. This string will be used to represent this Gene in XML persistence. This is an optional method but, if not implemented, XML persistence and possibly other features will not be available. An UnsupportedOperationException should be thrown if no implementation is provided. string representation of this Gene's current state
author:
   Neil Rostan
since:
   1.0



getUpperBounds
public int getUpperBounds()(Code)
the upper bounds of the integer gene
author:
   Klaus Meffert
since:
   2.6



hashCode
public int hashCode()(Code)
Modified hashCode() function to return different hashcodes for differently ordered genes in a chromosome. -1 if no allele set, otherwise value return by BaseGene.hashCode()
author:
   Klaus Meffert
since:
   2.2



intValue
public int intValue()(Code)
Retrieves the int value of this Gene, which may be more convenient in some cases than the more general getAllele() method. the int value of this Gene
author:
   Neil Rostan
since:
   1.0



mapValueToWithinBounds
protected void mapValueToWithinBounds()(Code)
Maps the value of this IntegerGene to within the bounds specified by the m_upperBounds and m_lowerBounds instance variables. The value's relative position within the integer range will be preserved within the bounds range (in other words, if the value is about halfway between the integer max and min, then the resulting value will be about halfway between the upper bounds and lower bounds). If the value is null or is already within the bounds, it will be left unchanged.
author:
   Neil Rostan
author:
   Klaus Meffert
since:
   1.0



newGeneInternal
protected Gene newGeneInternal()(Code)
Provides implementation-independent means for creating new Gene instances. a new Gene instance of the same type and with the same setup asthis concrete Gene
author:
   Klaus Meffert
since:
   2.6 (was newGene since 1.0, moved to BaseGene)



setToRandomValue
public void setToRandomValue(RandomGenerator a_numberGenerator)(Code)
Sets the value (allele) of this Gene to a random Integer value between the lower and upper bounds (if any) of this Gene.
Parameters:
  a_numberGenerator - the random number generator that should beused to create any random values. It's important to use this generator tomaintain the user's flexibility to configure the genetic engine to use therandom number generator of their choice
author:
   Neil Rostan
author:
   Klaus Meffert
since:
   1.0



setValueFromPersistentRepresentation
public void setValueFromPersistentRepresentation(String a_representation) throws UnsupportedRepresentationException(Code)
Sets the value and internal state of this Gene from the string representation returned by a previous invocation of the getPersistentRepresentation() method. This is an optional method but, if not implemented, XML persistence and possibly other features will not be available. An UnsupportedOperationException should be thrown if no implementation is provided.
Parameters:
  a_representation - the string representation retrieved from aprior call to the getPersistentRepresentation() method
throws:
  UnsupportedOperationException - to indicate that no implementationis provided for this method
throws:
  UnsupportedRepresentationException - if this Gene implementationdoes not support the given string representation
author:
   Neil Rostan
since:
   1.0



toString
public String toString()(Code)
string representation of this Gene's value that may be useful fordisplay purposes
author:
   Klaus Meffert
since:
   2.4



Methods inherited from org.jgap.impl.NumberGene
public int compareTo(Object a_other)(Code)(Java Doc)
abstract protected int compareToNative(Object a_o1, Object a_o2)(Code)(Java Doc)
protected Object getInternalValue()(Code)(Java Doc)
abstract protected void mapValueToWithinBounds()(Code)(Java Doc)
public void setAllele(Object a_newValue)(Code)(Java Doc)

Fields inherited from org.jgap.BaseGene
final public static double DELTA(Code)(Java Doc)
final public static String S_APPLICATION_DATA(Code)(Java Doc)

Methods inherited from org.jgap.BaseGene
public void cleanup()(Code)(Java Doc)
protected int compareApplicationData(Object a_appdata1, Object a_appdata2)(Code)(Java Doc)
protected String decode(String a_string)(Code)(Java Doc)
protected String encode(String a_string)(Code)(Java Doc)
public boolean equals(Object a_other)(Code)(Java Doc)
public Object getAllele()(Code)(Java Doc)
public Object getApplicationData()(Code)(Java Doc)
public String getBusinessKey()(Code)(Java Doc)
public Configuration getConfiguration()(Code)(Java Doc)
public IGeneConstraintChecker getConstraintChecker()(Code)(Java Doc)
public double getEnergy()(Code)(Java Doc)
abstract protected Object getInternalValue()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public boolean isCompareApplicationData()(Code)(Java Doc)
public Gene newGene()(Code)(Java Doc)
abstract protected Gene newGeneInternal()(Code)(Java Doc)
public void setApplicationData(Object a_newData)(Code)(Java Doc)
public void setCompareApplicationData(boolean a_doCompare)(Code)(Java Doc)
public void setConstraintChecker(IGeneConstraintChecker a_constraintChecker)(Code)(Java Doc)
public void setEnergy(double a_energy)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.