Class BasicIVMLModelOperations
java.lang.Object
eu.qualimaster.easy.extension.modelop.BasicIVMLModelOperations
The methods to operate the IVML model for obtaining IVML elements information.
- Author:
- Cui Qin
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddFreezeBlock(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 booleanaddRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) adds the binding time attribute toproject.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.FreezeBlockcreateFreezeBlock(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.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.ConstraintgetConstraint(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.DecisionVariableDeclarationgetDecisionVariable(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.AbstractVariablegetDeclaration(net.ssehub.easy.varModel.confModel.IDecisionVariable variable) Returns a declaration fromIDecisionVariable.static booleanmodifyImports(net.ssehub.easy.varModel.model.Project mainProject, String command, net.ssehub.easy.varModel.model.ProjectImport pImport) Modifies the imports in the main pipeline projectmainProject.static net.ssehub.easy.varModel.cst.ConstraintSyntaxTreeobtainAssignment(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.ValueobtainConstraintValue(String constraint, net.ssehub.easy.varModel.model.IModelElement parent) Turns a constraint string to a Constraint type of value.
-
Field Details
-
ADD
- See Also:
-
DEL
- See Also:
-
-
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 variablevariableName- the name of the searching variablesuffix- the suffix for the given variable namedestination- 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 IDatatypedeclarationVariable- 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 elementdeclarationVariable- the variable the constraint operates onparent- 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 oncompound- 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 stringparent- 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 fromIDecisionVariable.- 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 projectmainProject.- Parameters:
mainProject- the project to be modifiedcommand- the command how to modify the project,ADDorDELpImport- the import to be added or deleted- Returns:
Trueif modify successfully,falseotherwise
-
addRuntimeAttributeToProject
public static boolean addRuntimeAttributeToProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.Project fallbackForType) adds the binding time attribute toproject.- Parameters:
project- the IVML project to add the attribute tofallbackForType- in case thatprojectis being written the first time, may be null- Returns:
trueif successful,falseelse
-
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 freezablesproject- the IVML project to add to (may be null if failed)fallbackForType- in case thatprojectis 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 freezablesproject- the IVML project to add tofallbackForType- in case thatprojectis being written the first time, may be null
-