コード例 #1
0
 //DONE
 public List <IUser> PreliminaryFiltering(ITweet[] forFilter)
 {
     for (int i = 0; i < forFilter.Length; i++)
     {
         var followersCount = forFilter[i].CreatedBy.FollowersCount;
         var friendsCount   = forFilter[i].CreatedBy.FriendsCount;
         var followerRank   = (double)followersCount / (double)(followersCount + friendsCount);
         if (followersCount > ProFeedApiParameters.ProFeedAlgParameters.MinFolowers && followersCount < ProFeedApiParameters.ProFeedAlgParameters.MaxFolowers && followerRank > ProFeedApiParameters.ProFeedAlgParameters.MinRankFirstStep)
         {
             if (!Influencers.Contains(forFilter[i].CreatedBy))
             {
                 Influencers.Add(forFilter[i].CreatedBy);
                 InfluencersDagree.Add(1);
             }
             else
             {
                 var index = Influencers.IndexOf(forFilter[i].CreatedBy);
                 InfluencersDagree[index]++;
             }
             Console.WriteLine(Influencers);
         }
     }
     AlgoLevel++;
     PotentialInfluencersFriend();
     return(Influencers);
 }
コード例 #2
0
 public List <IUser> PreliminaryFiltering(IUser[] forFilter)
 {
     for (int i = 0; i < forFilter.Length; i++)
     {
         var followersCount = forFilter[i].FollowersCount;
         var friendsCount   = forFilter[i].FriendsCount;
         var followerRank   = (double)followersCount / (double)(followersCount + friendsCount);
         if (followersCount > ProFeedApiParameters.ProFeedAlgParameters.MinFolowers && followersCount < ProFeedApiParameters.ProFeedAlgParameters.MaxFolowers && followerRank > ProFeedApiParameters.ProFeedAlgParameters.MinRankScondStep)
         {
             if (!Influencers.Contains(forFilter[i]))
             {
                 Influencers.Add(forFilter[i]);
                 InfluencersDagree.Add(1);
             }
             else
             {
                 var index = Influencers.IndexOf(forFilter[i]);
                 InfluencersDagree[index]++;
             }
         }
     }
     AlgoLevel++;
     return(Influencers);
 }