evSOLve.JEvolution
Class SubsetPermChromosome
java.lang.Object
|
+--evSOLve.JEvolution.Chromosome
|
+--evSOLve.JEvolution.PermChromosome
|
+--evSOLve.JEvolution.SubsetPermChromosome
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- public class SubsetPermChromosome
- extends PermChromosome
The bases are a permutation of integers, but only the first subSetSize
bases are considered for the Phenotype. Moreover, it is not important which
order the elements of the subset have, as this encoding should just deliver
subsets without any order properties. Thus, two methods for the subSetSize
are added. For efficiency hashCode() and equals() are
implemented by considering the smaller subset of bases.
- Version:
- 0.4
- Author:
- Helmut A. Mayer
- See Also:
- Serialized Form
Method Summary |
boolean |
equals(java.lang.Object o)
An efficient check for equality. |
int |
getSubsetSize()
Return subset size. |
int |
hashCode()
An efficient hash code. |
void |
setSubsetSize(int subSetSize)
Change subset size. |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
SubsetPermChromosome
public SubsetPermChromosome()
- The standard constructor.
equals
public boolean equals(java.lang.Object o)
- An efficient check for equality. It only checks the bases, first, if the number
of bases is equal, and then if the smaller subset of base values are the same.
- Overrides:
equals
in class PermChromosome
hashCode
public int hashCode()
- An efficient hash code. Uses Vector.hashCode(), but it first creates a Vector
where only the bases of the smaller subset are copied in order to keep the number
of different keys as small as possible.
- Overrides:
hashCode
in class PermChromosome
getSubsetSize
public int getSubsetSize()
- Return subset size.
setSubsetSize
public void setSubsetSize(int subSetSize)
throws JEvolutionException
- Change subset size.
- Parameters:
subSetSize
- The number of elements in the subset.- Throws:
JEvolutionException
- Invalid size.