Package tools.descartes.dlim.generator
Class ModelEvaluatorUtil
java.lang.Object
tools.descartes.dlim.generator.ModelEvaluatorUtil
Provides utility methods for model evaluation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
containsInTree
(EObject node, EObject leaf) Checks recursively, weather the part of the tree contained by node contains leaf.static boolean
Checks and returns true, if the model contains and uses a ReferenceClockObject.static double
Returns the "start" attribute of a parent Element or Sequence, depending on the parent Element's referenceClock.static double
Returns the Function's duration depending on ReferenceClockType and PointOfReferenceClockObject of the containing Element.static Combinator
Returns the direct parent of f, if it is a Combinator.static Sequence
Returns the Sequence containing clock.static Sequence
Returns the direct parent of e, if it is a Sequence.static Sequence
getRootSequence
(EObject modelElement) Returns the root Container of the modelElement, if it is a Sequence.static double
Returns the Operator's neutral element.static void
setRootSequence
(Sequence rootSequence) Sets the rootSequence, referenced by the utilities.
-
Method Details
-
setRootSequence
Sets the rootSequence, referenced by the utilities.- Parameters:
rootSequence
- the new root sequence
-
neutralElement
Returns the Operator's neutral element.- Parameters:
op
- the op- Returns:
- 1, for multiplication; 0, otherwise.
-
getFunctionDuration
Returns the Function's duration depending on ReferenceClockType and PointOfReferenceClockObject of the containing Element.- Parameters:
f
- the f- Returns:
- the function duration
-
getFunctionBegin
Returns the "start" attribute of a parent Element or Sequence, depending on the parent Element's referenceClock.- Parameters:
f
- the f- Returns:
- the function begin
-
getParentCombinator
Returns the direct parent of f, if it is a Combinator. Otherwise: returns null.- Parameters:
f
- the f- Returns:
- the parent combinator
-
containsInTree
Checks recursively, weather the part of the tree contained by node contains leaf.- Parameters:
node
- the nodeleaf
- the leaf- Returns:
- true, if successful
-
getParentSequence
Returns the Sequence containing clock.- Parameters:
clock
- the clock- Returns:
- the parent sequence
-
getParentSequence
Returns the direct parent of e, if it is a Sequence. Otherwise: returns null.- Parameters:
e
- the e- Returns:
- the parent sequence
-
getRootSequence
Returns the root Container of the modelElement, if it is a Sequence. Returns null otherwise.- Parameters:
modelElement
- the model element- Returns:
- the root sequence
-
containsReferenceClock
Checks and returns true, if the model contains and uses a ReferenceClockObject.- Parameters:
root
- The model's root- Returns:
- True, if at least one Sequence in the model contains a ReferenceClockObject.
-