mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-11-04 01:12:08 +01:00 
			
		
		
		
	Better test
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user