calculateTotalAvailability should be done before sorting the list NOT after

This commit is contained in:
Tom Vahlman 2012-02-28 15:32:21 +01:00
parent 7f134b25a1
commit 95308fc113
2 changed files with 2 additions and 2 deletions
src
main/java/se/su/dsv/scipro/match
test/java/se/su/dsv/scipro/match

@ -39,8 +39,8 @@ public class GreedyMatchingAlgorithm implements MatchingAlgorithm {
matchProjectIdeas(unmatchedProjectIdeas, supervisorAvailability, pairList);
if(!pairList.isEmpty()) {
Collections.sort(pairList);
calculateTotalAvailability(pairList);
Collections.sort(pairList);
Pair foundPair = pairList.get(0);
for(Availability availability : supervisorAvailability) {
if(availability.getSupervisor().equals(foundPair.getMatch().getSupervisor()) &&

@ -636,7 +636,7 @@ public class TestGreedyMatchingAlgorithm {
@Test
@Transactional
@Rollback
/* three supervisors which are matched against three project ideas */
/* three supervisors are matched against three project ideas */
public void testIncreaseSlotForMasterSupervisor_v3() {
List<ProjectIdea> projectIdeaList = new ArrayList<ProjectIdea>();
List<Employee> supervisorList = new ArrayList<Employee>();