diff --git a/models/Language_concepts/Event_Sharing_Using_COORDINATE_with_SHARE.mp b/models/Language_concepts/Event_Sharing_Using_COORDINATE_with_SHARE.mp new file mode 100644 index 0000000000000000000000000000000000000000..37aaa44762ec0ec5dec7bece3f0d8195806dc6fa --- /dev/null +++ b/models/Language_concepts/Event_Sharing_Using_COORDINATE_with_SHARE.mp @@ -0,0 +1,70 @@ +/*┬────────────────────────────────────────────────────────┠+│*│ ┌─[ Title and Authors ]──────────────────────────────┠│ +│*│ │ Event Sharing Using COORDINATE with SHARE │ │ +│*│ │ Created by Kristin Giammarco and Mike Collins │ │ +│*│ │ 2021-11-11 │ │ +│*│ └────────────────────────────────────────────────────┘ │ +│*│ │ +│*│ ┌─[ Purpose ]────────────────────────────────────────┠│ +│*│ │ To illustrate how SHARE ALL is a shortcut for a │ │ +│*│ │ COORDINATE statement with SHARE. │ │ +│*│ └────────────────────────────────────────────────────┘ │ +│*│ │ +│*│ ┌─[ Description ]────────────────────────────────────┠│ +│*│ │ This model shows the use of COORDINATE statements │ │ +│*│ │ in lieu of SHARE ALL statements, illustrating how │ │ +│*│ │ SHARE ALL is a contraction of the longer COORDINATE│ │ +│*│ │ statement that composes the same relationships. │ │ +│*│ │ SHARE ALL exists because the author of the MP │ │ +│*│ │ language, Mikhail Auguston, believes this use of │ │ +│*│ │ event sharing is so common that it deserves a │ │ +│*│ │ concise way to perform the sharing operation. │ │ +│*│ │ Understanding how SHARE and SHARE ALL work is │ │ +│*│ │ helpful when there is a need to compose more │ │ +│*│ │ complex sharing operations, such as sharing among │ │ +│*│ │ composite events. │ │ +│*│ └────────────────────────────────────────────────────┘ │ +│*│ │ +│*│ ┌─[ References ]─────────────────────────────────────┠│ +│*│ │ "Example 3: Data Flow" from Auguston, M. "Monterey │ │ +│*│ │ Phoenix System and Software Architecture and │ │ +│*│ │ Workflow Modeling Language Manual" (Version 4). │ │ +│*│ │ 2020. Available online: │ │ +│*│ │ https://wiki.nps.edu/display/MP/Documentation │ │ +│*│ │ │ │ +│*│ │ Example02_DataFlow_EventSharing. Available online:│ │ +│*│ │ https://gitlab.nps.edu/monterey-phoenix/mp-model-collection/preloaded-examples/-/tree/master/models +│*│ └────────────────────────────────────────────────────┘ │ +│*│ │ +│*│ ┌─[ Search Terms ]───────────────────────────────────┠│ +│*│ │ behavior, data flow; event sharing │ │ +│*│ └────────────────────────────────────────────────────┘ │ +│*│ │ +│*│ ┌─[ Instructions ]───────────────────────────────────┠│ +│*│ │ Run for Scopes 1 and up. │ │ +│*│ ├─[ Run Statistics ]─────────────────────────────────┤ │ +│*│ │ Scope 1: 3 traces in less than 1 sec. │ │ +│*│ │ Scope 2: 28 traces in less than 1 sec. │ │ +│*│ │ Scope 3: 165 traces in less than 1 sec. │ │ +│*│ └────────────────────────────────────────────────────┘ │ +└*┴───────────────────────────────────────────────────────*/ + +SCHEMA Event_Sharing_Using_COORDINATE_with_SHARE + +ROOT Writer: (* ( working | writing ) *); + +/* writing events should precede reading */ +ROOT File: (+ writing +) (* reading *); + +/*Writer, File SHARE ALL writing;*/ +COORDINATE $a: writing FROM Writer, + $b: writing FROM File + DO SHARE $a $b; OD; + + +ROOT Reader: (* ( reading | working ) *); + +/*Reader, File SHARE ALL reading;*/ +COORDINATE $a: reading FROM Reader, + $b: reading FROM File + DO SHARE $a $b; OD; \ No newline at end of file