This is the main problem. Here's the distribution of Ice-types in tiers:
Uber: Arceus-Ice, Kyurem-W
OU: Kyurem-B
UUBL: Ninetales-Alola, Weavile
UU: Mamoswine
RUBL: Kyurem
RU: Cloyster
NUBL: Vanilluxe
NU: (megas or NFEs, which aren't in the team generation algorithm; Cryogonal dropped recently)
PUBL: None
PU: [a bunch]
(PU): [a bunch]
Ice-types are heavily concentrated in PU and (PU) tiers. Here's the code (lines 1766-1771, plus 1833) that limits a team to only so many Pokemon per tier:
JavaScript:
//Limit two Pokemon per tier
if (!tierCount[tier]) {
tierCount[tier] = 1;
} else if (tierCount[tier] > 1) {
continue;
}
It claims to limit to two Pokemon per tier, but actually limits to 1 since the appropriate entry in tierCount becomes 2 after a Pokemon gets accepted. Not sure if the comment or the code is wrong; if it's the code, just initialize the entry in tierCount to 0 instead of 1 to fix it:
JavaScript:
//Limit two Pokemon per tier
if (!tierCount[tier]) {
tierCount[tier] = 0;
} else if (tierCount[tier] > 1) {
continue;
}