예제 #1
0
        private double GamesAddictScore(HandSetFeatures phone)
        {
            double ramScore, resolutionScore, batteryLifeScore, screenSizeScore;
            double min, max;

            /**** RAM (Most important) **/

            basket.GetMaxAndMinLimits(x => x.RamSize, out min, out max);
            ramScore = LogisticFunc(phone.RamSize, max - min);



            /*** Resolution (Second most important)  ****/

            basket.GetMaxAndMinLimits(x => Miscellany.Product(x.DisplayResolution), out min, out max);
            resolutionScore = LogisticFunc(Miscellany.Product(phone.DisplayResolution), max - min);


            /***** Battery Life (third most important)  ********/

            basket.GetMaxAndMinLimits(x => x.BatteryLife, out min, out max);
            batteryLifeScore = LogisticFunc(phone.BatteryLife, max - min);



            /**********  Screen Size  (The least important)  *************/

            basket.GetMaxAndMinLimits(x => x.ScreenSize, out min, out max);
            screenSizeScore = LogisticFunc(phone.ScreenSize, max - min);

            return((4 * ramScore + 3 * resolutionScore + 2 * batteryLifeScore + screenSizeScore) / 10);
        }
예제 #2
0
        private double SameSizeScore(HandSetFeatures phone)
        {
            HandSetFeatures currentPhoneFeatures = basket.GetModelFeatures(CurrentPhone);
            double          currentPhoneSize, candidatePhoneSize, m, b; // m = declive

            currentPhoneSize   = Miscellany.Product(currentPhoneFeatures.BodySize);
            candidatePhoneSize = Miscellany.Product(phone.BodySize);
            if ((candidatePhoneSize >= (currentPhoneSize * 0.95)) && (candidatePhoneSize <= (currentPhoneSize * 1.05)))
            {
                return(1);
            }
            if ((candidatePhoneSize <= (currentPhoneSize * 0.8)) || (candidatePhoneSize >= (currentPhoneSize * 1.2)))
            {
                return(0);
            }
            if (candidatePhoneSize < currentPhoneSize)
            {
                m = 1 / (0.15 * currentPhoneSize);
                b = -16 / 3;
                return(candidatePhoneSize * m + b);
            }
            else
            {
                m = -1 / (0.15 * currentPhoneSize);
                b = 8;
            }
            return(candidatePhoneSize * m + b);
        }