![]() |
Beyond Code: An Introduction to Model-Driven Software Development (CISC 836, Fall 2021)
Assignment 2 (MDSD with RSARTE)Due:
|
Game play consists of a sequence of rounds. In each round, the referee should ask each player for their choice, collect the responses, and determine the outcome. Each round can have one of three possible outcomes: Player 1 wins, Player 2 wins, or there is a tie (because both players returned the same choice to the referee). Between two rounds, the referee should wait for a user-specified number of seconds before it starts the next round. When asked for her choice, a player should randomly return one of the three possible choices (Rock, Paper, or Scissors). The choice should be determined using a random number generator.
The number of rounds played in a game should depend on a command line parameter bestOf. The game should end as soon as a winner can be determined and after bestOf rounds the latest. In other words, the game should end as soon as it has become impossible for one player to lose (and for the other player to win), assuming a maximum of bestOf rounds. For instance, if bestOf is 1, game play always consists of exactly 1 round. If bestOf is 2, game play always consists of exactly 2 rounds. However, if bestOf is 3, game play could end after 2 rounds (if one player has won both of these rounds), but must end after 3 rounds. If bestOf is 7, the game could end after 4, 5, 6, or 7 rounds. Note that regardless of the value of bestOf, a game can always have 3 different outcomes (Player 1 wins, Player 2 wins, or the game is tied).
Your design should
Depending on which version of the changer is used, we get different versions of the entire system. When 'changerV1' is used, we call the resulting system 'GiveChangeV1'. Similarly for other versions of the changer.
The code generated from model is invoked with
>>./executable -URTS_DEBUG=quit -UARGS <sel> <ins>where <sel> represents the value of item (in cent) selected by the customer, and <ins> represents the amount of money (in cent) inserted. So, e.g., the invocation
>>./executable -URTS_DEBUG=quit -UARGS 900 2000should cause the changer (no matter which version is used) to dispense five 200-cent coins (i.e., five 'toonies') and one 100-cent coin (i.e., one 'loonie'), terminate successfully and not report any errors.
>> ./executable -URTS_DEBUG=quit -UARGS 100 600For each system, how long is the execution caused by this invocation, i.e., how many run-to-completion steps does the execution consist of? Put your answer into the same text file created in the previous task ('Part2.txt').
Last modified: Sun Oct 03 2021 14:09:19