Spaces:
Running
on
Zero
Running
on
Zero
update upload
Browse files- model/matchmaker.py +4 -3
model/matchmaker.py
CHANGED
@@ -79,7 +79,7 @@ def load_json_via_sftp():
|
|
79 |
class RunningPivot(object):
|
80 |
running_pivot = []
|
81 |
|
82 |
-
not_run = [16, 18, 19, 22]
|
83 |
|
84 |
def matchmaker(num_players, k_group=4):
|
85 |
trueskill_env = TrueSkill()
|
@@ -91,12 +91,13 @@ def matchmaker(num_players, k_group=4):
|
|
91 |
|
92 |
# Randomly select a player
|
93 |
# selected_player = np.random.randint(0, num_players)
|
94 |
-
comparison_counts[
|
95 |
-
comparison_counts[
|
96 |
selected_player = np.argmin(comparison_counts.sum(axis=1))
|
97 |
|
98 |
RunningPivot.running_pivot.append(selected_player)
|
99 |
RunningPivot.running_pivot = RunningPivot.running_pivot[-5:]
|
|
|
100 |
|
101 |
selected_trueskill_score = trueskill_env.expose(ratings[selected_player])
|
102 |
trueskill_scores = np.array([trueskill_env.expose(p) for p in ratings])
|
|
|
79 |
class RunningPivot(object):
|
80 |
running_pivot = []
|
81 |
|
82 |
+
not_run = [16, 18, 19, 20,21,22]
|
83 |
|
84 |
def matchmaker(num_players, k_group=4):
|
85 |
trueskill_env = TrueSkill()
|
|
|
91 |
|
92 |
# Randomly select a player
|
93 |
# selected_player = np.random.randint(0, num_players)
|
94 |
+
comparison_counts[RunningPivot.running_pivot, :] = float('inf')
|
95 |
+
comparison_counts[not_run, :] = float('inf')
|
96 |
selected_player = np.argmin(comparison_counts.sum(axis=1))
|
97 |
|
98 |
RunningPivot.running_pivot.append(selected_player)
|
99 |
RunningPivot.running_pivot = RunningPivot.running_pivot[-5:]
|
100 |
+
print(RunningPivot.running_pivot)
|
101 |
|
102 |
selected_trueskill_score = trueskill_env.expose(ratings[selected_player])
|
103 |
trueskill_scores = np.array([trueskill_env.expose(p) for p in ratings])
|