Skip to content

Commit

Permalink
Student Scheduling: Branch & Bound
Browse files Browse the repository at this point in the history
- when a neigbour (class schedule of a student) fails to be assigned, e.g., because the last spot in a class got taken:
  - put the student back at the beginning of the queue (instead of the end)
- this is to ensure that student priority is beter considered (priority student does not get bumped at the end of the list)
  • Loading branch information
tomas-muller committed Nov 13, 2020
1 parent 5d0b726 commit 4b8c09d
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;

import org.apache.log4j.Logger;
Expand Down Expand Up @@ -105,7 +104,7 @@ public class BranchBoundSelection implements NeighbourSelection<Request, Enrollm
protected StudentQuality iStudentQuality = null;
protected StudentSectioningModel iModel = null;
public static boolean sDebug = false;
protected Queue<Student> iStudents = null;
protected LinkedList<Student> iStudents = null;
protected boolean iMinimizePenalty = false;
protected StudentOrder iOrder = new StudentGroupsChoiceRealFirstOrder();
protected double iDistConfWeight = 1.0;
Expand Down Expand Up @@ -180,7 +179,7 @@ protected synchronized Student nextStudent() {
}

public synchronized void addStudent(Student student) {
if (iStudents != null && !student.isDummy()) iStudents.add(student);
if (iStudents != null && !student.isDummy()) iStudents.addFirst(student);
}

/**
Expand Down

0 comments on commit 4b8c09d

Please sign in to comment.