-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
awards.mzn
35 lines (29 loc) · 1.28 KB
/
awards.mzn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
% AWARDS
% This file deals with the awards, which gives 2 points
% cumulative score benefit to the artist starting from the round
% the award was played in
% There are 5 awards - one per artist
% The awards can be given to any artist
% The net result of this code should be to increase awards_per_round_per_artist[r,a]
% by 2 for every award that a gets in round r.
include "globals.mzn";
% This is what we export
array[Rounds,Artists] of var {0,2,4,6,8,10}: award_bonus_per_round_per_artist;
% Covered better in Symbols
% TODO: Remove after consideration?
% awards can only be given if an artist's card was played that turn
constraint forall(r in Rounds, a in Artists) (
AwardPlayedInRound[a] = r /\ AwardGiven[a] -> CardsForArtist[r,a] > 0
);
% Which ROUND was this award played in
array[Artists] of var Rounds: AwardPlayedInRound;
array[Artists] of var Artists: AwardedArtist;
% The above 2 should be good, but we need to account for the cases
% where the award was not given at all.
array[Artists] of var bool: AwardGiven;
constraint forall(r in Rounds, a in Artists) (
award_bonus_per_round_per_artist[r,a] =
2 *
% Gives us a list of true/false
sum(aa in Artists) (if AwardPlayedInRound[aa] = r /\ AwardGiven[aa] /\ AwardedArtist[aa] = a then true else false endif)
);