JavaGenes, NASA Ames. Written largely by Al Globus

gov.nasa.javaGenes.EOSscheduling
Class SqueakyWheelTournamentSwapMutation

java.lang.Object
  extended bygov.nasa.javaGenes.core.ChildMaker
      extended bygov.nasa.javaGenes.permutation.PermutationChildMaker
          extended bygov.nasa.javaGenes.permutation.PermutationOrderMutation
              extended bygov.nasa.javaGenes.EOSscheduling.SqueakyWheelTournamentSwapMutation
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
SqueakyWheelPlacedTSM

public class SqueakyWheelTournamentSwapMutation
extends PermutationOrderMutation

See Also:
Serialized Form

Field Summary
protected  int backLargerThanForward
           
protected  int backSameAsForward
           
protected  int backSmallerThanForward
           
protected  int indexDifferenceSum
           
protected  int[] indices
           
protected  IntegerInterval legalRange
           
protected  EOSModel model
           
protected  int moveBackIndex
           
protected  int moveForwardIndex
           
 
Fields inherited from class gov.nasa.javaGenes.permutation.PermutationOrderMutation
numberOfSwaps
 
Fields inherited from class gov.nasa.javaGenes.core.ChildMaker
cumulative, forEvolution, last
 
Constructor Summary
SqueakyWheelTournamentSwapMutation(EOSModel inModel, int inNumberOfSwaps, int tournamentSize)
          Do numberOfSwaps swaps.
 
Method Summary
protected  void calculateOutputMeasures(EOSschedulingEvolvable kid)
           
protected  int getFirstIndex(PermutationEvolvable kid)
           
protected  int getSecondIndex(PermutationEvolvable kid, int firstIndex)
           
protected  boolean moreDeservingToMoveBack(EOSschedulingEvolvable kid, int index)
           
protected  boolean moreDeservingToMoveForward(EOSschedulingEvolvable kid, int index)
           
protected  void setUpIndices(EOSschedulingEvolvable kid)
           
protected  void setUpIndicesFromArray(EOSschedulingEvolvable kid)
          testing purposes only, has no randomization here!
protected  boolean shouldSecondGoForward(EOSschedulingEvolvable kid, int firstIndex, int secondIndex)
           
 java.lang.String subClassMeasures()
           
 java.lang.String toString()
           
 
Methods inherited from class gov.nasa.javaGenes.permutation.PermutationOrderMutation
makeChildren, mutate, numberOfParents
 
Methods inherited from class gov.nasa.javaGenes.permutation.PermutationChildMaker
copyIndex
 
Methods inherited from class gov.nasa.javaGenes.core.ChildMaker
checkLastResults, checkResults, clearLast, getAndClearLastTabSeparatedResults, getFitnessFunctionNames, getLastTabSeparatedResults, headerFragment, makeChildren, mutate, neverUsed, proportionDown, results, setFitnessFunction, setFitnessFunctionNames, tabSeparatedResults
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

indices

protected int[] indices

legalRange

protected IntegerInterval legalRange

moveForwardIndex

protected int moveForwardIndex

moveBackIndex

protected int moveBackIndex

model

protected EOSModel model

indexDifferenceSum

protected int indexDifferenceSum

backSmallerThanForward

protected int backSmallerThanForward

backLargerThanForward

protected int backLargerThanForward

backSameAsForward

protected int backSameAsForward
Constructor Detail

SqueakyWheelTournamentSwapMutation

public SqueakyWheelTournamentSwapMutation(EOSModel inModel,
                                          int inNumberOfSwaps,
                                          int tournamentSize)
Do numberOfSwaps swaps. For each swap Take n random takeImages. n should generally be fairly large. Swap two of them. They are chosen thusly: 1. The one that most needs to move forward in the permutation, by these criteria (in order) - unscheduled rather than scheduled - higher priority - further back in the permutation 2. The one that can be moved backward in the permutation with maximum effect, by these criteria (in order) - scheduled rather than unscheduled - lower priority - further forward in the permutation

Method Detail

getFirstIndex

protected int getFirstIndex(PermutationEvolvable kid)
Overrides:
getFirstIndex in class PermutationOrderMutation

getSecondIndex

protected int getSecondIndex(PermutationEvolvable kid,
                             int firstIndex)
Overrides:
getSecondIndex in class PermutationOrderMutation

calculateOutputMeasures

protected void calculateOutputMeasures(EOSschedulingEvolvable kid)

setUpIndices

protected void setUpIndices(EOSschedulingEvolvable kid)

setUpIndicesFromArray

protected void setUpIndicesFromArray(EOSschedulingEvolvable kid)
testing purposes only, has no randomization here!


moreDeservingToMoveForward

protected boolean moreDeservingToMoveForward(EOSschedulingEvolvable kid,
                                             int index)

moreDeservingToMoveBack

protected boolean moreDeservingToMoveBack(EOSschedulingEvolvable kid,
                                          int index)

shouldSecondGoForward

protected boolean shouldSecondGoForward(EOSschedulingEvolvable kid,
                                        int firstIndex,
                                        int secondIndex)

subClassMeasures

public java.lang.String subClassMeasures()
Overrides:
subClassMeasures in class ChildMaker

toString

public java.lang.String toString()
Overrides:
toString in class PermutationOrderMutation

JavaGenes, NASA Ames. Written largely by Al Globus