Ejemplo n.º 1
0
            int IComparer.Compare(object a, object b)
            {
                FitnessObject f1 = (FitnessObject)a;
                FitnessObject f2 = (FitnessObject)b;

                if (f1.fitness > f2.fitness)
                {
                    return(1);
                }
                else if (f1.fitness < f2.fitness)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            }
Ejemplo n.º 2
0
        int IComparable.CompareTo(object obj)
        {
            FitnessObject f = (FitnessObject)obj;

            return(string.Compare(this.fitness.ToString(), f.fitness.ToString()));
        }