The purpose of the DSE project is to define events (called DSE) on AS elements that will trigger EF calls when they occurs. Furthermore, constraints can be defined on these events to define when they may occur.
Like for the DSA Project, right click on any file of the xDSML project and choose GEMOC Languge > Create DSE Project for language to start the wizard.
On the last screen, complete the required fields:
Once the wizard has been completed, the org.gemoc.sample.markedgraph.dse project is created with a template for the MarkedGraphL.ecl file (found in the ecl directory).
Replace the content of the ECL file with the following code (explanations on this code are given bellow):
The file MarkedGraphL.ecl.
import 'platform:/resource/org.gemoc.sample.markedgraph.model/model/markedgraph.ecore' ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/kernel.ccslLib" ECLimport "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/CCSL.ccslLib" package markedgraph context MarkedGraph def: initIt: Event = self.initialize() context Transition def: fireIt: Event = self.fire() context Place inv tokenCountIsNull: (self.tokenCount = 0) implies (Relation Precedes(self.input.fireIt, self.output.fireIt)) inv tokenCountIsNotNullDelayRequired: (self.tokenCount > 0) implies let delay: Integer = self.tokenCount in let outputDelayed: Event = Expression DelayFor(self.output.fireIt, self.output.fireIt, delay) in Relation Precedes(self.input.fireIt, outputDelayed) context MarkedGraph inv initFirst: let firstInit : Event = Expression OneTickAndNoMore(self.initIt) in let allFire : Event = Expression Union(self.transitions.fireIt) in let firstOfAllFire : Event = Expression OneTickAndNoMore(allFire) in Relation Precedes(firstInit, firstOfAllFire) inv onlyOneInit: let firstInit2 : Event = Expression OneTickAndNoMore(self.initIt) in Relation Coincides(self.initIt, firstInit2) endpackage
This step has three main purposes:
First, it specifies DSE in the context of metaclasses of the AS. For Marked Graph xDSML, we identify 2 DSE:
Then, it links them to EF from DSA --- when a DSE will occur the associated EF will be executed.
Finally, it defines constraints on the DSE to rule the possible scheduling. Constraints generally rely on relations which are defined in MoCC libraries. Here constraints are expressed in CCSL and only relies on relations and expression from the CCSL core library.
Please notice that, as often, DSE are defined at the language level, but at runtime they are instantiated as MSE on each object instance of the metaclasse they are defined on. For example, there will be one fireIt MSE for each Transition element of MarkedGraph model. For the wikipedia example, there will a fireIt event for transitions t1, t2, t3 and t4. In the same way, constraints apply to the MSE.