com.anji.neat
Class WeightMagnitudeComparator

java.lang.Object
  extended bycom.anji.neat.WeightMagnitudeComparator
All Implemented Interfaces:
java.util.Comparator

public class WeightMagnitudeComparator
extends java.lang.Object
implements java.util.Comparator

sorts ConnectionGenes in ascending order of weight magnitude


Method Summary
 int compare(java.lang.Object o1, java.lang.Object o2)
           
static WeightMagnitudeComparator getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Method Detail

getInstance

public static WeightMagnitudeComparator getInstance()
Returns:
singleton

compare

public int compare(java.lang.Object o1,
                   java.lang.Object o2)
Specified by:
compare in interface java.util.Comparator
Parameters:
o1 -
o2 -
Returns:
compare absolute value of weights of ConnectionAllele objects; return 1 if o1>o2, 0 if o1==o2; -1 otherwise