Exemplo n.º 1
0
 //! From <ComputationData>
 public override int comapareTo(ComputationData other, Func <ComputationData, int> criteria)
 {
     if (other.Tag == Tag)            // TAGNEIGHBORHOOD
     {
         int ranking_this  = Size;
         int ranking_other = ((Neighborhood)other).Size;
         int difference    = ranking_this - ranking_other;
         return((difference == 0) ? 0 : difference / Math.Abs(difference));
     }
     else
     {
         throw new Exception("(POSL Exception) Not compearing allowed (Neighborhood::comapareTo)");
     }
 }
Exemplo n.º 2
0
        //std::shared_ptr<FactoryPacker> DecisionPair::BuildPacker(){ return std::make_shared<FactoryDecisionPairPacker>(shared_from_this()); }

        //! From <ComputationData>
        public override int comapareTo(ComputationData other, Func <ComputationData, int> criteria)
        {
            if (other.Tag == this.Tag)
            {
                int ranking_this  = criteria(found);
                int ranking_other = criteria(((DecisionPair)other).GetFound);
                int difference    = ranking_this - ranking_other;
                return((difference == 0) ? 0 : difference / Math.Abs(difference));
            }
            else
            {
                throw new Exception("(POSL Exception) Not compearing allowed (DecisionPair::comapareTo)");
            }
        }
Exemplo n.º 3
0
        //shared_ptr<FactoryPacker> Solution::BuildPacker(){ return make_shared<FactorySolutionPacker>(shared_from_this()); }

        //! From <ComputationData>
        public override int comapareTo(ComputationData other, Func <ComputationData, int> criteria)
        {
            if (other.Tag == Tag)            // TAGSOLUTION
            {
                int ranking_this  = criteria(this);
                int ranking_other = criteria((Solution)other);
                int difference    = ranking_this - ranking_other;
                return((difference == 0) ? 0 : difference / Math.Abs(difference));
            }
            else
            {
                throw new Exception("(POSL Exception) Not compearing allowed (Solution::comapareTo)");
            }
        }
Exemplo n.º 4
0
        //! Compare this object with other, given a function (criteria)

        /*!
         * \param other The ComputationData to compare with.
         * \param criteria A function (criteria).
         * \return -1 if THIS is lower, 1 if THIS is bigger, 0 if equals
         */
        public abstract int comapareTo(ComputationData other, Func <ComputationData, int> criteria);