From c7023218d3c43093371ec01ed6a7aaf93cbcbd4c Mon Sep 17 00:00:00 2001 From: Markus Triska Date: Tue, 3 Sep 2019 20:36:11 +0200 Subject: [PATCH] ENHANCED: Support multiple free days for teachers, closing #2. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported by Thure Dührsen. Many thanks! --- simsttab.pl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/simsttab.pl b/simsttab.pl index 21005d8..89ab483 100644 --- a/simsttab.pl +++ b/simsttab.pl @@ -152,12 +152,9 @@ include(teacher_req(Teacher), Rs, Sub), pairs_slots(Sub, Vs), all_different(Vs), - ( teacher_freeday(Teacher,F) -> - maplist(slot_quotient, Vs, Qs), - all_diff_from(Qs, F) - ; true - ). - + findall(F, teacher_freeday(Teacher, F), Fs), + maplist(slot_quotient, Vs, Qs), + maplist(all_diff_from(Qs), Fs). sameroom_var(Reqs, r(Class,Subject,Lesson), Var) :- memberchk(req(Class,Subject,_Teacher,_Num)-Slots, Reqs),