You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my surprise, it involved a series of interesting challenges I discovered along the way:
I had to inject tasks and people names/titles to populate them. The language reference explains how to represent values as a model, but this injection is not possible in the Playground. I had to resort to long string sequences in pre which are consumed with nextFromCollection in the code; not ideal. Perhaps a CSV panel in the playground would help.
Constraints. Achieving these merely using list, @probability and straightforward patterns is tricky. Namely:
There should be no dettached elements (i.e., the entire model must have exactly one partonomy/object tree per project)
Projects should have >= 1 tasks
Projects should have >= 1 persons
Two efforts of the same task cannot be associated to the same person (arguable)
The sum of efforts of a task must equal 100
As a derived consequence, the number of efforts per task must be less than the number of people associated in the project
Persons associated to a project must be assigned at least to one task (arguable)
I managed to solve some of these constraints, but others may need more hacking or smarter EPL patterns.
Would an example like this be useful for the Playground? If so, with a bit of help for polishing, I think we could add it.
The text was updated successfully, but these errors were encountered:
Many thanks for sharing this example; I had it on my to-do list to create an EMG example for the PSL metamodel but you beat me to it :) It'd be great if you could contribute it with a pull request under the "Basic Examples" category with the id "emg". A few minor comments on the example itself:
I'd suggest using camelCase instead of snake_case throughout the example
"The sum of efforts of a task must equal 100" <- This is not necessary as the percentage doesn't indicate the percentage of the task that is completed by the person but instead the percentage of the person's time that is allocated to the task (e.g. 40% means 2 days/week). I can see how this can be interpreted both ways though.
I know that in the EMG documentation page we use @list net but I think we should be using plural instead for lists i.e. @list nets, @list persons etc as it reads better.
I don't really know how EMG works, and the Petri Net example was too academic, so I tinkered a bit with the Playground and generated a model for a seemingly simple scenario such as the projects metamodel to get a grasp of the language.
To my surprise, it involved a series of interesting challenges I discovered along the way:
pre
which are consumed withnextFromCollection
in the code; not ideal. Perhaps a CSV panel in the playground would help.list
,@probability
and straightforwardpattern
s is tricky. Namely:I managed to solve some of these constraints, but others may need more hacking or smarter EPL patterns.
Would an example like this be useful for the Playground? If so, with a bit of help for polishing, I think we could add it.
The text was updated successfully, but these errors were encountered: