public int CompareTo(object obj) { Individual other = (Individual)obj; // sort from higher to lower return(other.getFitness().CompareTo(getFitness())); }
public int compareTo(Object obj) { Individual other = (Individual)obj; // sort from lower to higher // return new Double(getFitness()).compareTo(new Double(other.getFitness())); // sort from higher to lower return(other.getFitness().CompareTo(this.getFitness())); }