Main Page/Resources/E-motions
From Atenea
Contents |
Introduction
The e-Motions tool is a DSML and graphical framework developed for Eclipse that supports the specification, simulation, and formal analysis of real-time systems. It provides a way to graphically specify the dynamic behavior of DSMLs using their concrete syntax, making this task quite intuitive. e-Motions behavioral specifications are models too, so that they can be fully integrated in MDE processes and, e.g., transformed into different semantic domains to perform different kinds of analysis.
Specifying the dynamic behavior of a DSML with e-Motions
There are two models involved in the definition of the behavior of a DSML: a graphical concrete syntax (gcs) model and a behavior model. Both of them are defined graphically by means of their corresponding diagrams.
The gcs model defines the graphical appearance of the concepts of the DSMLâ€™s metamodel, and the behavior model makes use of it to define the behavioral rules of the system. The gcs model is automatically generated from the definition of our DSML metamodel. Basically, it contains a class graphical definition (ClassGD) for every metaclass (EClass). The ClassGD instances allow users to associate an image to every metaclass through the figurePath attribute. Objects whose metaclasses do not have assigned any picture will be drawn as yellow rectangles (the default shape). To create a gcs diagram go to New -> Other -> e-Motions -> GCS Diagram.
The behavior model uses the gcs model to graphically represent the behavioral rules of our DSML. A behavior model is associated with two editors: the behavior editor, and the rule editor. The behavior editor is used to define the set of rules and helpers that constitute the behavior of the DSML. The rule editor is used to define the components of a specific rule: its variables, its patterns (LHS, RHS and NACs), the elements contained in the patterns (objects, links, conditions and action executions), etc. To create a behavior diagram go to New -> Other -> e-Motions -> Behavior Diagram.
The novelty in this approach is the addition of time-related attributes to rules (to represent duration, periodicity, etc.), and the inclusion of the action execution elements, which represent action executions. Other concepts, such as the DPO and SPO formalizations of transformations, and the non-injectiveness of the rules, have the same meaning than in common graph transformation approaches (although adapted to the tree-structure of Eclipse models). Further details of the tool and its features can be found here.
Simulation and Analysis of the specifications
Once we have defined the behavioral specifications of our DSML, we can perform simulation and analysis over our DSMLs models. The e-Motions tool automatically generate the Maude specifications of the DSML metamodel, DSML behavior, and an initial model. Currently, simulation can be performed directly in the Eclipse platform without being aware of Maude at all. However, in order to perform reachability and model checking analysis we need to move to the Maude environment (which is also available in the Eclipse platform).
The previous figure shows the simulation window of the e-Motions tool. To perform a simulation, we have to select the metamodel and the behavioral model of our DSML, and the file where we want the resulting EMF model to be stored. Additionally, we may specify a default time elapse, a time bound for the simulation, and an initial model for it. If the default time elapse is left undefined, the maximal time elapse of the system will be considered, otherwise time is advanced by the smallest value of the maximum time elapse of the system and the default time elapse value specified by the user. In case that we do not specify an initial model, the tool will consider an empty model (note that we can create a model by means of a rule).
Examples
This section provides some examples of systems designed with e-Motions.
- MPNs models the behavior of a Mobile Phone Network.
- EDF models a dynamic scheduling algorithm used in real-time operating systems.
- RTTP models a system that measures the Round Trip Time parameter. We have designed two solutions for this example:
- SoundSystem models a system that forwards sounds from a sound maker to a speaker through the Internet. We have designed two solutions for this example:
- PLS models a production line system that generates hammers by assembling parts (handles and heads) and shows how the system can be simulated and analysed for performance.
- Packet Switching models a packet switching network, showing how to simulate the system and analyse some of its performance properties (including the expression and analysis of its adaptable architecture).
- P2P Network models a re-configurable P2P network.
- Airport models an airport queueing system, and analyses different strategies for performance.
- Airport with a Modular Definition of Observers models the airport queueing system defined previously, now with a modular definition of the observers.
- QNMs shows how e-Motions can model and simulate many kinds of QNM (Queueing Network Models) systems and conduct the typical performance analysis of these systems using the e-Motions language and supporting toolkit.
- DSAP 8-nodes Network presents the high-level modeling of the Directional Source Aware Routing Protocol for Wireless Sensor Networks and two variants of it in a network where nodes have 8 neighbors.
- DSAP Generic and Realistic Behavior presents the high-level modeling of the Directional Source Aware Routing Protocol and two variants of it. Networks can have any size and any number of neighbors. Besides, some realistic behavior is added to the protocols and it is shown how simulations give different results when considering these realistic situations.
- Cloud System presents the modeling of cloud infrastructures with self-adaptation in terms of scalability by duplicating services.
- Palladio presents a reimplementation of the Palladio Component Model in e-Motions describing its semantics and extending it using a modular definition of observers.
Companions
Video Tutorial
This video shows how to create an E-motions model. For this purpose we use the RTTP example (solution b) which you can download from the "Examples" section.
Hints and Tips
Some useful recommendations on the use of e-Motions and several ideas for good practices (including hints for improving the performance of the simulations) can be found in the Hints&Tips page.
Known Bugs
In this section you can see some common errors in that we are working and the bugs fixed in each version.
Probability distributions
In e-Motions it is possible to use some probability distributions. This is especially useful when defining rules duration. In this way, customers arrival times to the queue in a shop, processing time of a task in a processor, lifetime of a light bulb, etc. can be modelled in e-Motions using probability distributions. The available distributions and the way of calling them is:
- Exponential distribution. It describes the time between events in a Poisson process, i.e. a process in which events occur continuously and independently at a constant average rate. To obtain a value exponentialy distributed in e-Motions, eMotions.expDistr(r) must be typed, where r>0 is the rate of the distribution. It returns an integer value and r can be either an integer or a double value. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Normal distribution. The normal (or Gaussian) distribution is a continuous probability distribution that is often used as a first approximation to describe real-valued random variables that tend to cluster around a single mean value. To obtain a value normally distributed in e-Motions, eMotions.normDistr(m,s) must be typed, where m is the mean and s (sigma) is the square root of the variance. It returns an integer value and m and s can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Gamma distribution. This distribution is frequently a probability model for waiting times; for instance, in life testing, the waiting time until death is a random variable that is frequently modeled with a gamma distribution. To obtain a value distributed according to this distribution in e-Motions, eMotions.gammaDistr(s,k) must be typed, where k>0 is the shape and s>0 is the scale. It returns an integer value and k and s can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Weibull distribution. It is a versatile distribution that can take on the characteristics of other types of distributions, based on the value of the shape parameter. To obtain a value distributed according to this distribution in e-Motions, eMotions.weibDistr(s,k) must be typed, where s>0 is the scale and k>0 is the shape. It returns an integer value and k and s can be either an integer or a double value. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Erlang distribution. The Erlang distribution is a continuous probability distribution with wide applicability primarily due to its relation to the Exponential and Gamma distributions. To obtain a value distributed according to this distribution in e-Motions, erlangDistr(s,k) must be typed, where s>0 is the scale and k>0 is the shape. It returns an integer value and k and s can be either an integer or a double value. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Chi-square distribution. The sum of squares of several unit normal variates has a distribution known as chi square. The chi-square distribution is used whenever a sum of squares of normal variables is involved, for example, to model sample variances. It is also one of the most widely used probability distributions in inferential statistics, e.g., in hypothesis testing or in construction of confidence intervals. To obtain a value distributed according to this distribution in e-Motions, chiSDistr(d) must be typed, where d>0 are the degrees of freedom. It returns an integer value and d can be either an integer or a double value. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- F distribution. The ratio of two chi-square variates has an F distribution. It is also known as Snedecor's F distribution or the Fisher-Snedecor distribution. To obtain a value distributed according to this distribution in e-Motions, fDistr(d,n) must be typed, where d>0 are the denominator degrees of freedom and n>0 are the numerator degrees of freedom. It returns an integer value and d and n can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Geometric distribution. The distribution of number of trials up to and including the first success in a sequence of Bernoulli trials is called a geometric distribution. It is a discrete equivalent of the exponential distribution, so it is memoryless. To obtain a value distributed according to this distribution in e-Motions, geomDistr(r) must be typed, where 1/r is the mean. It returns an integer value and r can be either an integer or a double value. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Lognormal distribution. The logarithm of a normal variate has a lognormal distribution.In regression modeling and analysis of experimental designs, often log transformation is used. In such cases, the response in the transformed model has a normal distribution while the original response has a lognormal distribution. To obtain a value distributed according to this distribution in e-Motions, logNormDistr(l,s) must be typed, where l is the log-shape and s is the scale. It returns an integer value and l and s can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Pareto distribution. It is a power law probability distribution that coincides with social, scientific, geophysical, actuarial, and many other types of observable phenomena. Outside the field of economics it is sometimes referred to as the Bradford distribution. To obtain a value distributed according to this distribution in e-Motions, eMotions.paretDistr(s,k) must be typed, where k>0 is the shape and s>0 is the scale. It returns an integer value and k and s can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Pascal distribution. It is an extension of the geometric distribution. In a sequence of Bernoulli trials, the number of trials up to and including the mth success has a Pascal distribution. To obtain a value distributed according to this distribution in e-Motions, eMotions.pascalDistr(n,p) must be typed, where n>0 is the number of successes and 0<p<1 is the probability of success. It returns an integer value and n and p can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
- Uniform distribution. The uniform distribution is a probability distribution whereby a finite number of equally spaced values are equally likely to be observed; every one of n values has equal probability 1/n. To obtain a value distributed according to this distribution in e-Motions, eMotions.unifDistr(l,u) must be typed, where l is the lower bound and u is the upper bound. It returns an integer value and l and u can be either integer or double values. When defining a variable to use in the duration of a rule, here it is an example of how it should be defined within the rule: . Then, in the duration of the rule (Min duration and Max duration features), the user only has to type duration, which is the variable previously created in the rule.
Download
The current version of e-Motions has been tested for Windows XP, Windows Vista, Windows 7 and Linux (in its Guadalinex distribution). It requires Maude 2.4 official site or see our local mirror for Maude . Once Maude 2.4 is installed on your computer, choose any of the following options to install the e-Motions tool.
To make this version of Eclipse work properly in Windows 7, it has to be run using the compatibility mode. To activate this option, right click on the eclipse.exe and select the compatibility mode.
Please note that the Windows version in the picture shown is in Spanish.
e-Motions plugin
To install e-Motions, extract files from e-Motions(1.0.5).zip to your Eclipse Ganymede (3.4.2) configuration plugin folder. Before running e-Motions the first time, Maude has to be configured. Go to "Windows->Preference...Maude" and set the "Maude binary file" option to the corresponding file, and assign a folder to store the "Temporal files". Then, you are ready to create the graphical concrete syntax for your metamodel and its corresponding behavioral specifications. For this purpose, go to the context menu of your Eclipse Workspace -> new -> Examples -> Gcs diagram and Behavior Diagram, respectively.
Required plugins: EMF 2.4, GMF 2.1 and ATL 2.0 (Java 1.6).
Eclipse bundle for Windows
A full Eclipse configuration which includes the e-Motions tool can be dowloaded from here. Before running e-Motions the first time, Maude has to be configured. Go to "Windows->Preference...Maude" and set the "Maude binary file" option to the corresponding file, and assign a folder to store the "Temporal files". Then, you are ready to create the graphical concrete syntax for your metamodel and its corresponding behavioral specifications. For this purpose, go to the context menu of your Eclipse Workspace -> new -> Examples -> Gcs diagram and Behavior Diagram, respectively.
Eclipse bundle for Linux
A full Eclipse configuration which includes the e-Motions tool can be dowloaded from here. Before running e-Motions the first time, Maude has to be configured. Go to "Windows->Preference...Maude" and set the "Maude binary file" option to the corresponding file, and assign a folder to store the "Temporal files". Then, you are ready to create the graphical concrete syntax for your metamodel and its corresponding behavioral specifications. For this purpose, go to the context menu of your Eclipse Workspace -> new -> Examples -> Gcs diagram and Behavior Diagram, respectively.
Maude local mirror
Previous versions
See the previous versions for information about changes and the history of releases.