gov.nasa.javaGenes.permutation
Class PermutationEvolvable
java.lang.Object
gov.nasa.javaGenes.core.Evolvable
gov.nasa.javaGenes.permutation.PermutationEvolvable
- All Implemented Interfaces:
- java.lang.Cloneable, java.io.Serializable
- Direct Known Subclasses:
- EOSschedulingEvolvable
- public class PermutationEvolvable
- extends Evolvable
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
permutation
protected int[] permutation
PermutationEvolvable
public PermutationEvolvable(int size)
PermutationEvolvable
public PermutationEvolvable(int size,
java.lang.String order)
isPermutation
public boolean isPermutation()
isSame
public boolean isSame(PermutationEvolvable other)
equals
public boolean equals(int[] array)
- used for testing
setToAscending
public void setToAscending()
- used for testing
isInAscendingOrder
public boolean isInAscendingOrder()
deepCopyPermutationEvolvable
public PermutationEvolvable deepCopyPermutationEvolvable()
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- deep copy
- Throws:
java.lang.CloneNotSupportedException
getSize
public int getSize()
- Overrides:
getSize
in class Evolvable
- Returns:
- the size of the object
getIndexAt
public int getIndexAt(int i)
setIndexAt
public void setIndexAt(int index,
int setTo)
distanceFrom
public double distanceFrom(Evolvable e)
- Description copied from class:
Evolvable
- Subclasses will almost always override this.
- Overrides:
distanceFrom
in class Evolvable
- Returns:
- the distance from Evolvable e.
toString
public java.lang.String toString()