diff --git a/awards.mzn b/awards.mzn index 8193126..c608274 100644 --- a/awards.mzn +++ b/awards.mzn @@ -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 diff --git a/gameplay.mzn b/gameplay.mzn index 0b08ddf..8e18e3f 100644 --- a/gameplay.mzn +++ b/gameplay.mzn @@ -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 diff --git a/modernart.mzn b/modernart.mzn index ee50a0d..ff1d485 100644 --- a/modernart.mzn +++ b/modernart.mzn @@ -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]; \ No newline at end of file diff --git a/sanity.mzn b/sanity.mzn index 52c1921..ac25c4a 100644 --- a/sanity.mzn +++ b/sanity.mzn @@ -28,4 +28,5 @@ constraint forall(a in Artists) ( ); % This is a 2-5 player game -constraint 2<= assert(card(Players)) <=5 \ No newline at end of file +constraint assert(card(Players) <=5, "Max Players is 5"); +constraint assert(card(Players) >=1, "MinPlayers is 2"); \ No newline at end of file diff --git a/scoring.mzn b/scoring.mzn index dc89f3e..b270cdb 100644 --- a/scoring.mzn +++ b/scoring.mzn @@ -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