![]() |
Beyond Code: An Introduction to Model-Driven Software Development (CISC 844, Winter 2025)
Assignment 4 (DSLs with Xtext)Due: Friday, April 4, 2025
|
Just like UML-RT, Urml is meant for the description of embedded systems with soft real-time constraints as found, e.g., in the telecommunications industry. It supports structural modeling via 'capsules', i.e., components can communicate with each other only by sending and receiving messages over 'connectors' and 'ports', i.e., boundary objects that are typed with 'protocols' which define the messages that are accepted by the port. Capsules can be contained in other capsules and every model has a root capsule. The behaviour of every capsule is described by means of a statemachine; a transition consists of a trigger, a (possibly empty) guard, and (possibly empty) action code. A message sent to a capsule will cause a transition to be taken and its action code to be executed, if the source state of the transition is currently active, the message matches the trigger, and the guard evaluates to 'true'. The action code is given in a simple imperative language with constructs of sending and receiving messages.
Urml was developed by Keith Yip and for more details on the language and its implementation, please see his MSc thesis.ca.queensu.cs.mase.urml/src/ca.queensu.cs.mase/Urml.xtext
.
ca.queensu.cs.mase.urml/src-gen/ca.queensu.cs.mase/Urml.ecore
(or in ca.queensu.cs.mase.urml/model/generated/Urml.ecore
)
ca.queensu.cs.mase.urml/src-gen/ca.queensu.cs.mase/urml
.
model
and urml
containing the generated code into
the source folder of the Java project.
ca.queensu.cs.mase.validation
.
ca.queensu.cs.mase.interpreter.*
.
Note that, e.g., whenever more than one transition is enabled, the interpreter
(see class TransitionSelector
in ca.queensu.cs.mase.interpreter.filter
)
prints 'NON-DETERMINISM' in the console.
ca.queensu.cs.mase.generator.*
.
choose(x,e)
statement to the syntax of Urml
where x
is a local variable or an attribute and e
is an
integer expression.
choose(x,e)
should first evaluate
the expression e
;
if e
evaluates to an integer i
greater than 0
,
then x
is randomly assigned an integer
greater or equal to 0
and less than i
;
if e
evaluates to an integer equal or less than 0
,
0
is assigned.
choose(x,e)
appropriately.
Player1
, Player2
)
and a referee capsule (Referee
).
The game starts when the referee sends a go
message to
each of the players, which starts the first round.
In each round, the players pick one of 'rock', 'paper', or 'scissors'
at random and send their pick to the referee.
Game play ends after at most three rounds and
the winner is determined using the 'best-of-three' rule, i.e.,
the player with the most winning hands after three rounds wins.
The referee should output appropriate messages.
ca.queensu.cs.mase.urml
,
ca.queensu.cs.mase.urml.sdk
,
ca.queensu.cs.mase.urml.tests
, and
ca.queensu.cs.mase.urml.ui
,
right-click, select 'Export...',
select 'General' -> 'Archive File'.
Use '[firstName]_[lastName]_A4_CISC844_W25.zip
'
as name where '[firstName]
' and '[lastName]
'
are replaced by your first and last names, respectively.
Upload this archive to OnQ.
[firstName]_[lastName]_A4_CISC844_W25_RPSModel.zip
'
as name where '[firstName]
' and '[lastName]
'
are replaced by your first and last names, respectively.
Upload this archive to OnQ.
Sun Mar 16 2025 20:17:43