StoEx Stochastic Expressions in PCM

Aus SDQ-Wiki
Zur Navigation springen Zur Suche springen


Stochastic Expressions in the PCM are used for specifications like resource demands and others. Palladio includes an independent package for common StoEx. The pcm model itself has a dependency on this package and takes use of it. [[1]]

StoEx Plugin Compilation

Note: If you have checked out the pcm core plugin and it can not be build because of compilation errors related to stoex or antlr, you need to check out the org.antlr project in Palladio.Wrapper in the code repository. Even if the plugin is installed in your eclipse environment, this might not be sufficient enought. The check out of the plugin is necessary..

Palladio - StoEx - Integration


The StoEx provides a RandomVariable interface and it's implementation. The RandomVariable contains a specification which is a textual representation of the expression term. Additionaly, the RandomVariable has a reference to an Expression object derived from the textual specification.

The pcm model contains a PCMRandomVariable derived from the RandomVariable. The implementation of the Expression deriving is done in the implemetion of the PCMRandomVariable (...pcm.core.impl.PCMRandomVariableImpl). This class contains an overriding version of the basicGetExpression() method that invoces the MyPCMStoExLexer and MyPCMStoExParser.

When is the StoEx parsed?

The StoEx specification term is parsed multiple times:

  • Everytime someone calls the getExpression() method on the PCMRandomVariable (i.e. for presentation purposes)
  • During the editin in the StoEx Dialog

StoEx Dialog

The PCM includes an StochasticExpressionEditDialog. This is a common used dialog for StoEx editing that can be used wherever this is required. The editors like the resository or seff editors provide their custom access to this dialog. I.e. the SEFF Editor contains OpenStoExDialog Edit Policy that opens this common dialog.

Probability Distributions

The list of available probability distibutions can be found in the class ProbFunctionHelper:

  • Lognorm(mu, sigma)
  • LognormMoments(mean, stdev)
  • Gamma(alpha, theta)
  • GammaMoments(mean, coeffVar)
  • Norm(mu, sigma)
  • Exp(rate)
  • ...