Adds lots of features
This commit is contained in:
parent
16f7402436
commit
8cc6f0d745
|
@ -1,5 +1,6 @@
|
|||
include "alldifferent.mzn";
|
||||
include "globals.mzn";
|
||||
include "modernart-sanity.mzn";
|
||||
|
||||
% Constraints per artist
|
||||
% TODO: This is also TOTAL card limit, not visible
|
||||
|
@ -15,24 +16,11 @@ constraint sum(p in Players, r in Rounds) (visible_count_per_round_per_artist_pe
|
|||
constraint sum(p in Players, r in Rounds) (visible_count_per_round_per_artist_per_player[r,p,KarlGitter])>=0;
|
||||
constraint sum(p in Players, r in Rounds) (visible_count_per_round_per_artist_per_player[r,p,Krypto])>=0;
|
||||
|
||||
% Score sanity per round
|
||||
constraint forall (a in Artists, r in Rounds) (
|
||||
ranking_score_per_artist_per_round[r,a] >=0
|
||||
);
|
||||
|
||||
% Calculate total cards of an artist played per round
|
||||
constraint forall (a in Artists, r in Rounds) (
|
||||
cards_per_artist_per_round[r, a] = sum(p in Players) (visible_count_per_round_per_artist_per_player[r,p,a])
|
||||
);
|
||||
|
||||
% Sanity check
|
||||
constraint forall (a in Artists, r in Rounds) (
|
||||
cards_per_artist_per_round[r,a]>=0
|
||||
);
|
||||
% So they don't go negative
|
||||
constraint forall (a in Artists, r in Rounds, p in Players) (
|
||||
visible_count_per_round_per_artist_per_player[r,p, a]>=0
|
||||
);
|
||||
|
||||
% Calculate total score per player
|
||||
constraint forall(r in Rounds, p in Players) (
|
||||
|
@ -68,6 +56,16 @@ constraint forall(r in Rounds, a in Artists) (
|
|||
awards_per_round_per_artist[r,a] = 1 -> cards_per_artist_per_round[r,a] > 0
|
||||
);
|
||||
|
||||
% DOUBLE CARDS
|
||||
% - Double cards are counted as VISIBLE
|
||||
% - Double cards CANNOT breach the 6 LIMIT
|
||||
% Total number of DOUBLE CARDS for each artist = 1
|
||||
% FOR EVERY ROUND+ARTIST combination, only 1 player should have played a double card
|
||||
% TODO: Check if this is still correct after a second round
|
||||
constraint forall(a in Artists) (
|
||||
sum(p in Players, r in Rounds) (double_played[r,p,a]) = 1
|
||||
);
|
||||
|
||||
% Score = ranking_score + award_score if an award was given this round
|
||||
constraint forall(r in Rounds, a in Artists) (
|
||||
total_score_per_round_per_artist[r,a] =
|
||||
|
@ -78,11 +76,42 @@ constraint forall(r in Rounds, a in Artists) (
|
|||
endif
|
||||
);
|
||||
|
||||
% constraint forall(r in Rounds, a in Artists) (
|
||||
% awards_per_round_per_artist
|
||||
array[Rounds,Players] of var int: max_cards_per_round_per_player;
|
||||
|
||||
% What is the extra cards you can possibly play
|
||||
array[Rounds,Players,Artists] of var bool: bonus_due_to_double_cards;
|
||||
|
||||
constraint forall(a in Artists, r in Rounds, p in Players) (
|
||||
% If this player played more than 2 cards of this artist
|
||||
if visible_count_per_round_per_artist_per_player[r,p,a] >=2
|
||||
% And this artist is the winning artist this round
|
||||
/\ row(sorted_artists_per_round,r)[1] = a
|
||||
% And you closed this round
|
||||
/\ visible_count_per_round_per_artist_per_player[r,p,a] = max_visible_cards
|
||||
% and they are claiming their double now
|
||||
/\ double_played[r,p,a] then
|
||||
bonus_due_to_double_cards[r,p,a] = true
|
||||
else
|
||||
bonus_due_to_double_cards[r,p,a] = false
|
||||
endif
|
||||
);
|
||||
|
||||
% array[Rounds,Players] of var int: negs_due_to_double_cards;
|
||||
|
||||
% constraint forall(r in Rounds, p in Players) (
|
||||
|
||||
% );
|
||||
|
||||
% Calculate maximum cards any player can play in first round
|
||||
constraint forall(p in Players) (
|
||||
max_cards_per_round_per_player[Round1,p] = 13
|
||||
);
|
||||
|
||||
% TODO: This is actual not VISIBLE, but TOTAL cards LIMIT
|
||||
% TODO: This does not consider any of the symbols
|
||||
% You can max play 13 cards in Round 1
|
||||
constraint forall(p in Players) (sum(a in Artists) (visible_count_per_round_per_artist_per_player[Round1,p,a]) <=13);
|
||||
% IMPLIED RULE: You can max play 13 cards in Round 1
|
||||
constraint forall(p in Players) (
|
||||
sum(a in Artists) (
|
||||
visible_count_per_round_per_artist_per_player[Round1,p,a]
|
||||
) <= max_cards_per_round_per_player[Round1,p]
|
||||
);
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
% Sanity check
|
||||
constraint forall (a in Artists, r in Rounds) (
|
||||
cards_per_artist_per_round[r,a]>=0
|
||||
);
|
||||
% So they don't go negative
|
||||
constraint forall (a in Artists, r in Rounds, p in Players) (
|
||||
visible_count_per_round_per_artist_per_player[r,p, a]>=0
|
||||
);
|
||||
|
||||
% Score sanity per round
|
||||
constraint forall (a in Artists, r in Rounds) (
|
||||
ranking_score_per_artist_per_round[r,a] >=0
|
||||
);
|
||||
|
||||
% Round 1 Player 1
|
||||
constraint first_player[Round1] = Nemo;
|
|
@ -3,21 +3,31 @@ enum Players;
|
|||
enum Artists;
|
||||
enum Rounds;
|
||||
|
||||
Players = { Nemo, Jana, Adam};
|
||||
Players = { Nemo, Jana};
|
||||
Artists = {Krypto,KarlGitter,ChristinP,Yoko,LiteMetal};
|
||||
Rounds = {Round1};
|
||||
|
||||
% Number of cards per round per player per artist
|
||||
array[Rounds,Players,Artists] of var int: visible_count_per_round_per_artist_per_player;
|
||||
|
||||
% First player every Round
|
||||
array[Rounds] of var Players: first_player;
|
||||
|
||||
% Closing player every Round
|
||||
array[Rounds] of var Players: last_player;
|
||||
|
||||
% How much score was made by each artist in each round by just RANKING
|
||||
array[Rounds,Artists] of var int: ranking_score_per_artist_per_round;
|
||||
|
||||
% Total points that an artist has in a given round
|
||||
array[Rounds,Artists] of var int: total_score_per_round_per_artist;
|
||||
|
||||
% Whether an artist won an award in a given round
|
||||
array[Rounds,Artists] of var bool: awards_per_round_per_artist;
|
||||
|
||||
% Whether you played a double this round
|
||||
array[Rounds,Players,Artists] of var bool: double_played;
|
||||
|
||||
% Winning artists for each round (just-by-ranking)
|
||||
array[Rounds,1..card(Artists)] of var Artists: sorted_artists_per_round;
|
||||
|
||||
|
|
Loading…
Reference in New Issue