JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.permutation
Class PermutationEvolvable

java.lang.Object
  extended bygov.nasa.javaGenes.core.Evolvable
      extended bygov.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

Field Summary
protected  int[] permutation
           
 
Fields inherited from class gov.nasa.javaGenes.core.Evolvable
childMakersUsed
 
Constructor Summary
PermutationEvolvable(int size)
           
PermutationEvolvable(int size, java.lang.String order)
           
 
Method Summary
 java.lang.Object clone()
          deep copy
 PermutationEvolvable deepCopyPermutationEvolvable()
           
 double distanceFrom(Evolvable e)
          Subclasses will almost always override this.
 boolean equals(int[] array)
          used for testing
 int getIndexAt(int i)
           
 int getSize()
           
 boolean isInAscendingOrder()
           
 boolean isPermutation()
           
 boolean isSame(PermutationEvolvable other)
           
 void setIndexAt(int index, int setTo)
           
 void setToAscending()
          used for testing
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.core.Evolvable
addChildMakers, copyForEvolution, getChildMakersUsed, getSmallest, prepareForEvaluator, stateSave
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

permutation

protected int[] permutation
Constructor Detail

PermutationEvolvable

public PermutationEvolvable(int size)

PermutationEvolvable

public PermutationEvolvable(int size,
                            java.lang.String order)
Method Detail

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()

JavaGenes, NASA Ames. Written largely by Al Globus