Last active
November 8, 2019 23:54
-
-
Save akeaswaran/e04c493759ef6adf5d00227c4027f194 to your computer and use it in GitHub Desktop.
Revisions
-
akeaswaran revised this gist
Nov 16, 2017 . 1 changed file with 16 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,19 @@ -(void)updateStrengthOfWins { int strWins = 0; for ( int i = 0; i < gameSchedule.count; ++i ) { Game *g = gameSchedule[i]; if (g.homeTeam == self) { strWins += pow(60 - g.awayTeam.rankTeamPollScore,2); } else { strWins += pow(60 - g.homeTeam.rankTeamPollScore,2); } } teamStrengthOfWins = strWins/50; for (Team *t in gameWinsAgainst) { teamStrengthOfWins += pow(t.wins,2); } } -(void)updatePollScore { [self updateStrengthOfWins]; int preseasonBias = 8 - (wins + losses); -
akeaswaran created this gist
Nov 16, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ -(void)updatePollScore { [self updateStrengthOfWins]; int preseasonBias = 8 - (wins + losses); if (preseasonBias < 0) preseasonBias = 0; teamPollScore = (wins*200 + 3*(teamPoints-teamOppPoints) + (teamYards-teamOppYards)/40 + (teamStrengthOfWins / 2) + 3*(preseasonBias)*(teamPrestige + [self getOffensiveTalent] + [self getDefensiveTalent]) + teamStrengthOfWins)/11 + (teamPrestige / 5); if ([@"CC" isEqualToString:confChampion] ) { //bonus for winning conference teamPollScore += 25; } if ( [@"NCW" isEqualToString:natlChampWL] ) { //bonus for winning champ game teamPollScore += 100; } if ( [@"NCL" isEqualToString:natlChampWL] ) { //bonus for winning champ game teamPollScore += 15; } if (losses == 0) { teamPollScore += 30; } else if (losses == 1 ) { teamPollScore += 15; } else { teamPollScore += 0; } if (teamPollScore < 0) { teamPollScore = 0; } }