Example #1
0
 private static int userTrComparator(User u1, User u2)
 {
     CredibilityInfo info1 = u1.GetCredibilityInfo("Movies");
     CredibilityInfo info2 = u2.GetCredibilityInfo("Movies");
     if (info1.Trustworthiness < info2.Trustworthiness)
         return 1;
     else if (info1.Trustworthiness > info2.Trustworthiness)
         return -1;
     else
     {
         if (info1.TrusteeCount > info2.TrusteeCount)
             return -1;
         else if (info1.TrusteeCount < info2.TrusteeCount)
             return 1;
         else
             return 0;
     }
 }
Example #2
0
 private static int userExpComparator(User u1, User u2)
 {
     CredibilityInfo info1 = u1.GetCredibilityInfo("Movies");
     CredibilityInfo info2 = u2.GetCredibilityInfo("Movies");
     if (info1.Expertise < info2.Expertise)
         return 1;
     else if (info1.Expertise > info2.Expertise)
         return -1;
     else
     {
         if (info1.RatingCount > info2.RatingCount)
             return -1;
         else if (info1.RatingCount < info2.RatingCount)
             return 1;
         else
             return 0;
     }
 }