Skip to content

Commit

Permalink
Ensure couplings are constrained to the same day
Browse files Browse the repository at this point in the history
A coupling shouldn't be satisfied if the coupling
crosses a day boundary. Adds a constraint that the
slots for the coupling have the same quotient.
Fixes #4.
  • Loading branch information
doublec committed Jul 11, 2024
1 parent bd4572f commit ad67f87
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion simsttab.pl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@
slots_couplings(Slots, F-S) :-
nth0(F, Slots, S1),
nth0(S, Slots, S2),
S2 #= S1 + 1.
S2 #= S1 + 1,
slot_quotient(S1, Q),
slot_quotient(S2, Q).

constrain_subject(req(Class,Subj,_Teacher,_Num)-Slots) :-
strictly_ascending(Slots), % break symmetry
Expand Down

0 comments on commit ad67f87

Please sign in to comment.