Skip to content

Commit

Permalink
Student Scheduling: Day of week offset
Browse files Browse the repository at this point in the history
- added ability to set the day of week offset on an online section
- this is to make sure that the isEnabled(Student) checking computes the first/last meeting correctly during wait-list processing
  • Loading branch information
tomas-muller committed May 11, 2022
1 parent aeca70e commit 7f0b3c4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/org/cpsolver/studentsct/online/OnlineSection.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
public class OnlineSection extends Section {
private int iEnrollment = 0;
private boolean iAlwaysEnabled = false;
private Integer iDayOfWeekOffset = null;

public OnlineSection(long id, int limit, String name, Subpart subpart, Placement placement, List<Instructor> instructors, Section parent) {
super(id, limit, name, subpart, placement, instructors, parent);
Expand Down Expand Up @@ -71,4 +72,13 @@ public boolean isEnabled(Student student) {
return super.isEnabled(student);
}

@Override
protected int getDayOfWeekOffset() {
if (iDayOfWeekOffset != null) return iDayOfWeekOffset;
return super.getDayOfWeekOffset();
}
public void setDayOfWeekOffset(Integer dayOfWeekOffset) {
iDayOfWeekOffset = dayOfWeekOffset;
}

}

0 comments on commit 7f0b3c4

Please sign in to comment.