net.sourceforge.cilib.entity.comparator
Class AscendingFitnessComparator<E extends Entity>

java.lang.Object
  extended by net.sourceforge.cilib.entity.comparator.AscendingFitnessComparator<E>
All Implemented Interfaces:
Comparator<E>

public class AscendingFitnessComparator<E extends Entity>
extends Object
implements Comparator<E>

Comparator to order Entity instances based on fitness values. This comparator results in a ascending order. This ordering is effectively an ordering of entity instances from the "least fit" to the "most fit".

Author:
Gary Pampara

Constructor Summary
AscendingFitnessComparator()
           
 
Method Summary
 int compare(E e1, E e2)
          Compare the Entity objects returning the desired ordering.
 
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
 

Constructor Detail

AscendingFitnessComparator

public AscendingFitnessComparator()
Method Detail

compare

public int compare(E e1,
                   E e2)
Compare the Entity objects returning the desired ordering.

Specified by:
compare in interface Comparator<E extends Entity>
Parameters:
e1 - The first Entity to be used in the comparison.
e2 - The second Entity to be used in the comparison.
Returns:
-1 if e1 is less than e2; 0 if e1 and e2 are equal 1 if e2 is greater than e1


Copyright © 2009 CIRG. All Rights Reserved.