equal_dict method
Retourne une carte des étudiants ayant un classement égal pour les mêmes écoles.
Implementation
Map<int, List<Student>> equal_dict(List<Student> allStudent) {
Map<int, List<Student>> equal_dict = {};
for(var entry in choices.entries) {
int key = entry.key;
Choice c = entry.value;
equal_dict[key] = [];
for(Student other in allStudent) {
if(other.id == id) continue;
for(var otherChoice in other.choices.values) {
if (otherChoice.school.id == c.school.id && (otherChoice.interranking - c.interranking).abs() < 1e-6) {
equal_dict.putIfAbsent(key, () => []);
equal_dict[key]!.add(other);
}
}
}
}
return equal_dict;
}