| java.lang.Object org.jgap.BaseGene
All known Subclasses: org.jgap.impl.SetGene, org.jgap.impl.NumberGene, org.jgap.impl.MapGene, org.jgap.impl.CompositeGene, org.jgap.impl.BooleanGene, org.jgap.impl.FixedBinaryGene, org.jgap.supergenes.AbstractSupergene, org.jgap.impl.StringGene,
BaseGene | abstract public class BaseGene implements Gene,IBusinessKey(Code) | | Abstract base class for all genes. Provides default implementations.
author: Klaus Meffert since: 2.2 |
DELTA | final public static double DELTA(Code) | | Delta, useful for comparing doubles and floats.
|
S_APPLICATION_DATA | final public static String S_APPLICATION_DATA(Code) | | Constants for toString()
|
cleanup | public void cleanup()(Code) | | Executed by the genetic engine when this Gene instance is no
longer needed and should perform any necessary resource cleanup.
If you need a special cleanup, override this method.
author: Klaus Meffert since: 1.0 |
compareApplicationData | protected int compareApplicationData(Object a_appdata1, Object a_appdata2)(Code) | | |
equals | public boolean equals(Object a_other)(Code) | | Compares this Gene with the given object and returns true if the other
object is a Gene of the same type and has the same value (allele) as
this Gene. Otherwise it returns false.
Parameters: a_other - the object to compare to this Gene for equality true if this Gene is equal to the given object, false otherwise author: Klaus Meffert since: 1.1 |
getAllele | public Object getAllele()(Code) | | Retrieves the allele value represented by this Gene.
the allele value of this Gene since: 1.0 |
getApplicationData | public Object getApplicationData()(Code) | | Retrieves the application-specific data that is attached to this Gene.
Attaching application-specific data may be useful for
some applications when it comes time to distinguish a Gene from another.
JGAP ignores this data functionally.
the application-specific data previously attached to this Gene,or null if there is no data attached author: Klaus Meffert since: 2.4 |
getConfiguration | public Configuration getConfiguration()(Code) | | the configuration set author: Klaus Meffert since: 3.0 |
getConstraintChecker | public IGeneConstraintChecker getConstraintChecker()(Code) | | IGeneConstraintChecker the constraint checker to be used whenevermethod setAllele(Object) is called. author: Klaus Meffert since: 2.5 (moved from CompositeGene, where it was since 2.0) |
getEnergy | public double getEnergy()(Code) | | energy of the gene author: Klaus Meffert since: 2.3 |
getInternalValue | abstract protected Object getInternalValue()(Code) | | Each Gene implementation holds its own m_value object keeping the allele
value. In your Gene implementation, just return it with this method
(see
org.jgap.impl.BooleanGene for example)
the m_value object author: Klaus Meffert since: 2.2 |
hashCode | public int hashCode()(Code) | | Retrieves the hash code value for a Gene.
Override if another hashCode() implementation is necessary or more
appropriate than this default implementation.
this Gene's hash code author: Neil Rotstan author: Klaus Meffert since: 1.0 |
isCompareApplicationData | public boolean isCompareApplicationData()(Code) | | |
newGene | public Gene newGene()(Code) | | Provides implementation-independent means for creating new Gene
instances. The new instance that is created and returned should be
setup with any implementation-dependent configuration that this Gene
instance is setup with (aside from the actual value, of course). For
example, if this Gene were setup with bounds on its value, then the
Gene instance returned from this method should also be setup with
those same bounds. This is important, as the JGAP core will invoke this
method on each Gene in the sample Chromosome in order to create each
new Gene in the same respective gene position for a new Chromosome.
a new Gene instance of the same type and with the same setup asthis concrete Gene author: Neil Rostan author: Klaus Meffert since: 2.6 (since 1.0 in IntegerGene) |
newGeneInternal | abstract protected Gene newGeneInternal()(Code) | | |
setApplicationData | public void setApplicationData(Object a_newData)(Code) | | This sets the application-specific data that is attached to this Gene.
Attaching application-specific data may be useful for
some applications when it comes time to distinguish a Gene from another.
JGAP ignores this data functionally.
Parameters: a_newData - the new application-specific data to attach to thisGene author: Klaus Meffert since: 2.4 |
setCompareApplicationData | public void setCompareApplicationData(boolean a_doCompare)(Code) | | Should we also consider the application data when comparing? Default is
"false" as "true" means a Gene is losing its identity when
application data is set differently!
Parameters: a_doCompare - true: consider application data in method compareTo author: Klaus Meffert since: 2.4 |
setConstraintChecker | public void setConstraintChecker(IGeneConstraintChecker a_constraintChecker)(Code) | | Sets the constraint checker to be used for this gene whenever method
setAllele(Object) is called.
Parameters: a_constraintChecker - the constraint checker to be set author: Klaus Meffert since: 2.5 (moved from CompositeGene, where it was since 2.0) |
setEnergy | public void setEnergy(double a_energy)(Code) | | Sets the energy of the gene
Parameters: a_energy - the energy to set author: Klaus Meffert since: 2.3 |
size | public int size()(Code) | | the size of the gene, i.e the number of atomic elements. Always 1for non-composed Gene types. Override for composed Gene types author: Neil Rotstan since: 1.0 |
toString | public String toString()(Code) | | Retrieves a string representation of this Gene's value that
may be useful for display purposes.
a string representation of this Gene's value author: Klaus Meffert since: 1.0 |
|
|