initial commit rules

This commit is contained in:
Anja Reusch 2020-06-21 14:09:59 +02:00
commit b36404eca1

30
rules.pl Normal file
View file

@ -0,0 +1,30 @@
schedule("BA1").
schedule("BA2").
group("G1", 5).
group("G2", 3).
group("G3", 2).
group("G4", 1).
rank("G1", "BA1", 2).
rank("G2", "BA1", 3).
rank("G3", "BA1", 1).
rank("G4", "BA1", 1).
rank("G1", "BA2", 3).
rank("G2", "BA2", 2).
rank("G3", "BA2", 4).
rank("G4", "BA2", 4).
1 = {matching(G,S) : schedule(S)} :- group(G, _).
count(Sum,S) :- Sum = #sum{ A,G : group(G,A), matching(G,S)}, schedule(S).
:- count(Sum, _), Sum > 6.
penalty(P) :- P = #sum{ R,G,S : rank(G,S,R), matching(G,S)}.
#minimize{ S : penalty(S)}.
#show matching/2.
#show count/2.
#show penalty/1.