Class BasicIVMLModelOperations

java.lang.Object
eu.qualimaster.easy.extension.modelop.BasicIVMLModelOperations

public class BasicIVMLModelOperations extends Object
The methods to operate the IVML model for obtaining IVML elements information.
Author:
Cui Qin
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    Adds the freeze block to the project.
    static boolean
    addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    adds the binding time attribute to project.
    static Object[]
    configureCompoundValues(net.ssehub.easy.varModel.model.DecisionVariableDeclaration decisionVariable, Map<String,Object> compound)
    Returns an Object array configured by corresponding values of the compound.
    static net.ssehub.easy.varModel.model.FreezeBlock
    createFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
    Adds the freeze block to the project.
    static Map<String,net.ssehub.easy.varModel.model.datatypes.IDatatype>
    getCompoundNameAndType(net.ssehub.easy.varModel.model.AbstractVariable decisionDeclaration)
    Returns a map which key is the variable name, value is the variable type.
    static net.ssehub.easy.varModel.model.Constraint
    getConstraint(Object[] objectValue, net.ssehub.easy.varModel.model.AbstractVariable declarationVariable, net.ssehub.easy.varModel.model.IModelElement parent)
    Returns a constraint for the compound structure element.
    static net.ssehub.easy.varModel.model.DecisionVariableDeclaration
    getDecisionVariable(net.ssehub.easy.varModel.model.Project source, String variableName, String suffix, net.ssehub.easy.varModel.model.Project destination)
    Returns a variable declaration by the name searching in a specific project.
    static net.ssehub.easy.varModel.model.AbstractVariable
    getDeclaration(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
    Returns a declaration from IDecisionVariable.
    static boolean
    modifyImports(net.ssehub.easy.varModel.model.Project mainProject, String command, net.ssehub.easy.varModel.model.ProjectImport pImport)
    Modifies the imports in the main pipeline project mainProject.
    static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree
    obtainAssignment(net.ssehub.easy.varModel.model.values.Value value, net.ssehub.easy.varModel.model.AbstractVariable declarationVariable)
    Return a ConstraintSyntayTree for Constraint setting.
    static net.ssehub.easy.varModel.model.values.Value
    obtainConstraintValue(String constraint, net.ssehub.easy.varModel.model.IModelElement parent)
    Turns a constraint string to a Constraint type of value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • BasicIVMLModelOperations

      public BasicIVMLModelOperations()
  • Method Details

    • getDecisionVariable

      public static net.ssehub.easy.varModel.model.DecisionVariableDeclaration getDecisionVariable(net.ssehub.easy.varModel.model.Project source, String variableName, String suffix, net.ssehub.easy.varModel.model.Project destination)
      Returns a variable declaration by the name searching in a specific project.
      Parameters:
      source - the project where search for the variable
      variableName - the name of the searching variable
      suffix - the suffix for the given variable name
      destination - the project where to add the variable
      Returns:
      a decision variable or null
    • obtainAssignment

      public static net.ssehub.easy.varModel.cst.ConstraintSyntaxTree obtainAssignment(net.ssehub.easy.varModel.model.values.Value value, net.ssehub.easy.varModel.model.AbstractVariable declarationVariable)
      Return a ConstraintSyntayTree for Constraint setting.
      Parameters:
      value - the value related to the given IDatatype
      declarationVariable - the variable declaration
      Returns:
      a ConstraintSyntayTree for Constraint setting
    • getConstraint

      public static net.ssehub.easy.varModel.model.Constraint getConstraint(Object[] objectValue, net.ssehub.easy.varModel.model.AbstractVariable declarationVariable, net.ssehub.easy.varModel.model.IModelElement parent)
      Returns a constraint for the compound structure element.
      Parameters:
      objectValue - the value for the compound element
      declarationVariable - the variable the constraint operates on
      parent - the object where the constraint is included
      Returns:
      a tree-structured constraint
    • getCompoundNameAndType

      public static Map<String,net.ssehub.easy.varModel.model.datatypes.IDatatype> getCompoundNameAndType(net.ssehub.easy.varModel.model.AbstractVariable decisionDeclaration)
      Returns a map which key is the variable name, value is the variable type.
      Parameters:
      decisionDeclaration - the compound decisionVariable
      Returns:
      a map with variableName and variableType
    • configureCompoundValues

      public static Object[] configureCompoundValues(net.ssehub.easy.varModel.model.DecisionVariableDeclaration decisionVariable, Map<String,Object> compound)
      Returns an Object array configured by corresponding values of the compound.
      Parameters:
      decisionVariable - the compound variable this configuration works on
      compound - the compound map brings the information from the pipeline editor graph
      Returns:
      an object array including the name and the variable of the compound
    • obtainConstraintValue

      public static net.ssehub.easy.varModel.model.values.Value obtainConstraintValue(String constraint, net.ssehub.easy.varModel.model.IModelElement parent)
      Turns a constraint string to a Constraint type of value.
      Parameters:
      constraint - the constraint string
      parent - the model element which the constraint belongs to
      Returns:
      a constraint value
    • getDeclaration

      public static net.ssehub.easy.varModel.model.AbstractVariable getDeclaration(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Returns a declaration from IDecisionVariable.
      Parameters:
      variable - the variable to be dereferenced
      Returns:
      a declaration of IDecisionVariable
    • modifyImports

      public static boolean modifyImports(net.ssehub.easy.varModel.model.Project mainProject, String command, net.ssehub.easy.varModel.model.ProjectImport pImport)
      Modifies the imports in the main pipeline project mainProject.
      Parameters:
      mainProject - the project to be modified
      command - the command how to modify the project, ADD or DEL
      pImport - the import to be added or deleted
      Returns:
      True if modify successfully, false otherwise
    • addRuntimeAttributeToProject

      public static boolean addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
      adds the binding time attribute to project.
      Parameters:
      project - the IVML project to add the attribute to
      fallbackForType - in case that project is being written the first time, may be null
      Returns:
      true if successful, false else
    • createFreezeBlock

      public static net.ssehub.easy.varModel.model.FreezeBlock createFreezeBlock(net.ssehub.easy.varModel.model.IFreezable[] freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
      Adds the freeze block to the project.
      Parameters:
      freezables - the freezables
      project - the IVML project to add to (may be null if failed)
      fallbackForType - in case that project is being written the first time, may be null
      Returns:
      the created freeze block
    • addFreezeBlock

      public static void addFreezeBlock(List<net.ssehub.easy.varModel.model.IFreezable> freezables, net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType)
      Adds the freeze block to the project.
      Parameters:
      freezables - the freezables
      project - the IVML project to add to
      fallbackForType - in case that project is being written the first time, may be null