Skip to content

Commit

Permalink
Course Timetabling: Spread Constraint
Browse files Browse the repository at this point in the history
- fixed an ArrayIndexOutOfBoundsException thrown when there are 7 working days
  (all days of the week are working days)
  • Loading branch information
tomas-muller committed Jun 18, 2022
1 parent 5624d90 commit b1bda9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/cpsolver/coursett/constraint/SpreadConstraint.java
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ public class SpreadConstraintContext implements AssignmentConstraintContext<Lect

@SuppressWarnings("unchecked")
public SpreadConstraintContext(Assignment<Lecture, Placement> assignment) {
iCourses = new Set[iLastDaySlot - iFirstDaySlot + 1][(iLastWorkDay - iFirstWorkDay + 1) % 7];
iCourses = new Set[iLastDaySlot - iFirstDaySlot + 1][(iLastWorkDay - iFirstWorkDay) % 7 + 1];
if (iInteractive)
iUnassignmentsToWeaken = 0;
for (int i = 0; i < iCourses.length; i++) {
Expand Down

0 comments on commit b1bda9d

Please sign in to comment.