Minor reformatting

This commit is contained in:
Nemo 2020-06-11 15:56:20 +05:30
parent da83f6eda1
commit b592a6d984
5 changed files with 25 additions and 11 deletions

View File

@ -17,7 +17,7 @@ constraint forall(a in Artists) ( sum(col(awards_per_round_per_artist,a)) = 1 );
% awards can only be given if an artist's card was played that turn
constraint forall(r in Rounds, a in Artists) (
awards_per_round_per_artist[r,a] -> CardsForArtist[r,a] > 0
awards_per_round_per_artist[r,a] = true -> CardsForArtist[r,a] > 0
);
% Set award_bonus_per_round_per_artist = array[5] with bonus that can be added to ranking scores

View File

@ -54,6 +54,12 @@ constraint forall(p in Players) (
StartingCardsInHand[Round4,p] = StartingCardsInHand[Round3,p] - TotalCardsPlayed[Round3,p] + CardsDealtPerRound[Round4]
);
% TODO: Move to simultanouse
% The last player must have played atleast one card of the top artist
constraint forall(r in Rounds) (
visible_count_per_round_per_artist_per_player[r,last_player[r],sorted_artists_per_round[r,1]] >=1
);
% TURN ORDER STUFF
constraint forall(r in Rounds) (
NominalTurnCount[r] = TotalCardsPlayed[r, last_player[r]]
@ -70,8 +76,6 @@ var set of Players: Px2;
var set of Players: Px3;
var set of Players: Px4;
set of int: emptySet = 1..0;
constraint Pn1 = if (first_player[Round1] < last_player[Round1]) then
first_player[Round1]..last_player[Round1]
else

View File

@ -19,16 +19,14 @@ array[Rounds] of var Players: last_player;
% Total points that an artist has in a given round
array[Rounds,Artists] of var int: total_score_per_round_per_artist;
% Score a player gets in each given round
array[Rounds,Players] of var int: RoundScore;
% Final score of a player
array[Players] of var int: Score;
% Total number of a cards of an artist that were PLAYED this round
array[Rounds, Artists] of var int: CardsForArtist;
% Number of Turns played by the closing player this round
array[Rounds] of var int: NominalTurnCount;
% constraint award_bonus_per_round_per_artist[Round1,Krypto] = true;
% constraint award_bonus_per_round_per_artist[Round1,Yoko] = true;
% constraint award_bonus_per_round_per_artist[Round1,ChristinP] = true;
solve maximize Score[Nemo];

View File

@ -28,4 +28,5 @@ constraint forall(a in Artists) (
);
% This is a 2-5 player game
constraint 2<= assert(card(Players)) <=5
constraint assert(card(Players) <=5, "Max Players is 5");
constraint assert(card(Players) >=1, "MinPlayers is 2");

View File

@ -1,7 +1,18 @@
% Score a player gets in each given round
array[Rounds,Players] of var int: RoundScore;
% Final score of a player
array[Players] of var int: Score;
% For Cumulative Scoring
% 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] =
ranking_score_per_artist_per_round[r,a] + award_bonus_per_round_per_artist[r,a]
ranking_score_per_artist_per_round[r,a] + award_bonus_per_round_per_artist[r,a] +
if r=Round1 then
0
else
total_score_per_round_per_artist[enum_prev(Rounds, r),a] endif
);
% Calculate total score per player