1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-08-04 06:30:27 +02:00

Better test

This commit is contained in:
Ehouarn
2025-08-02 18:35:53 +02:00
parent 573f2d8a22
commit d6f9a9c5b0
2 changed files with 24 additions and 7 deletions

View File

@@ -386,7 +386,7 @@ class WEISurvey2025(WEISurvey):
bus_info = self.get_algorithm_class().get_bus_information(bus)
# Score is the given score by the bus subtracted to the mid-score of the buses.
s = sum(bus_info.scores[getattr(self.information, 'word' + str(i))]
- self.word_mean(getattr(self.information, 'word' + str(i))) for i in range(1, 1 + NB_WORDS))
- self.word_mean(getattr(self.information, 'word' + str(i))) for i in range(1, 1 + NB_WORDS)) / self.get_algorithm_class().get_buses().count()
return s
@lru_cache()
@@ -399,7 +399,7 @@ class WEISurvey2025(WEISurvey):
Force the choice of bus to be in the 3 preferred buses according to the words
"""
values = list(self.scores_per_bus().items())
values.sort(key=lambda item: -item[1][1])
values.sort(key=lambda item: -item[1][0])
return values
@classmethod
@@ -514,7 +514,7 @@ class WEISurveyAlgorithm2025(WEISurveyAlgorithm):
if not survey2.information.valid or survey2.information.get_selected_bus() != bus:
continue
score2 = survey2.score_questions(bus)
if current_scores[0] <= score2: # Ignore better students
if current_scores[1] <= score2: # Ignore better students
continue
if least_preferred_survey is None or score2 < least_score:
least_preferred_survey = survey2