Class ModelEvaluatorUtil

java.lang.Object
tools.descartes.dlim.generator.ModelEvaluatorUtil

public final class ModelEvaluatorUtil extends Object
Provides utility methods for model evaluation.
  • Method Details

    • setRootSequence

      public static void setRootSequence(Sequence rootSequence)
      Sets the rootSequence, referenced by the utilities.
      Parameters:
      rootSequence - the new root sequence
    • neutralElement

      public static double neutralElement(Operator op)
      Returns the Operator's neutral element.
      Parameters:
      op - the op
      Returns:
      1, for multiplication; 0, otherwise.
    • getFunctionDuration

      public static double getFunctionDuration(Function f)
      Returns the Function's duration depending on ReferenceClockType and PointOfReferenceClockObject of the containing Element.
      Parameters:
      f - the f
      Returns:
      the function duration
    • getFunctionBegin

      public static double getFunctionBegin(Function f)
      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

      public static Combinator getParentCombinator(Function f)
      Returns the direct parent of f, if it is a Combinator. Otherwise: returns null.
      Parameters:
      f - the f
      Returns:
      the parent combinator
    • containsInTree

      public static boolean containsInTree(EObject node, EObject leaf)
      Checks recursively, weather the part of the tree contained by node contains leaf.
      Parameters:
      node - the node
      leaf - the leaf
      Returns:
      true, if successful
    • getParentSequence

      public static Sequence getParentSequence(ReferenceClockObject clock)
      Returns the Sequence containing clock.
      Parameters:
      clock - the clock
      Returns:
      the parent sequence
    • getParentSequence

      public static Sequence getParentSequence(TimeDependentFunctionContainer e)
      Returns the direct parent of e, if it is a Sequence. Otherwise: returns null.
      Parameters:
      e - the e
      Returns:
      the parent sequence
    • getRootSequence

      public static Sequence getRootSequence(EObject modelElement)
      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

      public static boolean containsReferenceClock(Function root)
      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.