Class ProjectFreezeModifier

java.lang.Object
eu.qualimaster.easy.extension.ProjectFreezeModifier
All Implemented Interfaces:
net.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier

public class ProjectFreezeModifier extends Object implements net.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier
This modifier is used to freeze all relevant declarations inside the CFG projects of Qualimaster.
Author:
El-Sharkawy
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Set<String>
     
    private net.ssehub.easy.varModel.confModel.Configuration
     
    private List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration>
     
    private static final int
     
    private Map<String,net.ssehub.easy.varModel.model.Project>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProjectFreezeModifier(net.ssehub.easy.varModel.model.Project mainProject, List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarations)
    Single constructor instance for this class.
  • Method Summary

    Modifier and Type
    Method
    Description
    private net.ssehub.easy.varModel.model.Attribute
    getBindingTimeAnnotation(net.ssehub.easy.varModel.model.Project project)
    Returns the binding time annotation of the project to create the selector statement of the freeze block.
    private boolean
    isRuntimeVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.DecisionVariableDeclaration declaration)
    Checks whether the given declaration is a runtime variable.
    void
    modifyProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.rewrite.RewriteContext context)
     

    Methods inherited from class java.lang.Object

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

    • RUNTIME_LEVEL

      private static final int RUNTIME_LEVEL
      See Also:
    • BLACKLIST

      private static final Set<String> BLACKLIST
    • declarations

      private List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarations
    • usedProjects

      private Map<String,net.ssehub.easy.varModel.model.Project> usedProjects
    • config

      private net.ssehub.easy.varModel.confModel.Configuration config
  • Constructor Details

    • ProjectFreezeModifier

      public ProjectFreezeModifier(net.ssehub.easy.varModel.model.Project mainProject, List<net.ssehub.easy.varModel.model.DecisionVariableDeclaration> declarations)
      Single constructor instance for this class.
      Parameters:
      mainProject - The main (copied) QM model, which imports all the other projects.
      declarations - The list of all declarations of the whole QM model, which should be frozen in all the different projects.
  • Method Details

    • modifyProject

      public void modifyProject(net.ssehub.easy.varModel.model.Project project, net.ssehub.easy.varModel.model.rewrite.RewriteContext context)
      Specified by:
      modifyProject in interface net.ssehub.easy.varModel.model.rewrite.modifier.IProjectModifier
    • isRuntimeVariable

      private boolean isRuntimeVariable(net.ssehub.easy.varModel.confModel.Configuration config, net.ssehub.easy.varModel.model.DecisionVariableDeclaration declaration)
      Checks whether the given declaration is a runtime variable.
      Parameters:
      config - The configuration where the declaration belongs to.
      declaration - The declaration to test.
      Returns:
      true if the variable is a runtime variable and should not be frozen, false else.
    • getBindingTimeAnnotation

      private net.ssehub.easy.varModel.model.Attribute getBindingTimeAnnotation(net.ssehub.easy.varModel.model.Project project)
      Returns the binding time annotation of the project to create the selector statement of the freeze block.
      Parameters:
      project - The project for which the freeze block shall be created.
      Returns:
      The binding time annotation or null it could not be found.