stundenplan-asp/rules.pl
2020-08-12 13:22:20 +02:00

16 lines
405 B
Prolog

1 = {matching(G,S) : schedule(S)} :- group(G, _).
count(Sum,S) :- Sum = #sum{ A : group(G,A), matching(G,S)}, schedule(S).
:- count(Sum, _), Sum > {max}.
%penalty(P) :- P = #sum{ R : rank(G,S,R), matching(G,S)}.
penalty(G,S,R) :- matching(G,S), rank(G,S,R).
sum_pen(S) :- S = #sum{ R : penalty(_,_,R)}.
#minimize{ S : sum_pen(S)}.
#show matching/2.
#show count/2.
%#show penalty/3.
%#show sum_pen/1.