P
- the problem typeR
- the representation typepublic class EpigeneticIndividual<P extends Problem<R>,R extends Representation<?>> extends java.util.ArrayList<EpigeneticCell<P,R>> implements java.lang.Comparable<EpigeneticIndividual<P,R>>
Constructor and Description |
---|
EpigeneticIndividual()
Constructor.
|
EpigeneticIndividual(P problem,
int size)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EpigeneticIndividual<P,R> o) |
void |
crossover(EpigeneticIndividual<P,R> other)
Individual's crossover.
|
EpigeneticIndividual<P,R> |
duplicate()
Duplicates the individual.
|
boolean |
equals(java.lang.Object obj) |
EpigeneticCell<P,R> |
getBestCell()
Returns the best cell in the individual.
|
int |
hashCode() |
boolean |
isBetter(EpigeneticIndividual<P,R> other)
Returns true if the best cell of the individual is better than the best in other.
|
void |
methilate(float eprobability)
Individual's crossover.
|
void |
setBestCell(EpigeneticCell<P,R> cell)
Sets the best cell in the individual.
|
java.lang.String |
toString() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
public EpigeneticIndividual()
public EpigeneticIndividual(P problem, int size)
problem
- the problem.size
- the number of cells in the individual.public EpigeneticIndividual<P,R> duplicate()
public boolean isBetter(EpigeneticIndividual<P,R> other)
other
- the other individual.public EpigeneticCell<P,R> getBestCell()
public void setBestCell(EpigeneticCell<P,R> cell)
cell
- the cell which replaces the current best cell.public void crossover(EpigeneticIndividual<P,R> other)
other
- the other Individualpublic void methilate(float eprobability)
eprobability
- the epigenetic probabilitypublic int compareTo(EpigeneticIndividual<P,R> o)
compareTo
in interface java.lang.Comparable<EpigeneticIndividual<P extends Problem<R>,R extends Representation<?>>>
public java.lang.String toString()
toString
in class java.util.AbstractCollection<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
public int hashCode()
hashCode
in interface java.util.Collection<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
hashCode
in interface java.util.List<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
hashCode
in class java.util.AbstractList<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Collection<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
equals
in interface java.util.List<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>
equals
in class java.util.AbstractList<EpigeneticCell<P extends Problem<R>,R extends Representation<?>>>