third_groups = ranked;
} else {
for (let i = 0; i < groups_to_calc.length; ++i) {
- if (third_groups[i].group_idx !== ranked[i].group_idx) {
+ if (third_groups[i].group_idx !== ranked[i].group_idx || // Different from a previous simulation.
+ (i < (third_groups.length - 1) && ranked[i].rank === ranked[i + 1].rank) || // Disallow ties.
+ (i > 0 && ranked[i].rank === ranked[i - 1].rank)) { // Disallow ties.
third_groups[i].group_idx = null;
}
}
return str;
}
-function fill_playoff(all_teams, groups, replacements, teams) {
+function fill_playoff(all_teams, groups, replacements) {
let team_expansions = {};
for (const team of all_teams) {
team_expansions[team.name] = team_expansions[team.mediumname] = team_expansions[team.shortname] =
get_all_group_games(all_teams, groups, function(group_games) {
// NOTE: filter_teams_by_group will be delayed by one cycle
// after W P1 etc. becomes determined for the first time.
+ // Note that this requires the Groups sheet to pick out
+ // the right teams from the group matches in the Results sheet!
let teams_l1 = filter_teams_by_group(all_teams, groups, 'Playoffs 9th–11th');
let teams_l2 = filter_teams_by_group(all_teams, groups, 'Playoffs 12th–14th');
publish_group_rank(teams_l1, group_games, 'Playoffs 9th–11th');
publish_group_rank(teams_c, games, 'Group C');
let replacements = montecarlo(teams, groups, games, ['Group A', 'Group B', 'Group C']);
- fill_playoff(teams, groups, replacements, [teams_a, teams_b, teams_c]);
+ fill_playoff(teams, groups, replacements);
});
});
});
function get_all_playoff_games(teams, groups, group_games, cb) {
let replacements = montecarlo(teams, groups, group_games, ['Group A', 'Group B', 'Group C']);
+ fill_playoff(teams, groups, replacements); // To get the replacements.
let games = ultimateconfig['playoff_games'];
get_results('Results', function(response) {
let playoff_games = [];