stundenplan-asp/rules.pl

16 lines
405 B
Perl
Raw Permalink Normal View History

2020-06-21 14:09:59 +02:00
1 = {matching(G,S) : schedule(S)} :- group(G, _).
2020-08-12 13:22:20 +02:00
count(Sum,S) :- Sum = #sum{ A : group(G,A), matching(G,S)}, schedule(S).
:- count(Sum, _), Sum > {max}.
2020-06-21 14:09:59 +02:00
2020-08-12 13:22:20 +02:00
%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)}.
2020-06-21 14:09:59 +02:00
2020-08-12 13:22:20 +02:00
#minimize{ S : sum_pen(S)}.
2020-06-21 14:09:59 +02:00
#show matching/2.
#show count/2.
2020-08-12 13:22:20 +02:00
%#show penalty/3.
%#show sum_pen/1.