UEFA NL
This commit is contained in:
parent
9a1727d2c0
commit
ce9f82569d
@ -59,6 +59,7 @@ import random
|
||||
import time
|
||||
import json
|
||||
import csv
|
||||
import numpy as np
|
||||
import networkx as nx
|
||||
import matplotlib.pyplot as plt
|
||||
from datetime import timedelta
|
||||
@ -147,6 +148,8 @@ for key, val in teams_in_group_together.items():
|
||||
maxVal = val
|
||||
|
||||
|
||||
mean = np.mean([val for val in teams_in_group_together.values() if val > 0])
|
||||
|
||||
|
||||
# %%
|
||||
|
||||
@ -201,7 +204,7 @@ for sg in supergroups:
|
||||
sol += "<table id='ftable' style='border:5px solid black;background-color:whitesmoke'>\n"
|
||||
sol += "<thead>\n"
|
||||
sol += "<tr>"
|
||||
sol += f"<th>{nSimulations}</th>"
|
||||
sol += f"<th>n={nSimulations}</th>"
|
||||
sol += "<th colspan=2 style='border-right: 5px solid black;'>Pot A</th>"
|
||||
sol += "<th colspan=4 style='border-right: 5px solid black;'>Pot B</th>"
|
||||
sol += "</tr>"
|
||||
@ -209,7 +212,7 @@ for sg in supergroups:
|
||||
sol += "<table id='etable' style='border:5px solid black;background-color:whitesmoke'>\n"
|
||||
sol += "<thead>\n"
|
||||
sol += "<tr>"
|
||||
sol += f"<th>{nSimulations}</th>"
|
||||
sol += f"<th>n={nSimulations}</th>"
|
||||
sol += "<th colspan=4 style='border-right: 5px solid black;'>Pot A</th>"
|
||||
sol += "<th colspan=4 style='border-right: 5px solid black;'>Pot B</th>"
|
||||
sol += "<th colspan=4 style='border-right: 5px solid black;'>Pot C</th>"
|
||||
@ -226,7 +229,7 @@ for sg in supergroups:
|
||||
sol += "<tr>\n"
|
||||
sol += f"<td>{t1.shortname} - {t.pot}</td>"
|
||||
for t2 in sg.teams.order_by('pot'):
|
||||
color = heatmap_color_for((abs(teams_in_group_together[(t1,t2)]-(maxVal+minVal)/2))/((maxVal-minVal)/2 or 1))
|
||||
color = heatmap_color_for((abs(teams_in_group_together[(t1,t2)]-mean))/((maxVal-minVal)/2 or 1))
|
||||
opacity = "1"
|
||||
if teams_in_group_together[(t1,t2)] == 0:
|
||||
color = 'lightgrey'
|
||||
@ -255,17 +258,17 @@ sol += "</thead>\n"
|
||||
sol += "<tbody>\n"
|
||||
sol += "<tr>\n"
|
||||
for val in violated_blockings.values():
|
||||
sol += f"<td colspan='2'>{val['violations']} ({percentage(val['violations'])})</td>"
|
||||
sol += f"<td colspan='2'>{percentage(val['violations'])}</td>"
|
||||
sol += "</tr>\n"
|
||||
sol += "<tr>\n"
|
||||
for val in violated_blockings.values():
|
||||
sol += f"<td>"
|
||||
for c,n in val['comments'].items():
|
||||
sol += f"{c}<br>"
|
||||
sol += f"{percentage(n)}<br>"
|
||||
sol += f"</td>"
|
||||
sol += f"<td>"
|
||||
for c,n in val['comments'].items():
|
||||
sol += f"{n} ({percentage(n)})<br>"
|
||||
sol += f"{c}<br>"
|
||||
sol += f"</td>"
|
||||
sol += "</tr>\n"
|
||||
sol += "</tbody>\n"
|
||||
@ -290,13 +293,13 @@ sol += "<tbody>\n"
|
||||
sol += "<tr>\n"
|
||||
for key in elementary_violations.keys():
|
||||
val = violated_wishes[key]
|
||||
sol += f"<td >{val['violations']} ({percentage(val['violations'])})</td>"
|
||||
sol += f"<td >{percentage(val['violations'])}</td>"
|
||||
sol += "</tr>\n"
|
||||
sol += "<tr>\n"
|
||||
for key,val in elementary_violations.items():
|
||||
sol += f"<td>"
|
||||
sol += f"<td style='text-align:left;vertical-align:top'>"
|
||||
for c,n in elementary_violations[key].items():
|
||||
sol += f"{c} - {n} ({percentage(n)})<br>"
|
||||
sol += f"({percentage(n)}) {c} <br>"
|
||||
sol += f"</td>"
|
||||
sol += "</tr>\n"
|
||||
sol += "</tbody>\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user