Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import time
- import csv
- start = time.clock()
- def teamtonumber(teamname):
- if teamname == 'RP':
- number = 0
- elif teamname == 'Un':
- number = 1
- elif teamname == 'Br':
- number = 2
- elif teamname == 'Ya':
- number = 3
- elif teamname == 'Ck':
- number = 4
- elif teamname == 'SL':
- number = 5
- elif teamname == 'Cg':
- number = 6
- elif teamname == 'Cr':
- number = 7
- elif teamname == 'Ha':
- number = 8
- elif teamname == 'Da':
- number = 9
- elif teamname == 'Pr':
- number = 10
- elif teamname == 'Qu':
- number = 11
- elif teamname == 'Rensselaer':
- number = 0
- elif teamname == 'Union':
- number = 1
- elif teamname == 'Brown':
- number = 2
- elif teamname == 'Yale':
- number = 3
- elif teamname == 'Clarkson':
- number = 4
- elif teamname == 'St. Lawrence':
- number = 5
- elif teamname == 'Colgate':
- number = 6
- elif teamname == 'Cornell':
- number = 7
- elif teamname == 'Harvard':
- number = 8
- elif teamname == 'Dartmouth':
- number = 9
- elif teamname == 'Princeton':
- number = 10
- elif teamname == 'Quinnipiac':
- number = 11
- return number
- def game(krach_a, krach_b):
- win_a = krach_a / (krach_a + krach_b)
- sim = random.random()
- reg = random.random()
- if reg <= 0.1345:
- result = 3
- elif sim <= win_a:
- result = 1
- else:
- result = 2
- return result
- def playoffs(rank_a, rank_b):
- if rank_a < rank_b:
- if rank_a < 4:
- result = 0
- elif rank_a == 4:
- if rank_b == 11:
- result = 1
- else:
- result = 0
- elif rank_a == 5:
- if rank_b == 10:
- result = 1
- else:
- result = 0
- elif rank_a == 6:
- if rank_b == 9:
- result = 1
- else:
- result = 0
- elif rank_a == 7:
- if rank_b == 8:
- result = 1
- else:
- result = 0
- else:
- result = 0
- else:
- result = 0
- return result
- def threewaytie(one,two,three):
- if one > two:
- if one > three:
- if two > three: #case 1
- result = 1
- elif three > two: #case 2
- result = 2
- else: #case 10
- result = 10
- elif one < three: #case 5
- result = 5
- else: #case 8
- result = 8
- elif two > one:
- if two > three:
- if one > three: #case 3
- result = 3
- elif three > one: #case 4
- result = 4
- else: #case 11
- result = 11
- elif two < three: #case 6
- result = 6
- else: #case 9
- result = 9
- elif one == two:
- if one > three: #case 7
- result = 7
- elif three > one: #case 12
- result = 12
- else:
- result = 13
- return result
- teams = ['RP',
- 'Un',
- 'Br',
- 'Ya',
- 'Ck',
- 'SL',
- 'Cg',
- 'Cr',
- 'Ha',
- 'Da',
- 'Pr',
- 'Qu']
- f = open('filename.txt', 'r')
- brKRACH = float(f.readline())
- ckKRACH = float(f.readline())
- cgKRACH = float(f.readline())
- crKRACH = float(f.readline())
- daKRACH = float(f.readline())
- haKRACH = float(f.readline())
- prKRACH = float(f.readline())
- quKRACH = float(f.readline())
- rpKRACH = float(f.readline())
- slKRACH = float(f.readline())
- unKRACH = float(f.readline())
- yaKRACH = float(f.readline())
- ECAC_KRACH = [rpKRACH,
- unKRACH,
- brKRACH,
- yaKRACH,
- ckKRACH,
- slKRACH,
- cgKRACH,
- crKRACH,
- haKRACH,
- daKRACH,
- prKRACH,
- quKRACH]
- print(round(ECAC_KRACH[1],2),'\n',
- round(ECAC_KRACH[6],2),'\n',
- round(ECAC_KRACH[11],2),'\n',
- round(ECAC_KRACH[7],2),'\n',
- round(ECAC_KRACH[4],2),'\n',
- round(ECAC_KRACH[3],2),'\n',
- round(ECAC_KRACH[0],2),'\n',
- round(ECAC_KRACH[5],2),'\n',
- round(ECAC_KRACH[2],2),'\n',
- round(ECAC_KRACH[9],2),'\n',
- round(ECAC_KRACH[8],2),'\n',
- round(ECAC_KRACH[10],2),'\n')
- ranks = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]]
- left = 132
- with open('filename.csv', newline='') as results:
- game_result = csv.reader(results, delimiter=',')
- for row in game_result:
- if row[7] == 'ec':
- left = left - 1
- away = teamtonumber(row[1])
- home = teamtonumber(row[4])
- if row[5] > row[2]:
- winsi[home] = winsi[home] + 1
- h2hptsi[home][away] = h2hptsi[home][away] + 2
- points_listi[home][0] = points_listi[home][0] + 2
- gamesi[home][away] = gamesi[home][away] + 1
- elif row[2] > row[5]:
- winsi[away] = winsi[away] + 1
- h2hptsi[away][home] = h2hptsi[away][home] + 2
- points_listi[away][0] = points_listi[away][0] + 2
- gamesi[home][away] = gamesi[home][away] + 1
- elif row[2] == row[5]:
- if row[6] == 'ot':
- h2hptsi[home][away] = h2hptsi[home][away] + 1
- h2hptsi[away][home] = h2hptsi[away][home] + 1
- points_listi[home][0] = points_listi[home][0] + 1
- points_listi[away][0] = points_listi[away][0] + 1
- gamesi[home][away] = gamesi[home][away] + 1
- else:
- yep = 0
- else:
- yep = 0
- else:
- yep = 0
- print(left, 'games remaining.', '\n')
- #count = input('How many seasons?')
- count = 1000000
- just = len(str(count))
- for iteration in range(count):
- #initialize standings
- for row in range(12):
- points_list[row][0] = points_listi[row][0]
- points_list[row][1] = points_listi[row][1]
- wins[row] = winsi[row]
- for col in range(12):
- h2hpts[row][col] = h2hptsi[row][col]
- games[row][col] = gamesi[row][col]
- #play the games
- for team in range(12):
- for op in range(12):
- if games[team][op] == 0:
- res = game(ECAC_KRACH[team], ECAC_KRACH[op])
- if res == 1:
- points_list[team][0] = points_list[team][0] + 2
- h2hpts[team][op] = h2hpts[team][op] + 2
- wins[team] = wins[team] + 1
- elif res == 2:
- points_list[op][0] = points_list[op][0] + 2
- h2hpts[op][team] = h2hpts[op][team] + 2
- wins[op] + 1
- else:
- points_list[team][0] = points_list[team][0] + 1
- points_list[op][0] = points_list[op][0] + 1
- h2hpts[team][op] = h2hpts[team][op] + 1
- h2hpts[op][team] = h2hpts[op][team] + 1
- else:
- yep = 0
- for row in range(12):
- points_avg[row] = points_avg[row] + points_list[row][0]
- points_array[row][points_list[row][0]] += 1
- #SORT
- points_list.sort()
- points_list.reverse()
- rank_list = {}
- #TIE-BREAKING
- for two in range (2):
- for rank in range(11):
- tied = 0
- if points_list[rank][0] == points_list[rank + 1][0]:
- tied = 1
- if rank == 10:
- yep = 0
- elif points_list[rank][0] == points_list [rank + 2][0]:
- tied = 0
- team_1 = teamtonumber(points_list[rank][1])
- team_2 = teamtonumber(points_list[rank + 1][1])
- team_3 = teamtonumber(points_list[rank + 2][1])
- t1pts = h2hpts[team_1][team_2] + h2hpts[team_1][team_3]
- t2pts = h2hpts[team_2][team_1] + h2hpts[team_2][team_3]
- t3pts = h2hpts[team_3][team_1] + h2hpts[team_3][team_2]
- tie = threewaytie(t1pts,t2pts,t3pts)
- if tie == 13:
- tie = threewaytie(wins[team_1],wins[team_2],wins[team_3])
- else:
- yep = 0
- if tie == 1:
- points_list[rank][0] = points_list[rank][0] + 0.2
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.1
- elif tie == 2:
- points_list[rank][0] = points_list[rank][0] + 0.2
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.1
- elif tie == 3:
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.2
- points_list[rank][0] = points_list[rank][0] + 0.1
- elif tie == 4:
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.2
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.1
- elif tie == 5:
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.2
- points_list[rank][0] = points_list[rank][0] + 0.1
- elif tie == 6:
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.2
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.1
- elif tie == 7:
- points_list[rank][0] = points_list[rank][0] - 0.1
- elif tie == 8:
- points_list[rank + 1][0] = points_list[rank + 1][0] - 0.1
- elif tie == 9:
- points_list[rank + 2][0] = points_list[rank + 2][0] - 0.1
- elif tie == 10:
- points_list[rank][0] = points_list[rank][0] + 0.2
- elif tie == 11:
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.2
- elif tie == 12:
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.2
- else:
- points_list[rank][0] = points_list[rank][0] + 0.1*random.random()
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.1*random.random()
- points_list[rank + 2][0] = points_list[rank + 2][0] + 0.1*random.random()
- points_list.sort()
- points_list.reverse()
- else:
- yep = 0
- if tied == 1:
- tied = 0
- team_1 = teamtonumber(points_list[rank][1])
- team_2 = teamtonumber(points_list[rank + 1][1])
- if h2hpts[team_1][team_2] > h2hpts[team_2][team_1]:
- points_list[rank][0] = points_list[rank][0] + 0.1
- elif h2hpts[team_1][team_2] < h2hpts[team_2][team_1]:
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.1
- else:
- if wins[team_1] > wins[team_2]:
- points_list[rank][0] = points_list[rank][0] + 0.1
- elif wins[team_1] < wins[team_2]:
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.1
- else:
- points_list[rank][0] = points_list[rank][0] + 0.01*random.random()
- points_list[rank + 1][0] = points_list[rank + 1][0] + 0.01*random.random()
- points_list.sort()
- points_list.reverse()
- else:
- yep = 0
- for i in range(12):
- rank_list[points_list[i][1]] = i
- teamnumber = 0
- for team in teams:
- oppnumber = 0
- for opp in teams:
- po = playoffs(rank_list[team],rank_list[opp])
- if po == 1:
- playoff[teamnumber][oppnumber] = playoff[teamnumber][oppnumber] + po
- else:
- boop = 0
- oppnumber = oppnumber + 1
- teamnumber = teamnumber + 1
- rp_rank = rank_list['RP']
- ranks[0][rp_rank] = ranks[0][rp_rank] + 1
- un_rank = rank_list['Un']
- ranks[1][un_rank] = ranks[1][un_rank] + 1
- br_rank = rank_list['Br']
- ranks[2][br_rank] = ranks[2][br_rank] + 1
- ya_rank = rank_list['Ya']
- ranks[3][ya_rank] = ranks[3][ya_rank] + 1
- ck_rank = rank_list['Ck']
- ranks[4][ck_rank] = ranks[4][ck_rank] + 1
- sl_rank = rank_list['SL']
- ranks[5][sl_rank] = ranks[5][sl_rank] + 1
- cg_rank = rank_list['Cg']
- ranks[6][cg_rank] = ranks[6][cg_rank] + 1
- cr_rank = rank_list['Cr']
- ranks[7][cr_rank] = ranks[7][cr_rank] + 1
- ha_rank = rank_list['Ha']
- ranks[8][ha_rank] = ranks[8][ha_rank] + 1
- da_rank = rank_list['Da']
- ranks[9][da_rank] = ranks[9][da_rank] + 1
- pr_rank = rank_list['Pr']
- ranks[10][pr_rank] = ranks[10][pr_rank] + 1
- qu_rank = rank_list['Qu']
- ranks[11][qu_rank] = ranks[11][qu_rank] + 1
- if iteration%1000 == 0:
- print(iteration)
- rankpct = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
- [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]
- avgrank = [0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0]
- bye = [0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0]
- for row in range(12):
- for col in range(12):
- if ranks[row][col] != 0:
- rankpct[row][col] = round((ranks[row][col] * 100)/count,1)
- else:
- rankpct[row][col] = 0
- avgrank[row] = avgrank[row] + (ranks[row][col]*col)
- if playoff[row][col] != 0:
- playoff[row][col] = round((playoff[row][col] * 100)/count,1)
- else:
- playoff[row][col] = 0
- avgrank[row] = round(avgrank[row]/count + 1,2)
- points_avg[row] = round(points_avg[row]/count, 2)
- for row in range(12):
- for col in range(4):
- bye[row] = bye[row] + rankpct[row][col]
- for col in range(45):
- if points_array[row][col] != 0:
- points_array[row][col] = round((points_array[row][col] * 100)/count,1)
- else:
- points_array[row][col] = 0
- bye[row] = round(bye[row],1)
- end = time.clock()
- print(end-start, 's')
- print('Ranks')
- for row in range(12):
- print(teams[row],
- '|',
- str(round(ECAC_KRACH[row],1)).rjust(6),
- '|',
- str(ranks[row][0]).rjust(just),
- str(ranks[row][1]).rjust(just),
- str(ranks[row][2]).rjust(just),
- str(ranks[row][3]).rjust(just),
- str(ranks[row][4]).rjust(just),
- str(ranks[row][5]).rjust(just),
- str(ranks[row][6]).rjust(just),
- str(ranks[row][7]).rjust(just),
- str(ranks[row][8]).rjust(just),
- str(ranks[row][9]).rjust(just),
- str(ranks[row][10]).rjust(just),
- str(ranks[row][11]).rjust(just))
- print()
- print('Rank Percentages')
- for row in range(12):
- print(teams[row],
- '|',
- str(round(ECAC_KRACH[row],1)).rjust(6),
- '|',
- str(rankpct[row][0]).rjust(5),
- str(rankpct[row][1]).rjust(5),
- str(rankpct[row][2]).rjust(5),
- str(rankpct[row][3]).rjust(5),
- str(rankpct[row][4]).rjust(5),
- str(rankpct[row][5]).rjust(5),
- str(rankpct[row][6]).rjust(5),
- str(rankpct[row][7]).rjust(5),
- str(rankpct[row][8]).rjust(5),
- str(rankpct[row][9]).rjust(5),
- str(rankpct[row][10]).rjust(5),
- str(rankpct[row][11]).rjust(5),
- '|',
- str(avgrank[row]).rjust(5),
- '|',
- str(points_avg[row]).rjust(5))
- print()
- just -= 1
- print('Points')
- for row in range(12):
- print(teams[row],
- '|',
- str(round(ECAC_KRACH[row],1)).rjust(6),
- '|',
- # str(points_array[row][0]).rjust(5),
- # str(points_array[row][1]).rjust(5),
- # str(points_array[row][2]).rjust(5),
- str(points_array[row][3]).rjust(5),
- str(points_array[row][4]).rjust(5),
- str(points_array[row][5]).rjust(5),
- str(points_array[row][6]).rjust(5),
- str(points_array[row][7]).rjust(5),
- str(points_array[row][8]).rjust(5),
- str(points_array[row][9]).rjust(5),
- str(points_array[row][10]).rjust(5),
- str(points_array[row][11]).rjust(5),
- str(points_array[row][12]).rjust(5),
- str(points_array[row][13]).rjust(5),
- str(points_array[row][14]).rjust(5),
- str(points_array[row][15]).rjust(5),
- str(points_array[row][16]).rjust(5),
- str(points_array[row][17]).rjust(5),
- str(points_array[row][18]).rjust(5),
- str(points_array[row][19]).rjust(5),
- str(points_array[row][20]).rjust(5),
- str(points_array[row][21]).rjust(5),
- str(points_array[row][22]).rjust(5),
- str(points_array[row][23]).rjust(5),
- str(points_array[row][24]).rjust(5),
- str(points_array[row][25]).rjust(5),
- str(points_array[row][26]).rjust(5),
- str(points_array[row][27]).rjust(5),
- str(points_array[row][28]).rjust(5),
- str(points_array[row][29]).rjust(5),
- str(points_array[row][30]).rjust(5),
- str(points_array[row][31]).rjust(5),
- str(points_array[row][32]).rjust(5),
- str(points_array[row][33]).rjust(5),
- str(points_array[row][34]).rjust(5),
- str(points_array[row][35]).rjust(5),
- str(points_array[row][36]).rjust(5),
- str(points_array[row][37]).rjust(5),
- str(points_array[row][38]).rjust(5),
- str(points_array[row][39]).rjust(5),
- # str(points_array[row][40]).rjust(5),
- # str(points_array[row][41]).rjust(5),
- # str(points_array[row][42]).rjust(5),
- # str(points_array[row][43]).rjust(5),
- # str(points_array[row][44]).rjust(5),
- '|',
- str(points_avg[row]).rjust(5))
- print()
- print('Playoffs')
- print(' | RP Un Br Ya Ck SL Cg Cr Ha Da Pr Qu | BYE')
- for row in range(12):
- print(teams[row],
- '|',
- str(playoff[row][0]).rjust(5),
- str(playoff[row][1]).rjust(5),
- str(playoff[row][2]).rjust(5),
- str(playoff[row][3]).rjust(5),
- str(playoff[row][4]).rjust(5),
- str(playoff[row][5]).rjust(5),
- str(playoff[row][6]).rjust(5),
- str(playoff[row][7]).rjust(5),
- str(playoff[row][8]).rjust(5),
- str(playoff[row][9]).rjust(5),
- str(playoff[row][10]).rjust(5),
- str(playoff[row][11]).rjust(5),
- '|',
- str(bye[row]).rjust(5))
Advertisement
Add Comment
Please, Sign In to add comment